feat: Search a11y updated behavior. (#1614)
* feat: Updated accesibility on courseware search modal * chore: Updated i18n to use useIntl() hook and dialog behavior updates * feat: Added close when clicking on the modal backdrop * chore: Swapped remove listeners with an AbortController * fix: Fixed tests * chore: Rolled back unintended husky script change
This commit is contained in:
@@ -61,6 +61,18 @@ const supressWarningBlock = (callback) => {
|
||||
};
|
||||
/* eslint-enable no-console */
|
||||
|
||||
// Mocks for HTML Dialogs behavior. */
|
||||
// jsdom does not support HTML Dialogs yet: https://github.com/jsdom/jsdom/issues/3294
|
||||
HTMLDialogElement.prototype.show = jest.fn();
|
||||
HTMLDialogElement.prototype.showModal = jest.fn(function mock() {
|
||||
const onShowModal = new CustomEvent('show_modal');
|
||||
this.dispatchEvent(onShowModal);
|
||||
});
|
||||
HTMLDialogElement.prototype.close = jest.fn(function mock() {
|
||||
const onClose = new CustomEvent('close');
|
||||
this.dispatchEvent(onClose);
|
||||
});
|
||||
|
||||
// Mock Intersection Observer which is unavailable in the context of a test.
|
||||
global.IntersectionObserver = jest.fn(function mockIntersectionObserver() {
|
||||
this.observe = jest.fn();
|
||||
|
||||
Reference in New Issue
Block a user