test(I2): vitest component smoke tests for high-risk UI

Adds @vue/test-utils + happy-dom and mounts CredentialCard, DownloadEventRow,
PostCard, ActiveDownloadsPanel, QueueStatusBar, asserting they render without
throwing and surface key content — catching the dead-binding / render-error
class (e.g. the last_verified_at regression, guarded explicitly). Vuetify
components are left unresolved (Vue renders unknown elements + slots), so no
Vuetify-plugin setup is needed; only RouterLink is stubbed. Per-file
happy-dom env via docblock keeps the existing node-env specs untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-29 12:34:58 -04:00
parent e76aa36a29
commit 44410db492
7 changed files with 158 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
import { mount } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
// Smoke-test helper. Vuetify components are left unresolved (Vue 3 renders
// unknown elements with their slot children, so text content is still
// present and nothing throws), which avoids standing up the whole Vuetify
// plugin in happy-dom. RouterLink is the one import that needs a router, so
// it's stubbed with a slot-rendering anchor.
export function freshPinia () {
const pinia = createPinia()
setActivePinia(pinia)
return pinia
}
export function mountComponent (Component, { props = {}, pinia } = {}) {
return mount(Component, {
props,
global: {
plugins: pinia ? [pinia] : [],
stubs: { RouterLink: { template: '<a><slot /></a>' } },
},
})
}