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:
@@ -0,0 +1,21 @@
|
||||
// @vitest-environment happy-dom
|
||||
import { describe, it, expect } from 'vitest'
|
||||
|
||||
import DownloadEventRow from '../../src/components/downloads/DownloadEventRow.vue'
|
||||
import { freshPinia, mountComponent } from '../support/mountComponent.js'
|
||||
|
||||
describe('DownloadEventRow', () => {
|
||||
it('renders the artist and the mapped status label', () => {
|
||||
const pinia = freshPinia()
|
||||
const now = new Date().toISOString()
|
||||
const event = {
|
||||
id: 1, status: 'ok', started_at: now, finished_at: now,
|
||||
platform: 'patreon', artist_name: 'Alice',
|
||||
files_count: 3, bytes_downloaded: 1000, error: null, summary: {},
|
||||
}
|
||||
const w = mountComponent(DownloadEventRow, { props: { event }, pinia })
|
||||
const t = w.text()
|
||||
expect(t).toContain('Alice')
|
||||
expect(t).toContain('Completed') // downloadStatusLabel('ok')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user