This commit is contained in:
pa
2026-03-16 16:01:07 +09:00
parent 4c6f80277e
commit fadead9c80
24 changed files with 183 additions and 92 deletions

View File

@@ -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 } =

View File

@@ -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 />' },

View File

@@ -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 () => {

View File

@@ -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 {

View File

@@ -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');