feat(qa): add synthesis conversations with source retention (#52)
This commit is contained in:
@ -38,6 +38,20 @@ describe('Mes préférences', () => {
|
||||
updatePreferences.mockResolvedValue({ language: 'en', ranking_mode: 'title_content' })
|
||||
})
|
||||
|
||||
it('configure la rétention 1–30 jours avec défaut 7 et refuse les valeurs hors limites', async () => {
|
||||
render(<Preferences />)
|
||||
const retention = await screen.findByLabelText('Conservation des articles sources (jours)')
|
||||
expect(retention).toHaveValue(7)
|
||||
await userEvent.clear(retention)
|
||||
await userEvent.type(retention, '31')
|
||||
await userEvent.click(screen.getByRole('button', { name: 'Enregistrer' }))
|
||||
expect(retention).toHaveAttribute('aria-invalid', 'true')
|
||||
expect(updatePreferences).not.toHaveBeenCalled()
|
||||
await userEvent.clear(retention)
|
||||
await userEvent.type(retention, '30')
|
||||
await userEvent.click(screen.getByRole('button', { name: 'Enregistrer' }))
|
||||
expect(updatePreferences).toHaveBeenCalledWith(expect.objectContaining({ source_article_retention_days: 30 }))
|
||||
})
|
||||
it('réserve le catalogue compatible au classement et garde le catalogue complet pour la synthèse', async () => {
|
||||
listModels.mockResolvedValueOnce([{ id: 'summary-only', provider: 'Other', model: 'summary-only' }])
|
||||
render(<Preferences />)
|
||||
@ -105,6 +119,7 @@ describe('Mes préférences', () => {
|
||||
language: 'en',
|
||||
ranking_mode: 'title_content',
|
||||
summary_prompt_token_budget: 250000,
|
||||
source_article_retention_days: 7,
|
||||
}))
|
||||
})
|
||||
it('charge les valeurs françaises et affiche les libellés et l’aide', async () => {
|
||||
@ -129,7 +144,7 @@ describe('Mes préférences', () => {
|
||||
await user.selectOptions(screen.getByLabelText(/informations utilisées par Laya/i), 'title')
|
||||
await user.click(screen.getByRole('button', { name: 'Enregistrer' }))
|
||||
expect(await screen.findByRole('status')).toHaveTextContent('Préférences enregistrées.')
|
||||
expect(updatePreferences).toHaveBeenLastCalledWith({ language: 'fr', ranking_mode: 'title', summary_prompt_token_budget: 250000 })
|
||||
expect(updatePreferences).toHaveBeenLastCalledWith({ language: 'fr', ranking_mode: 'title', summary_prompt_token_budget: 250000, source_article_retention_days: 7 })
|
||||
view.unmount()
|
||||
render(<Preferences />)
|
||||
expect(await screen.findByLabelText(/langue/i)).toHaveValue('fr')
|
||||
|
||||
Reference in New Issue
Block a user