Skip to content

Commit

Permalink
test(Modal): increase duration
Browse files Browse the repository at this point in the history
  • Loading branch information
wuda-io committed Dec 17, 2024
1 parent aae54a3 commit 48845ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/tests/modal/modalSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ describe('Modal:', () => {

it('Should have callbacks', (done) => {
let hasBeenClosed = false;
document.querySelector('.modal').addEventListener('close', () => {
const modal = document.querySelector('.modal');
const trigger1 = document.querySelector('.trigger');

modal.addEventListener('close', () => {
hasBeenClosed = true;
});
const trigger1 = document.querySelector('.trigger');
click(trigger1);
expect(hasBeenClosed).toEqual(false, 'callback not yet fired');
click(document.querySelector('.modal-footer a'));
setTimeout(() => {
expect(hasBeenClosed).toEqual(true, 'callback fired');
done();
}, 10);
}, 100);
});
});
});

0 comments on commit 48845ee

Please sign in to comment.