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>
This commit is contained in:
parent
2b1c80ea3f
commit
14006b548e
|
@ -958,13 +958,31 @@ describe('Core base tests', function() {
|
||||||
// travel in time +7000 milliseconds
|
// travel in time +7000 milliseconds
|
||||||
clock.tick(7500);
|
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');
|
$row = $('#testArea .toastify');
|
||||||
expect($row.length).toEqual(0);
|
expect($row.length).toEqual(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('show', function() {
|
describe('show', function() {
|
||||||
it('hides itself after a given time', function() {
|
it('hides itself after a given time', function() {
|
||||||
OC.Notification.showTemporary('', {timeout: 10});
|
OC.Notification.show('', {timeout: 10});
|
||||||
|
|
||||||
var $row = $('#testArea .toastify');
|
var $row = $('#testArea .toastify');
|
||||||
expect($row.length).toEqual(1);
|
expect($row.length).toEqual(1);
|
||||||
|
|
Loading…
Reference in New Issue