import { describe, it, expect } from 'vitest' import { articlesSeed, worksSeed } from '../server/utils/seed' describe('seed data integrity', () => { it('has 6 articles and 6 works', () => { expect(articlesSeed).toHaveLength(6) expect(worksSeed).toHaveLength(6) }) it('slugs are unique', () => { const articleSlugs = articlesSeed.map((a) => a.slug) expect(new Set(articleSlugs).size).toBe(articleSlugs.length) const workSlugs = worksSeed.map((w) => w.slug) expect(new Set(workSlugs).size).toBe(workSlugs.length) }) it('bilingual fields are complete for articles', () => { for (const a of articlesSeed) { expect(a.slug).toBeTruthy() expect(a.titleZh).toBeTruthy() expect(a.titleEn).toBeTruthy() expect(a.excerptZh).toBeTruthy() expect(a.excerptEn).toBeTruthy() expect(a.contentZh.length).toBeGreaterThan(0) expect(a.contentEn.length).toBeGreaterThan(0) expect(a.image).toBeTruthy() expect(a.published).toBe(1) } }) it('bilingual fields are complete for works', () => { for (const w of worksSeed) { expect(w.slug).toBeTruthy() expect(w.titleZh).toBeTruthy() expect(w.titleEn).toBeTruthy() expect(w.descriptionZh).toBeTruthy() expect(w.descriptionEn).toBeTruthy() expect(w.overviewZh).toBeTruthy() expect(w.overviewEn).toBeTruthy() expect(w.gallery.length).toBeGreaterThan(0) expect(w.tags.length).toBeGreaterThan(0) expect(w.published).toBe(1) } }) })