mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-13 13:18:56 +02:00
- 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>
48 lines
914 B
TypeScript
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
|
|
}
|
|
}))
|