From f570b397a567b5d3fd3ad17845cf0ad29a78ec2b Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Wed, 21 Jan 2026 02:50:24 +0100 Subject: [PATCH] test: remove any type from BaseThumbnail test component instance - Replace `wrapper.vm as any` with properly typed ComponentInstance - Define ComponentInstance type with error property - Improve type safety for internal state access in tests Part of Phase 2 - Quick wins (1 instance removed) --- src/components/templates/thumbnails/BaseThumbnail.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/templates/thumbnails/BaseThumbnail.test.ts b/src/components/templates/thumbnails/BaseThumbnail.test.ts index ecb03df41..f1d8571ee 100644 --- a/src/components/templates/thumbnails/BaseThumbnail.test.ts +++ b/src/components/templates/thumbnails/BaseThumbnail.test.ts @@ -4,6 +4,10 @@ import { nextTick } from 'vue' import BaseThumbnail from '@/components/templates/thumbnails/BaseThumbnail.vue' +type ComponentInstance = InstanceType & { + error: boolean +} + vi.mock('@vueuse/core', () => ({ useEventListener: vi.fn() })) @@ -45,7 +49,7 @@ describe('BaseThumbnail', () => { it('shows error state when image fails to load', async () => { const wrapper = mountThumbnail() - const vm = wrapper.vm as any + const vm = wrapper.vm as ComponentInstance // Manually set error since useEventListener is mocked vm.error = true