// @vitest-environment happy-dom import { describe, it, expect } from 'vitest' import PostCard from '../../src/components/posts/PostCard.vue' import { freshPinia, mountComponent } from '../support/mountComponent.js' describe('PostCard', () => { it('renders the HTML-stripped title and the artist', () => { const pinia = freshPinia() const now = new Date().toISOString() const post = { id: 1, external_post_id: 'P1', post_title: 'Hello World', post_url: 'https://x/1', post_date: now, downloaded_at: now, description_plain: 'a description', artist: { id: 1, name: 'Sabu', slug: 'sabu' }, source: { id: 1, platform: 'subscribestar' }, thumbnails: [], thumbnails_more: 0, attachments: [], } const w = mountComponent(PostCard, { props: { post }, pinia }) const t = w.text() expect(t).toContain('Hello World') // plain title expect(t).not.toContain('') // tags stripped expect(t).toContain('Sabu') // artist (RouterLink slot) }) })