diff --git a/tests/js/workspace-images-selection.test.js b/tests/js/workspace-images-selection.test.js index 8d278c9e..0ff75023 100644 --- a/tests/js/workspace-images-selection.test.js +++ b/tests/js/workspace-images-selection.test.js @@ -69,16 +69,15 @@ function fakeDOM() { createElement: tag => new Element(tag), createTextNode: text => Object.assign(new Element('#text'), { _text: String(text) }), getElementById: id => (id === 'workspace-toast' ? toast : null), - documentElement: { style: { setProperty() {}, removeProperty() {} } }, }; - // The bar publishes its height for the sticky chrome (D186); nothing in this DOM ever resizes. - const previousObserver = globalThis.ResizeObserver; - globalThis.ResizeObserver = class { observe() {} disconnect() {} }; - return { Element, body, toast, restore() { globalThis.document = previous; globalThis.ResizeObserver = previousObserver; } }; + return { Element, body, toast, restore() { globalThis.document = previous; } }; } /** The bar over `items` with `checked` keys; `options` adds the collection props. */ function mountBar(dom, items, checkedKeys, options = {}) { + // The bar publishes its height for the sticky chrome (D186); nothing in this DOM ever resizes. + globalThis.ResizeObserver ??= class { observe() {} disconnect() {} }; + document.documentElement ??= { style: { setProperty() {}, removeProperty() {} } }; const scope = createScope(); const grid = new dom.Element('div'); const focusFallback = new dom.Element('h1');