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

@@ -7,7 +7,7 @@ vi.mock('@/module/apiError.js', () => ({
}));
import Login from '@/views/Login/Login.vue';
import loginStore from '@/stores/login.ts';
import { useLoginStore } from '@/stores/login.ts';
describe('Login', () => {
let pinia;
@@ -46,7 +46,7 @@ describe('Login', () => {
it('enables login button when both fields have values', async () => {
const wrapper = mountLogin();
const store = loginStore();
const store = useLoginStore();
store.auth.username = 'user';
store.auth.password = 'pass';
await wrapper.vm.$nextTick();
@@ -56,7 +56,7 @@ describe('Login', () => {
it('shows error message when isInvalid', async () => {
const wrapper = mountLogin();
const store = loginStore();
const store = useLoginStore();
store.isInvalid = true;
await wrapper.vm.$nextTick();
expect(wrapper.text()).toContain('Incorrect account or password');
@@ -64,7 +64,7 @@ describe('Login', () => {
it('toggles password visibility', async () => {
const wrapper = mountLogin();
const store = loginStore();
const store = useLoginStore();
store.auth.password = 'secret';
await wrapper.vm.$nextTick();
@@ -86,7 +86,7 @@ describe('Login', () => {
const wrapper = mountLogin({
route: { query: { 'return-to': 'encodedUrl' } },
});
const store = loginStore();
const store = useLoginStore();
expect(store.rememberedReturnToUrl).toBe('encodedUrl');
});
});