test: shared typed fixtures to prevent mock drift from backend contracts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>master
parent
ae01bc8e62
commit
748606c287
@ -0,0 +1,66 @@
|
||||
import type {
|
||||
SynthesisListItem,
|
||||
Synthesis,
|
||||
NewsSection,
|
||||
Source,
|
||||
UserSettings,
|
||||
ProviderConfig,
|
||||
GenerateResponse,
|
||||
} from '~/types';
|
||||
import { DEFAULT_SETTINGS } from '~/types';
|
||||
|
||||
// ---- Syntheses (list view) ----
|
||||
export const MOCK_SYNTHESIS_LIST_ITEM: SynthesisListItem = {
|
||||
id: 'test-synth-1',
|
||||
week: '2026-W12',
|
||||
status: 'completed',
|
||||
created_at: '2026-03-21T10:00:00Z',
|
||||
first_section_title: 'Annonces majeures',
|
||||
first_section_item_count: 3,
|
||||
};
|
||||
|
||||
export const MOCK_SYNTHESIS_LIST: SynthesisListItem[] = [
|
||||
MOCK_SYNTHESIS_LIST_ITEM,
|
||||
{ ...MOCK_SYNTHESIS_LIST_ITEM, id: 'test-synth-2', week: '2026-W11', first_section_title: null, first_section_item_count: 0 },
|
||||
];
|
||||
|
||||
export const MOCK_SYNTHESIS_IN_PROGRESS: SynthesisListItem = {
|
||||
...MOCK_SYNTHESIS_LIST_ITEM, id: 'test-synth-progress', status: 'in_progress',
|
||||
};
|
||||
|
||||
// ---- Syntheses (detail view) ----
|
||||
export const MOCK_SECTIONS: NewsSection[] = [
|
||||
{ title: 'Annonces majeures', items: [
|
||||
{ title: 'GPT-5 Released', url: 'https://example.com/1', summary: 'Summary 1' },
|
||||
{ title: 'New Chip Launch', url: 'https://example.com/2', summary: 'Summary 2' },
|
||||
]},
|
||||
];
|
||||
|
||||
export const MOCK_SYNTHESIS_DETAIL: Synthesis = {
|
||||
id: 'test-synth-1', user_id: 'test-user-1', week: '2026-W12',
|
||||
sections: MOCK_SECTIONS, status: 'completed', created_at: '2026-03-21T10:00:00Z',
|
||||
};
|
||||
|
||||
// ---- Sources ----
|
||||
export const MOCK_SOURCE: Source = {
|
||||
id: 'src-1', user_id: 'u1', title: 'Test Blog', url: 'https://test.example.com/blog', created_at: '2026-03-21T10:00:00Z',
|
||||
};
|
||||
export const MOCK_SOURCES: Source[] = [
|
||||
MOCK_SOURCE,
|
||||
{ ...MOCK_SOURCE, id: 'src-2', title: 'News Site', url: 'https://news.example.com' },
|
||||
];
|
||||
|
||||
// ---- Settings ----
|
||||
export const MOCK_SETTINGS: UserSettings = {
|
||||
...DEFAULT_SETTINGS, theme: 'Intelligence Artificielle', ai_provider: 'gemini', ai_model: 'gemini-2.5-pro', ai_model_writing: 'gemini-2.5-flash',
|
||||
};
|
||||
|
||||
// ---- Providers ----
|
||||
export const MOCK_PROVIDER_CONFIG: ProviderConfig = {
|
||||
provider_name: 'gemini', display_name: 'Google Gemini',
|
||||
models: [{ model_id: 'gemini-2.5-pro', display_name: 'Gemini 2.5 Pro' }, { model_id: 'gemini-2.5-flash', display_name: 'Gemini 2.5 Flash' }],
|
||||
};
|
||||
export const MOCK_PROVIDER_CONFIGS: ProviderConfig[] = [MOCK_PROVIDER_CONFIG];
|
||||
|
||||
// ---- Generate ----
|
||||
export const MOCK_GENERATE_RESPONSE: GenerateResponse = { job_id: 'job-test-1' };
|
||||
Loading…
Reference in New Issue