Files
multica/tests/setup/vitest.setup.ts
Jiayuan Zhang 5956554fa6 feat: redesign UI with Project -> Session hierarchy
- Add SQLite storage using sql.js for Project and Session data
- Implement Project -> Session hierarchical structure in sidebar
- Add drag-and-drop reordering for projects
- Reduce sidebar padding for better space utilization
- Show session title in top bar, remove folder name/path/status
- Add delete confirmation modals for projects and sessions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:11:45 +08:00

48 lines
914 B
TypeScript

import { vi } from 'vitest'
// Mock localStorage for zustand persist middleware
const localStorageMock = {
getItem: vi.fn(() => null),
setItem: vi.fn(),
removeItem: vi.fn(),
clear: vi.fn(),
length: 0,
key: vi.fn(() => null)
}
Object.defineProperty(globalThis, 'localStorage', {
value: localStorageMock,
writable: true
})
// Mock electron module globally
vi.mock('electron', () => ({
app: {
getPath: vi.fn().mockReturnValue('/mock/user/data')
}
}))
// Mock electron-log/main
vi.mock('electron-log/main', () => ({
default: {
initialize: vi.fn(),
transports: {
file: { level: false },
console: { level: 'debug' }
},
errorHandler: {
startCatching: vi.fn()
},
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
debug: vi.fn()
}
}))
// Mock @electron-toolkit/utils
vi.mock('@electron-toolkit/utils', () => ({
is: {
dev: true
}
}))