Tests: update Vitest $notify mock to use vi.fn() and include info method.

This commit is contained in:
Ömer Duran 2025-12-30 11:46:46 +01:00
parent 9d17de55e3
commit fd9ee97c67
No known key found for this signature in database
GPG key ID: 2550B0D579890013

View file

@ -30,9 +30,9 @@ if (typeof global.ResizeObserver === "undefined") {
constructor(callback) {
this.callback = callback;
}
observe() {}
unobserve() {}
disconnect() {}
observe() { }
unobserve() { }
disconnect() { }
};
}
@ -54,22 +54,22 @@ config.global.mocks = {
$event: {
subscribe: () => "sub-id",
subscribeOnce: () => "sub-id-once",
unsubscribe: () => {},
publish: () => {},
unsubscribe: () => { },
publish: () => { },
},
$view: {
enter: () => {},
leave: () => {},
enter: () => { },
leave: () => { },
isActive: () => true,
},
$notify: { success: () => {}, error: () => {}, warn: () => {} },
$notify: { success: vi.fn(), error: vi.fn(), warn: vi.fn(), info: vi.fn() },
$fullscreen: {
isSupported: () => true,
isEnabled: () => false,
request: () => Promise.resolve(),
exit: () => Promise.resolve(),
},
$clipboard: { selection: [], has: () => false, toggle: () => {} },
$clipboard: { selection: [], has: () => false, toggle: () => { } },
$util: {
hasTouch: () => false,
encodeHTML: (s) => s,