Standardize store exports to named useXxxStore convention

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 13:25:00 +08:00
parent 147b16ca34
commit 90048d0505
69 changed files with 241 additions and 241 deletions

View File

@@ -16,7 +16,7 @@ vi.mock('@/api/client.js', () => ({
vi.mock('@/stores/login.ts', () => {
const { defineStore } = require('pinia');
return {
default: defineStore('loginStore', {
useLoginStore: defineStore('loginStore', {
state: () => ({
userData: { username: 'currentUser', name: 'Current' },
}),
@@ -27,7 +27,7 @@ vi.mock('@/stores/login.ts', () => {
};
});
import useAcctMgmtStore from '@/stores/acctMgmt.ts';
import { useAcctMgmtStore } from '@/stores/acctMgmt.ts';
describe('acctMgmtStore', () => {
let store;

View File

@@ -12,7 +12,7 @@ vi.mock('@/api/client.js', () => ({
default: { get: mockGet, post: mockPost, put: mockPut },
}));
import useAllMapDataStore from '@/stores/allMapData.js';
import { useAllMapDataStore } from '@/stores/allMapData.js';
describe('allMapDataStore', () => {
let store;

View File

@@ -10,7 +10,7 @@ vi.mock('@/api/client.js', () => ({
default: { get: mockGet },
}));
import useCompareStore from '@/stores/compare.js';
import { useCompareStore } from '@/stores/compare.js';
describe('compareStore', () => {
let store;

View File

@@ -13,7 +13,7 @@ vi.mock('@/api/client.js', () => ({
}));
import apiError from '@/module/apiError.js';
import useConformanceStore from '@/stores/conformance.js';
import { useConformanceStore } from '@/stores/conformance.js';
describe('conformanceStore', () => {
let store;

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { setActivePinia, createPinia } from 'pinia';
import useConformanceInputStore from '@/stores/conformanceInput.js';
import { useConformanceInputStore } from '@/stores/conformanceInput.js';
describe('conformanceInputStore', () => {
let store;

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { setActivePinia, createPinia } from 'pinia';
import useCytoscapeStore from '@/stores/cytoscapeStore.ts';
import { useCytoscapeStore } from '@/stores/cytoscapeStore.ts';
import { SAVE_KEY_NAME } from '@/constants/constants.js';
// Mock localStorage since jsdom's localStorage is limited

View File

@@ -28,7 +28,7 @@ vi.mock('@/api/client.js', () => ({
default: { get: mockGet, post: mockPost, put: mockPut, delete: mockDelete },
}));
import useFilesStore from '@/stores/files.js';
import { useFilesStore } from '@/stores/files.js';
describe('filesStore', () => {
let store;

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { setActivePinia, createPinia } from 'pinia';
import useLoadingStore from '@/stores/loading.js';
import { useLoadingStore } from '@/stores/loading.js';
describe('loadingStore', () => {
let store;

View File

@@ -13,7 +13,7 @@ vi.mock('@/api/client.js', () => ({
default: { get: mockClientGet },
}));
import useLoginStore from '@/stores/login.ts';
import { useLoginStore } from '@/stores/login.ts';
// Mock axios methods (used for signIn/refreshToken which call plain axios)
vi.spyOn(axios, 'post').mockImplementation(vi.fn());

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { setActivePinia, createPinia } from 'pinia';
import useMapCompareStore from '@/stores/mapCompareStore.ts';
import { useMapCompareStore } from '@/stores/mapCompareStore.ts';
describe('mapCompareStore', () => {
let store;

View File

@@ -16,7 +16,7 @@ vi.mock('@/assets/capsule2.svg', () => ({ default: 'cap2' }));
vi.mock('@/assets/capsule3.svg', () => ({ default: 'cap3' }));
vi.mock('@/assets/capsule4.svg', () => ({ default: 'cap4' }));
import useMapPathStore from '@/stores/mapPathStore.ts';
import { useMapPathStore } from '@/stores/mapPathStore.ts';
/**
* Creates a mock Cytoscape node.

View File

@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { setActivePinia, createPinia } from 'pinia';
import usePageAdminStore from '@/stores/pageAdmin.js';
import { usePageAdminStore } from '@/stores/pageAdmin.js';
describe('pageAdminStore', () => {
let store;

View File

@@ -10,7 +10,7 @@ vi.mock('@/api/client.js', () => ({
default: { get: mockGet },
}));
import usePerformanceStore from '@/stores/performance.js';
import { usePerformanceStore } from '@/stores/performance.js';
describe('performanceStore', () => {
let store;