diff options
-rw-r--r-- | core/js/tests/specs/coreSpec.js | 20 |
1 files changed, 19 insertions, 1 deletions
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 @@ -961,10 +961,28 @@ describe('Core base tests', function() { $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); |