9ab5d709c8
The row template renders status + platform (PlatformChip) + time + counts; the artist isn't displayed there. Assert on 'Completed'/'Patreon' instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
861 B
JavaScript
22 lines
861 B
JavaScript
// @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 mapped status label and platform', () => {
|
|
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('Completed') // downloadStatusLabel('ok')
|
|
expect(t).toContain('Patreon') // platformLabel via PlatformChip
|
|
})
|
|
})
|