From 14006b548ec76a351c2adfeb27cc2aebaf8cf7dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 26 Jul 2019 17:49:58 +0200 Subject: [PATCH] Fix mixed test for "show" and "showTemporary" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "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 --- core/js/tests/specs/coreSpec.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js index 87b39da1f1..4a8e8f4f65 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);