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>
pull/16573/head
Daniel Calviño Sánchez 7 years ago
parent 2b1c80ea3f
commit 14006b548e
  1. 20
      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);

Loading…
Cancel
Save