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)
This commit is contained in:
Johnpaul
2026-01-21 02:50:24 +01:00
parent ca4fe3fd69
commit f570b397a5

View File

@@ -4,6 +4,10 @@ import { nextTick } from 'vue'
import BaseThumbnail from '@/components/templates/thumbnails/BaseThumbnail.vue'
type ComponentInstance = InstanceType<typeof BaseThumbnail> & {
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