Skip to content

Commit

Permalink
remove unnecessary MutationObserver stab.
Browse files Browse the repository at this point in the history
  • Loading branch information
torounit committed Aug 18, 2022
1 parent d86a43f commit 6e9a8ba
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions packages/components/src/disabled/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jest.mock( '@wordpress/dom', () => {
...focus,
focusable: {
...focus.focusable,
find( context ) {
find( context, ...rest ) {
// In JSDOM, all elements have zero'd widths and height.
// This is a metric for focusable's `isVisible`, so find
// and apply an arbitrary non-zero width.
Expand All @@ -34,29 +34,14 @@ jest.mock( '@wordpress/dom', () => {
}
);

return focus.focusable.find( ...arguments );
return focus.focusable.find( context, ...rest );
},
},
},
};
} );

describe( 'Disabled', () => {
let MutationObserver;

beforeAll( () => {
MutationObserver = window.MutationObserver;
window.MutationObserver = function () {};
window.MutationObserver.prototype = {
observe() {},
disconnect() {},
};
} );

afterAll( () => {
window.MutationObserver = MutationObserver;
} );

const Form = () => (
<form>
<input />
Expand Down

0 comments on commit 6e9a8ba

Please sign in to comment.