refactor(ui): retire article feed and legacy jobs surfaces

Remove obsolete article and scrape-job screens and APIs, preserve reports, and clear legacy API caches from the service worker.

Refs #8

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 21:20:51 +01:00
parent 768c0fd7f5
commit 0ebc531124
21 changed files with 315 additions and 357 deletions

View File

@ -0,0 +1,35 @@
import { cleanup, render, screen } from '@testing-library/react'
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
import { Reports } from '../src/pages/Reports'
const { listReports, listMessages } = vi.hoisted(() => ({ listReports: vi.fn(), listMessages: vi.fn() }))
vi.mock('@/api/reports', () => ({
reportsApi: { list: listReports, listMessages, delete: vi.fn(), createMessage: vi.fn() },
}))
beforeEach(() => {
listReports.mockResolvedValue([{
id: 'historical-report-1',
user_id: 'user-1',
summary_id: 'historical-summary-1',
context_excerpt: 'Extrait issu de la synthèse historique.',
question: 'Que signifiait ce mouvement ?',
answer: 'La réponse historique reste disponible.',
status: 'done',
error_msg: '',
created_at: '2026-11-19T10:00:00.000Z',
}])
listMessages.mockResolvedValue([])
})
afterEach(cleanup)
it('conserve et affiche les rapports historiques avec leur synthèse et leur réponse', async () => {
render(<Reports />)
expect(await screen.findByText('Que signifiait ce mouvement ?')).toBeInTheDocument()
expect(screen.getByText(/Extrait issu de la synthèse historique/)).toBeInTheDocument()
expect(screen.getByText('La réponse historique reste disponible.')).toBeInTheDocument()
expect(listReports).toHaveBeenCalledOnce()
})