feat(sources): retire Yahoo and CNBC feeds (#42)

This commit is contained in:
2026-11-25 02:00:25 +01:00
parent 7a342f240d
commit 0503c2653f
41 changed files with 603 additions and 173 deletions

View File

@ -22,14 +22,19 @@ test('admin source controls stay accessible and fit at 320, 375 and 390 px', asy
await expect(page.getByRole('heading', { name: 'Sources et plafonds' })).toBeVisible()
const activationControls = page.locator('button[aria-label^="Activer "], button[aria-label^="Désactiver "]')
await expect(activationControls).toHaveCount(4)
const activationNames = (await activationControls.evaluateAll(nodes => nodes.map(node => node.getAttribute('aria-label').replace(/^(Activer|Désactiver) /, '')).sort()))
expect(activationNames).toEqual(['Bloomberg', 'CNBC Business', 'Investing.com', 'Yahoo Finance'])
await expect(page.locator('form[aria-label^="Réglages de "]')).toHaveCount(4)
await expect(activationControls).toHaveCount(2)
const activationNames = await activationControls.evaluateAll(nodes => nodes.map(node => node.getAttribute('aria-label').replace(/^(Activer|Désactiver) /, '')).sort())
expect(activationNames).toEqual(['Bloomberg', 'Investing.com'])
await expect(page.locator('form[aria-label^="Réglages de "]')).toHaveCount(2)
const historical = page.getByRole('region', { name: 'Anciennes sources exclues' })
const historical = page.getByRole('region', { name: 'Sources retirées' })
await expect(historical).toBeVisible()
await historical.getByText(/^Consulter les anciennes sources/).click()
await historical.getByText(/^Consulter les sources retirées/).click()
for (const name of ['Yahoo Finance', 'CNBC Business']) {
await expect(historical.getByText(name, { exact: true })).toBeVisible()
await expect(page.getByRole('button', { name: `Activer ${name}`, exact: true })).toHaveCount(0)
await expect(page.getByRole('button', { name: `Désactiver ${name}`, exact: true })).toHaveCount(0)
}
const historicalRows = historical.locator('li')
expect(await historicalRows.count()).toBeGreaterThan(0)
await expect(historicalRows.locator('button, input, form, a')).toHaveCount(0)
@ -43,8 +48,8 @@ test('admin source controls stay accessible and fit at 320, 375 and 390 px', asy
expect(dimensions.document, `horizontal overflow at ${width}px: ${JSON.stringify(dimensions)}`).toBeLessThanOrEqual(dimensions.viewport)
await expect(page.getByRole('spinbutton', { name: 'Articles max par résumé' })).toBeVisible()
for (const name of ['Yahoo Finance', 'Bloomberg', 'CNBC Business', 'Investing.com']) {
const toggle = page.getByRole('button', { name: new RegExp(`^(?:Activer|Désactiver) ${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}$`) })
for (const name of ['Bloomberg', 'Investing.com']) {
const toggle = activationControls.filter({ hasText: /Activer|Désactiver/ }).and(page.getByRole('button', { name: new RegExp(name) }))
const cap = page.getByRole('spinbutton', { name: `Plafond ${name}` })
await expect(toggle).toBeVisible()
await expect(toggle).toBeEnabled()