feat(sources): add managed RSS feeds (#41)
This commit is contained in:
@ -244,7 +244,27 @@ describe('plafonds d’articles administrateur', () => {
|
||||
await waitFor(() => expect(updateSource).toHaveBeenCalledWith('cnbc-new', true, 42))
|
||||
expect(updateSource).toHaveBeenCalledTimes(1)
|
||||
expect(await screen.findByRole('status')).toHaveTextContent('Plafond CNBC Business enregistré pour les prochaines synthèses.')
|
||||
expect(screen.getByText(/Seules Yahoo Finance, Bloomberg et CNBC Business/)).toBeInTheDocument()
|
||||
expect(screen.getByText(/Yahoo Finance, Bloomberg, CNBC Business et Investing.com/)).toBeInTheDocument()
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
describe('ticket #41 — sources additives', () => {
|
||||
afterEach(cleanup)
|
||||
it('affiche Investing.com depuis la clé canonique backend et conserve Yahoo Finance et CNBC Business', async () => {
|
||||
listSettings.mockResolvedValue([])
|
||||
listSources.mockResolvedValue([
|
||||
{ id: 'b', source_key: 'bloomberg', name: 'Bloomberg', type: 'rss', supported: true, operational: true, enabled: true, article_limit: 20 },
|
||||
{ id: 'i', source_key: 'investing_com', name: 'Legacy RSS label', type: 'rss', supported: true, operational: false, enabled: false, article_limit: 40 },
|
||||
{ id: 'y', source_key: 'yahoo_finance', name: 'legacy', type: 'stocktwits', supported: true, operational: true, enabled: true, article_limit: 20 },
|
||||
{ id: 'c', source_key: 'cnbc_business', name: 'legacy', type: 'rss', supported: true, operational: true, enabled: true, article_limit: 20 },
|
||||
])
|
||||
render(<Sources />)
|
||||
expect(await screen.findByRole('heading', { name: 'Investing.com' })).toBeInTheDocument()
|
||||
expect(screen.getByLabelText('Plafond Investing.com')).toHaveValue(40)
|
||||
expect(screen.getByRole('button', { name: 'Activer Investing.com' })).toBeEnabled()
|
||||
expect(screen.getByRole('button', { name: 'Désactiver Yahoo Finance' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'Désactiver CNBC Business' })).toBeInTheDocument()
|
||||
expect(screen.queryByRole('heading', { name: 'Legacy RSS label' })).not.toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user