mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-30 04:03:48 +02:00
use oxfmt instead of prettier
This commit is contained in:
@@ -50,10 +50,18 @@ const showAvatarDialog = vi.fn();
|
||||
const showWorldDialog = vi.fn();
|
||||
const showGroupDialog = vi.fn();
|
||||
|
||||
vi.mock('../../coordinators/userCoordinator', () => ({ showUserDialog: (...args) => showUserDialog(...args) }));
|
||||
vi.mock('../../coordinators/avatarCoordinator', () => ({ showAvatarDialog: (...args) => showAvatarDialog(...args) }));
|
||||
vi.mock('../../coordinators/worldCoordinator', () => ({ showWorldDialog: (...args) => showWorldDialog(...args) }));
|
||||
vi.mock('../../coordinators/groupCoordinator', () => ({ showGroupDialog: (...args) => showGroupDialog(...args) }));
|
||||
vi.mock('../../coordinators/userCoordinator', () => ({
|
||||
showUserDialog: (...args) => showUserDialog(...args)
|
||||
}));
|
||||
vi.mock('../../coordinators/avatarCoordinator', () => ({
|
||||
showAvatarDialog: (...args) => showAvatarDialog(...args)
|
||||
}));
|
||||
vi.mock('../../coordinators/worldCoordinator', () => ({
|
||||
showWorldDialog: (...args) => showWorldDialog(...args)
|
||||
}));
|
||||
vi.mock('../../coordinators/groupCoordinator', () => ({
|
||||
showGroupDialog: (...args) => showGroupDialog(...args)
|
||||
}));
|
||||
|
||||
import { useGlobalSearchStore } from '../globalSearch';
|
||||
|
||||
@@ -104,7 +112,10 @@ describe('useGlobalSearchStore', () => {
|
||||
});
|
||||
expect(store.friendResults).toEqual([]);
|
||||
|
||||
mocks.friendStore.friends.set('usr_new', { id: 'usr_new', ref: { id: 'usr_new' } });
|
||||
mocks.friendStore.friends.set('usr_new', {
|
||||
id: 'usr_new',
|
||||
ref: { id: 'usr_new' }
|
||||
});
|
||||
worker.emit({
|
||||
type: 'searchResult',
|
||||
payload: {
|
||||
|
||||
@@ -119,9 +119,7 @@ describe('notyGetImage', () => {
|
||||
|
||||
test('returns empty string when user lookup fails', async () => {
|
||||
deps.getUserIdFromNoty.mockReturnValue('usr_abc');
|
||||
deps.queryRequest.fetch.mockRejectedValue(
|
||||
new Error('Network error')
|
||||
);
|
||||
deps.queryRequest.fetch.mockRejectedValue(new Error('Network error'));
|
||||
dispatch = createOverlayDispatch(deps);
|
||||
|
||||
const result = await dispatch.notyGetImage({});
|
||||
|
||||
@@ -221,9 +221,7 @@ describe('useSearchStore', () => {
|
||||
});
|
||||
|
||||
test('parses vrchat.com group URL', () => {
|
||||
store.directAccessParse(
|
||||
'https://vrchat.com/home/group/grp_abc123'
|
||||
);
|
||||
store.directAccessParse('https://vrchat.com/home/group/grp_abc123');
|
||||
expect(mockShowGroupDialog).toHaveBeenCalledWith('grp_abc123');
|
||||
});
|
||||
|
||||
@@ -248,9 +246,9 @@ describe('useSearchStore', () => {
|
||||
});
|
||||
|
||||
test('returns false for short vrchat URL with insufficient path segments', () => {
|
||||
expect(
|
||||
store.directAccessParse('https://vrchat.com/home')
|
||||
).toBe(false);
|
||||
expect(store.directAccessParse('https://vrchat.com/home')).toBe(
|
||||
false
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@ describe('searchWorker message protocol', () => {
|
||||
|
||||
harness.dispatch({
|
||||
type: 'search',
|
||||
payload: { seq: 7, query: 'a', currentUserId: 'usr_me', language: 'en-US' }
|
||||
payload: {
|
||||
seq: 7,
|
||||
query: 'a',
|
||||
currentUserId: 'usr_me',
|
||||
language: 'en-US'
|
||||
}
|
||||
});
|
||||
|
||||
expect(harness.sent).toHaveLength(1);
|
||||
@@ -57,17 +62,45 @@ describe('searchWorker message protocol', () => {
|
||||
type: 'updateIndex',
|
||||
payload: {
|
||||
friends: [],
|
||||
avatars: [{ id: 'avtr_1', name: 'Alpha Avatar', authorId: 'usr_me', imageUrl: '' }],
|
||||
worlds: [{ id: 'wrld_1', name: 'Alpha World', authorId: 'usr_me', imageUrl: '' }],
|
||||
groups: [{ id: 'grp_1', name: 'Alpha Group', ownerId: 'usr_me', imageUrl: '' }],
|
||||
favAvatars: [{ id: 'avtr_1', name: 'Alpha Avatar', imageUrl: '' }],
|
||||
avatars: [
|
||||
{
|
||||
id: 'avtr_1',
|
||||
name: 'Alpha Avatar',
|
||||
authorId: 'usr_me',
|
||||
imageUrl: ''
|
||||
}
|
||||
],
|
||||
worlds: [
|
||||
{
|
||||
id: 'wrld_1',
|
||||
name: 'Alpha World',
|
||||
authorId: 'usr_me',
|
||||
imageUrl: ''
|
||||
}
|
||||
],
|
||||
groups: [
|
||||
{
|
||||
id: 'grp_1',
|
||||
name: 'Alpha Group',
|
||||
ownerId: 'usr_me',
|
||||
imageUrl: ''
|
||||
}
|
||||
],
|
||||
favAvatars: [
|
||||
{ id: 'avtr_1', name: 'Alpha Avatar', imageUrl: '' }
|
||||
],
|
||||
favWorlds: [{ id: 'wrld_1', name: 'Alpha World', imageUrl: '' }]
|
||||
}
|
||||
});
|
||||
|
||||
harness.dispatch({
|
||||
type: 'search',
|
||||
payload: { seq: 8, query: 'Alpha', currentUserId: 'usr_me', language: 'en-US' }
|
||||
payload: {
|
||||
seq: 8,
|
||||
query: 'Alpha',
|
||||
currentUserId: 'usr_me',
|
||||
language: 'en-US'
|
||||
}
|
||||
});
|
||||
|
||||
const result = harness.sent.at(-1);
|
||||
|
||||
@@ -28,10 +28,9 @@ vi.mock('vue-sonner', () => ({
|
||||
|
||||
vi.mock('vue-i18n', () => ({
|
||||
useI18n: () => ({
|
||||
t: (key) => key
|
||||
,
|
||||
locale: require('vue').ref('en')
|
||||
})
|
||||
t: (key) => key,
|
||||
locale: require('vue').ref('en')
|
||||
})
|
||||
}));
|
||||
|
||||
function flushPromises() {
|
||||
|
||||
Reference in New Issue
Block a user