diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js index 87b39da1f14..4a8e8f4f657 100644 --- a/core/js/tests/specs/coreSpec.js +++ b/core/js/tests/specs/coreSpec.js @@ -958,13 +958,31 @@ describe('Core base tests', function() { // travel in time +7000 milliseconds clock.tick(7500); + $row = $('#testArea .toastify'); + expect($row.length).toEqual(0); + }); + it('hides itself after a given time', function() { + OC.Notification.showTemporary('', {timeout: 10}); + + var $row = $('#testArea .toastify'); + expect($row.length).toEqual(1); + + // travel in time +7000 milliseconds + clock.tick(7500); + + $row = $('#testArea .toastify'); + expect($row.length).toEqual(1); + + // travel in time another 4000 milliseconds + clock.tick(4000); + $row = $('#testArea .toastify'); expect($row.length).toEqual(0); }); }); describe('show', function() { it('hides itself after a given time', function() { - OC.Notification.showTemporary('', {timeout: 10}); + OC.Notification.show('', {timeout: 10}); var $row = $('#testArea .toastify'); expect($row.length).toEqual(1);