diff --git a/fronts-client/integration/fixtures/error-handling.js b/fronts-client/integration/fixtures/error-handling.js new file mode 100644 index 00000000000..26cebcf3838 --- /dev/null +++ b/fronts-client/integration/fixtures/error-handling.js @@ -0,0 +1,15 @@ +/** + * These errors are sometimes thrown by the browser and appear to be beyond our control. + * They don't stop execution, so ignore them. + */ +export const explicitErrorHandler = () => { + window.addEventListener('error', (e) => { + if ( + e.message === + 'ResizeObserver loop completed with undelivered notifications.' || + e.message === 'ResizeObserver loop limit exceeded' + ) { + e.stopImmediatePropagation(); + } + }); +}; diff --git a/fronts-client/integration/tests/main.spec.js b/fronts-client/integration/tests/main.spec.js index d905a0bc04b..8de68cd06e3 100644 --- a/fronts-client/integration/tests/main.spec.js +++ b/fronts-client/integration/tests/main.spec.js @@ -26,8 +26,10 @@ import { } from '../selectors'; import setup from '../server/setup'; import teardown from '../server/teardown'; +import { explicitErrorHandler } from '../fixtures/error-handling'; fixture`Fronts edit`.page`http://localhost:3456/v2/editorial` + .clientScripts({ content: `(${explicitErrorHandler.toString()})()` }) .before(setup) .after(teardown);