mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-26 10:13:48 +02:00
refactor queryRequest
This commit is contained in:
@@ -48,7 +48,9 @@ const mocks = vi.hoisted(() => ({
|
||||
localFriendFavorites: { value: {} }
|
||||
},
|
||||
locationStore: {
|
||||
lastLocation: { value: { location: 'wrld_home:123', friendList: new Map() } },
|
||||
lastLocation: {
|
||||
value: { location: 'wrld_home:123', friendList: new Map() }
|
||||
},
|
||||
lastLocationDestination: { value: '' }
|
||||
},
|
||||
gameStore: {
|
||||
@@ -62,9 +64,7 @@ const mocks = vi.hoisted(() => ({
|
||||
sendRequestInvite: vi.fn().mockResolvedValue({}),
|
||||
sendInvite: vi.fn().mockResolvedValue({})
|
||||
},
|
||||
worldRequest: {
|
||||
getCachedWorld: vi.fn().mockResolvedValue({ ref: { name: 'World' } })
|
||||
},
|
||||
worldRequest: {},
|
||||
instanceRequest: {
|
||||
selfInvite: vi.fn().mockResolvedValue({})
|
||||
},
|
||||
@@ -162,7 +162,8 @@ vi.mock('../../../../components/ui/context-menu', () => ({
|
||||
ContextMenuItem: {
|
||||
emits: ['click'],
|
||||
props: ['disabled'],
|
||||
template: '<button :disabled="disabled" @click="$emit(\'click\')"><slot /></button>'
|
||||
template:
|
||||
'<button :disabled="disabled" @click="$emit(\'click\')"><slot /></button>'
|
||||
},
|
||||
ContextMenuSeparator: { template: '<hr />' },
|
||||
ContextMenuSub: { template: '<div><slot /></div>' },
|
||||
@@ -277,7 +278,10 @@ describe('FriendsSidebar.vue', () => {
|
||||
test('renders same-instance section when grouping is enabled', async () => {
|
||||
mocks.appearanceStore.isSidebarGroupByInstance.value = true;
|
||||
mocks.friendStore.friendsInSameInstance.value = [
|
||||
[makeFriend('usr_a', 'wrld_same:1'), makeFriend('usr_b', 'wrld_same:1')]
|
||||
[
|
||||
makeFriend('usr_a', 'wrld_same:1'),
|
||||
makeFriend('usr_b', 'wrld_same:1')
|
||||
]
|
||||
];
|
||||
|
||||
const wrapper = mount(FriendsSidebar);
|
||||
|
||||
@@ -106,8 +106,8 @@
|
||||
|
||||
import { formatDateFilter, getGroupName, replaceBioSymbols } from '../../../shared/utils';
|
||||
import { Switch } from '../../../components/ui/switch';
|
||||
import { groupRequest } from '../../../api';
|
||||
import { processBulk } from '../../../service/request';
|
||||
import { queryRequest } from '../../../api';
|
||||
import { useGroupStore } from '../../../stores';
|
||||
|
||||
import GroupCalendarEventCard from '../components/GroupCalendarEventCard.vue';
|
||||
@@ -355,7 +355,7 @@
|
||||
calendar.value = [];
|
||||
try {
|
||||
await processBulk({
|
||||
fn: (bulkParams) => queryRequest.fetch('groupCalendars', bulkParams),
|
||||
fn: (bulkParams) => groupRequest.getGroupCalendars(bulkParams),
|
||||
N: -1,
|
||||
params: {
|
||||
n: 100,
|
||||
@@ -384,7 +384,7 @@
|
||||
followingCalendar.value = [];
|
||||
try {
|
||||
await processBulk({
|
||||
fn: (bulkParams) => queryRequest.fetch('followingGroupCalendars', bulkParams),
|
||||
fn: (bulkParams) => groupRequest.getFollowingGroupCalendars(bulkParams),
|
||||
N: -1,
|
||||
params: {
|
||||
n: 100,
|
||||
@@ -411,7 +411,7 @@
|
||||
featuredCalendar.value = [];
|
||||
try {
|
||||
await processBulk({
|
||||
fn: (bulkParams) => queryRequest.fetch('featuredGroupCalendars', bulkParams),
|
||||
fn: (bulkParams) => groupRequest.getFeaturedGroupCalendars(bulkParams),
|
||||
N: -1,
|
||||
params: {
|
||||
n: 100,
|
||||
|
||||
Reference in New Issue
Block a user