1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-28 16:06:40 +01:00

chore: fixes tests

This commit is contained in:
Amir Raminfar
2025-10-24 08:43:46 -07:00
parent 1c6f30bcd3
commit 16de645a89
3 changed files with 122 additions and 213 deletions

View File

@@ -29,10 +29,17 @@ describe("<ContainerEventSource />", () => {
global.EventSource = EventSource;
// @ts-ignore
window.scrollTo = vi.fn();
global.IntersectionObserver = vi.fn().mockImplementation(() => ({
observe: vi.fn(),
disconnect: vi.fn(),
}));
global.IntersectionObserver = vi.fn().mockImplementation(
class {
observe = vi.fn();
disconnect = vi.fn();
unobserve = vi.fn();
takeRecords = vi.fn();
root = null;
rootMargin = "";
thresholds = [];
},
);
vi.useFakeTimers();
vi.setSystemTime(1560336942459);
});