Files
blog/tests/support/fixtures.ts
T

54 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-09-11 11:41:52 +02:00
/** Shared seed data for integration and e2e tests against a real ephemeral PocketBase. */
export interface FixtureCategory {
name: string
slug: string
nameEn?: string
2026-09-11 11:41:52 +02:00
}
export interface FixtureArticle {
title: string
slug: string
content: string
category: string
/** `null` = draft (never returned by the public API). */
publishedAt: string | null
authorName?: string
titleEn?: string
contentEn?: string
2026-09-11 11:41:52 +02:00
}
export const FIXTURE_CATEGORIES: FixtureCategory[] = [
{ name: 'Economia', slug: 'economia', nameEn: 'Economy' },
2026-09-11 11:41:52 +02:00
{ name: 'Attualità', slug: 'attualita' },
]
export const FIXTURE_ARTICLES: FixtureArticle[] = [
{
title: 'Articolo pubblicato',
slug: 'articolo-pubblicato',
content: '# Titolo\n\nCorpo **markdown** di prova con [un link](https://example.com).',
category: 'economia',
publishedAt: '2025-01-15 10:00:00',
authorName: 'Redazione',
titleEn: 'Published article',
contentEn: '# Title\n\nTest **markdown** body with [a link](https://example.com).',
2026-09-11 11:41:52 +02:00
},
{
title: 'Articolo in bozza',
slug: 'articolo-bozza',
content: 'Contenuto non ancora pubblicato.',
category: 'economia',
publishedAt: null,
},
{
title: 'Secondo articolo pubblicato',
slug: 'secondo-articolo',
content: 'Un altro articolo pubblicato, in un\'altra categoria.',
category: 'attualita',
publishedAt: '2025-02-01 08:00:00',
authorName: 'Redazione',
// Deliberately no English translation: exercises the untranslated path.
2026-09-11 11:41:52 +02:00
},
]