fix: Lazy unloading should not leave dangling connections (#2004)

- Closes #1992
This commit is contained in:
Dermot Duffy
2025-04-12 10:48:37 +01:00
committed by GitHub
parent a24c9628c5
commit a5ffd51728
12 changed files with 397 additions and 468 deletions
-9
View File
@@ -35,15 +35,6 @@ export const callEmblaHandler = (
}
};
export const callVisibilityHandler = async (): Promise<void> => {
const mock = vi.mocked(global.document.addEventListener).mock;
for (const [evt, cb] of mock.calls) {
if (evt === 'visibilitychange' && typeof cb === 'function') {
await (cb as EventListener | ((_: unknown) => Promise<void>))(new Event('foo'));
}
}
};
export const callResizeHandler = (
entries: {
target: HTMLElement;