Standardize store exports to named useXxxStore convention
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,16 +3,16 @@ import { setActivePinia, createPinia } from 'pinia';
|
||||
|
||||
// Mock all heavy imports that MainContainer.vue pulls in
|
||||
vi.mock('@/stores/loading.js', () => ({
|
||||
default: () => ({ isLoading: false }),
|
||||
useLoadingStore: () => ({ isLoading: false }),
|
||||
}));
|
||||
vi.mock('@/stores/allMapData.js', () => ({
|
||||
default: () => ({}),
|
||||
useAllMapDataStore: () => ({}),
|
||||
}));
|
||||
vi.mock('@/stores/conformance.js', () => ({
|
||||
default: () => ({}),
|
||||
useConformanceStore: () => ({}),
|
||||
}));
|
||||
vi.mock('@/stores/pageAdmin.js', () => ({
|
||||
default: () => ({}),
|
||||
usePageAdminStore: () => ({}),
|
||||
}));
|
||||
vi.mock('@/module/alertModal.js', () => ({
|
||||
leaveFilter: vi.fn(),
|
||||
@@ -26,7 +26,7 @@ vi.mock('@/router/index.ts', () => ({
|
||||
}));
|
||||
vi.mock('@/module/cytoscapeMap.js', () => ({}));
|
||||
|
||||
import LoginStore from '@/stores/login.ts';
|
||||
import { useLoginStore } from '@/stores/login.ts';
|
||||
import * as cookieUtil from '@/utils/cookieUtil.js';
|
||||
|
||||
// Import the component definition to access beforeRouteEnter
|
||||
@@ -38,7 +38,7 @@ describe('MainContainer beforeRouteEnter', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
setActivePinia(createPinia());
|
||||
loginStore = LoginStore();
|
||||
loginStore = useLoginStore();
|
||||
loginStore.$router = { push: vi.fn() };
|
||||
next = vi.fn();
|
||||
vi.clearAllMocks();
|
||||
|
||||
Reference in New Issue
Block a user