refactor store

This commit is contained in:
pa
2026-03-10 17:19:03 +09:00
parent 95c4a1d3e6
commit 1cbad7fb60
39 changed files with 1290 additions and 2366 deletions

View File

@@ -8,9 +8,13 @@ const mocks = vi.hoisted(() => ({
te: vi.fn((key) => key === 'view.moderation.filters.block')
}));
vi.mock('pinia', () => ({
storeToRefs: (store) => store
}));
vi.mock('pinia', async (importOriginal) => {
const actual = await importOriginal();
return {
...actual,
storeToRefs: (store) => store
};
});
vi.mock('../../../plugin', () => ({
i18n: {
@@ -26,11 +30,14 @@ vi.mock('../../../stores', () => ({
shiftHeld: mocks.shiftHeld
}),
useUserStore: () => ({
currentUser: mocks.currentUser,
showUserDialog: (...args) => mocks.showUserDialog(...args)
currentUser: mocks.currentUser
})
}));
vi.mock('../../../coordinators/userCoordinator', () => ({
showUserDialog: (...args) => mocks.showUserDialog(...args)
}));
vi.mock('../../../shared/utils', () => ({
formatDateFilter: (value, format) => `${format}:${value}`
}));