diff --git a/src/renderer/src/utils/__tests__/export.test.ts b/src/renderer/src/utils/__tests__/export.test.ts index 5d308f5a5..f252d0313 100644 --- a/src/renderer/src/utils/__tests__/export.test.ts +++ b/src/renderer/src/utils/__tests__/export.test.ts @@ -5,6 +5,29 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' // --- Mocks Setup --- +// Add this before the test suites +vi.mock('@renderer/config/minapps', () => { + return { + ORIGIN_DEFAULT_MIN_APPS: [], + DEFAULT_MIN_APPS: [], + loadCustomMiniApp: async () => [], + updateDefaultMinApps: vi.fn() + } +}) + +// Mock window.api +beforeEach(() => { + Object.defineProperty(window, 'api', { + value: { + file: { + read: vi.fn().mockResolvedValue('[]'), + writeWithId: vi.fn() + } + }, + configurable: true + }) +}) + // Mock i18n at the top level using vi.mock vi.mock('@renderer/i18n', () => ({ default: {