A try of overhauling the frontend tests, bailed after 24h+
This commit is contained in:
@@ -1 +1,21 @@
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
import '@testing-library/jest-dom';
|
||||
import { vi, beforeAll } from 'vitest';
|
||||
|
||||
// Mock localStorage
|
||||
const localStorageMock = (() => {
|
||||
let store: Record<string, string> = {};
|
||||
return {
|
||||
getItem: (key: string) => store[key] || null,
|
||||
setItem: (key: string, value: string) => { store[key] = value.toString(); },
|
||||
removeItem: (key: string) => { delete store[key]; },
|
||||
clear: () => { store = {}; },
|
||||
};
|
||||
})();
|
||||
|
||||
Object.defineProperty(window, 'localStorage', {
|
||||
value: localStorageMock,
|
||||
});
|
||||
|
||||
beforeAll(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user