Update confirm modal specs

parent e11b003c
...@@ -51,7 +51,7 @@ describe('ConfirmModal', () => { ...@@ -51,7 +51,7 @@ describe('ConfirmModal', () => {
const findModalOkButton = (modal, variant) => const findModalOkButton = (modal, variant) =>
modal.querySelector(`.modal-footer .btn-${variant}`); modal.querySelector(`.modal-footer .btn-${variant}`);
const findModalCancelButton = modal => modal.querySelector('.modal-footer .btn-secondary'); const findModalCancelButton = modal => modal.querySelector('.modal-footer .btn-secondary');
const modalIsHidden = () => findModal().getAttribute('aria-hidden') === 'true'; const modalIsHidden = () => findModal() === null;
const serializeModal = (modal, buttonIndex) => { const serializeModal = (modal, buttonIndex) => {
const { modalAttributes } = buttons[buttonIndex]; const { modalAttributes } = buttons[buttonIndex];
...@@ -101,11 +101,13 @@ describe('ConfirmModal', () => { ...@@ -101,11 +101,13 @@ describe('ConfirmModal', () => {
}); });
it('closes the modal', () => { it('closes the modal', () => {
setImmediate(() => {
expect(modalIsHidden()).toBe(true); expect(modalIsHidden()).toBe(true);
}); });
}); });
}); });
}); });
});
describe.each` describe.each`
index index
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment