Commit d99c48b8 authored by JC Brand's avatar JC Brand

Fix failing test.

Modal query not specific enough when there are multiple modals
parent 4c3645c5
...@@ -78,8 +78,9 @@ ...@@ -78,8 +78,9 @@
remove_contact_button.click(); remove_contact_button.click();
return test_utils.waitUntil(() => u.isVisible(document.querySelector('.alert-danger')), 2000); return test_utils.waitUntil(() => u.isVisible(document.querySelector('.alert-danger')), 2000);
}).then(function () { }).then(function () {
expect(document.querySelector('.alert-danger .modal-title').textContent).toBe("Error"); const header = document.querySelector('.alert-danger .modal-title');
expect(document.querySelector('.modal:not(#user-profile-modal) .modal-body p').textContent.trim()) expect(header.textContent).toBe("Error");
expect(u.ancestor(header, '.modal-content').querySelector('.modal-body p').textContent.trim())
.toBe("Sorry, there was an error while trying to remove Max Frankfurter as a contact."); .toBe("Sorry, there was an error while trying to remove Max Frankfurter as a contact.");
document.querySelector('.alert-danger button.close').click(); document.querySelector('.alert-danger button.close').click();
const show_modal_button = view.el.querySelector('.show-user-details-modal'); const show_modal_button = view.el.querySelector('.show-user-details-modal');
......
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