mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
refactor store
This commit is contained in:
@@ -149,6 +149,7 @@
|
||||
import { useDataTableScrollHeight } from '../../composables/useDataTableScrollHeight';
|
||||
import { useVrcxVueTable } from '../../lib/table/useVrcxVueTable';
|
||||
import { showUserDialog } from '../../coordinators/userCoordinator';
|
||||
import { confirmDeleteFriend, handleFriendDelete } from '../../coordinators/friendRelationshipCoordinator';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -156,7 +157,7 @@ import { showUserDialog } from '../../coordinators/userCoordinator';
|
||||
|
||||
const { friends, allFavoriteFriendIds } = storeToRefs(useFriendStore());
|
||||
const modalStore = useModalStore();
|
||||
const { getAllUserStats, getAllUserMutualCount, confirmDeleteFriend, handleFriendDelete } = useFriendStore();
|
||||
const { getAllUserStats, getAllUserMutualCount } = useFriendStore();
|
||||
const appearanceSettingsStore = useAppearanceSettingsStore();
|
||||
const { randomUserColours } = storeToRefs(appearanceSettingsStore);
|
||||
|
||||
|
||||
@@ -40,9 +40,13 @@ mocks.pagination = mocks.makeRef({
|
||||
});
|
||||
mocks.sorting = mocks.makeRef([]);
|
||||
|
||||
vi.mock('pinia', () => ({
|
||||
storeToRefs: (store) => store
|
||||
}));
|
||||
vi.mock('pinia', async (importOriginal) => {
|
||||
const actual = await importOriginal();
|
||||
return {
|
||||
...actual,
|
||||
storeToRefs: (store) => store
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('vue-i18n', () => ({
|
||||
useI18n: () => ({
|
||||
@@ -66,9 +70,7 @@ vi.mock('../../../stores', () => ({
|
||||
friends: mocks.friends,
|
||||
allFavoriteFriendIds: mocks.allFavoriteFriendIds,
|
||||
getAllUserStats: mocks.getAllUserStats,
|
||||
getAllUserMutualCount: mocks.getAllUserMutualCount,
|
||||
confirmDeleteFriend: mocks.confirmDeleteFriend,
|
||||
handleFriendDelete: mocks.handleFriendDelete
|
||||
getAllUserMutualCount: mocks.getAllUserMutualCount
|
||||
}),
|
||||
useModalStore: () => ({
|
||||
confirm: (...args) => mocks.modalConfirm(...args),
|
||||
@@ -78,9 +80,7 @@ vi.mock('../../../stores', () => ({
|
||||
stringComparer: mocks.stringComparer,
|
||||
friendsListSearch: mocks.friendsListSearch
|
||||
}),
|
||||
useUserStore: () => ({
|
||||
showUserDialog: (...args) => mocks.showUserDialog(...args)
|
||||
}),
|
||||
useUserStore: () => ({}),
|
||||
useAppearanceSettingsStore: () => ({
|
||||
tablePageSizes: [10, 25, 50],
|
||||
tablePageSize: 25,
|
||||
@@ -91,6 +91,15 @@ vi.mock('../../../stores', () => ({
|
||||
})
|
||||
}));
|
||||
|
||||
vi.mock('../../../coordinators/userCoordinator', () => ({
|
||||
showUserDialog: (...args) => mocks.showUserDialog(...args)
|
||||
}));
|
||||
|
||||
vi.mock('../../../coordinators/friendRelationshipCoordinator', () => ({
|
||||
confirmDeleteFriend: (...args) => mocks.confirmDeleteFriend(...args),
|
||||
handleFriendDelete: (...args) => mocks.handleFriendDelete(...args)
|
||||
}));
|
||||
|
||||
vi.mock('../../../plugin/router', () => ({
|
||||
router: {
|
||||
push: (...args) => mocks.routerPush(...args)
|
||||
|
||||
Reference in New Issue
Block a user