mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-28 11:13:49 +02:00
fix test
This commit is contained in:
@@ -38,6 +38,10 @@ vi.mock('../../../../coordinators/imageUploadCoordinator', () => ({
|
||||
uploadImageLegacy: vi.fn()
|
||||
}));
|
||||
|
||||
vi.mock('../../../../coordinators/avatarCoordinator', () => ({
|
||||
removeAvatarFromCache: vi.fn()
|
||||
}));
|
||||
|
||||
const { copyToClipboard, openExternalLink } =
|
||||
await import('../../../../shared/utils');
|
||||
const { favoriteRequest, avatarRequest, avatarModerationRequest } =
|
||||
|
||||
@@ -27,11 +27,15 @@ vi.mock('../../../../stores', () => ({
|
||||
vi.mock('../../../../composables/useInviteChecks', () => ({
|
||||
useInviteChecks: () => ({ checkCanInvite: () => true })
|
||||
}));
|
||||
vi.mock('../../../../composables/useRecentActions', () => ({
|
||||
isActionRecent: () => false
|
||||
}));
|
||||
vi.mock('../../../ui/dropdown-menu', () => ({
|
||||
DropdownMenu: { template: '<div><slot /></div>' },
|
||||
DropdownMenuTrigger: { template: '<div><slot /></div>' },
|
||||
DropdownMenuContent: { template: '<div><slot /></div>' },
|
||||
DropdownMenuSeparator: { template: '<hr />' },
|
||||
DropdownMenuShortcut: { template: '<span><slot /></span>' },
|
||||
DropdownMenuItem: {
|
||||
emits: ['click'],
|
||||
template:
|
||||
@@ -51,6 +55,7 @@ vi.mock('../../../ui/tooltip', () => ({
|
||||
vi.mock('lucide-vue-next', () => ({
|
||||
Check: { template: '<i />' },
|
||||
CheckCircle: { template: '<i />' },
|
||||
Clock: { template: '<i />' },
|
||||
Flag: { template: '<i />' },
|
||||
LineChart: { template: '<i />' },
|
||||
Mail: { template: '<i />' },
|
||||
|
||||
@@ -223,13 +223,13 @@ describe('UserDialogAvatarsTab.vue', () => {
|
||||
expect(input.exists()).toBe(true);
|
||||
});
|
||||
|
||||
test('does not render search input for other users', () => {
|
||||
test('renders search input for other users too', () => {
|
||||
const wrapper = mountComponent({
|
||||
id: 'usr_other',
|
||||
ref: { id: 'usr_other' }
|
||||
});
|
||||
const input = wrapper.find('input');
|
||||
expect(input.exists()).toBe(false);
|
||||
expect(input.exists()).toBe(true);
|
||||
});
|
||||
|
||||
test('filters avatars by search query', async () => {
|
||||
|
||||
@@ -39,6 +39,13 @@ vi.mock('../../../../services/database', () => ({
|
||||
}
|
||||
}));
|
||||
|
||||
vi.mock('../../../../composables/useRecentActions', () => ({
|
||||
recordRecentAction: vi.fn(),
|
||||
useRecentActions: () => ({
|
||||
isRecentAction: vi.fn(() => false)
|
||||
})
|
||||
}));
|
||||
|
||||
// Import mocks after vi.mock
|
||||
const { copyToClipboard } = await import('../../../../shared/utils');
|
||||
const {
|
||||
|
||||
@@ -36,6 +36,10 @@ vi.mock('../../../../coordinators/imageUploadCoordinator', () => ({
|
||||
uploadImageLegacy: vi.fn()
|
||||
}));
|
||||
|
||||
vi.mock('../../../../coordinators/worldCoordinator', () => ({
|
||||
removeWorldFromCache: vi.fn()
|
||||
}));
|
||||
|
||||
const { favoriteRequest, miscRequest, userRequest, worldRequest } =
|
||||
await import('../../../../api');
|
||||
const { openExternalLink } = await import('../../../../shared/utils');
|
||||
|
||||
Reference in New Issue
Block a user