diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-07-26 17:49:58 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-07-26 18:46:58 +0200 |
commit | 14006b548ec76a351c2adfeb27cc2aebaf8cf7dc (patch) | |
tree | 8daba070bb8c3f6c0c0d0b75ca9c1b85e9e88138 /core | |
parent | 2b1c80ea3f742014ea7e45d6a5408fd94a5d80b4 (diff) | |
download | nextcloud-server-14006b548ec76a351c2adfeb27cc2aebaf8cf7dc.tar.gz nextcloud-server-14006b548ec76a351c2adfeb27cc2aebaf8cf7dc.zip |
Fix mixed test for "show" and "showTemporary"
"showTemporary()" when a timeout was given was being tested along with
the "show()" tests; now there are two separate tests when a timeout is
given, one for "showTemporary()" and one for "show()".
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'core')
-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); |