From 48845ee4578e7b9b5faa3545394f881b67b2e50a Mon Sep 17 00:00:00 2001 From: Daniel Wurzer Date: Tue, 17 Dec 2024 12:49:09 +0100 Subject: [PATCH] test(Modal): increase duration --- spec/tests/modal/modalSpec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/tests/modal/modalSpec.js b/spec/tests/modal/modalSpec.js index 22b96acbed..5f13b8f00e 100644 --- a/spec/tests/modal/modalSpec.js +++ b/spec/tests/modal/modalSpec.js @@ -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); }); }); });