test: ajoute des tests cypress sur la page Budget

pull/3155/head
Alice Dahan 2024-10-08 09:58:20 +02:00 committed by liliced
parent 59add12d32
commit 5892e03f61
2 changed files with 15 additions and 2 deletions

View File

@ -5,7 +5,7 @@ describe('Secondary pages', function () {
return
}
it("page stats doesn't crash", function () {
it('Statistics page should not crash', function () {
cy.visit('/stats')
cy.contains('Statistiques')
})
@ -17,7 +17,7 @@ describe('Secondary pages', function () {
checkA11Y()
})
it('navigate in the news section', function () {
it('News page should not crash', function () {
cy.visit('/nouveautés')
cy.contains('←').click()
cy.url({ decode: true }).should('match', /\/nouveautés\/[^/]*$/)
@ -31,4 +31,16 @@ describe('Secondary pages', function () {
cy.contains('←').click()
cy.url({ decode: true }).should('match', /\/nouveautés\/[^/]*$/)
})
it('Budget page should not crash', function () {
cy.visit('/budget')
cy.contains('Budget')
cy.get('button[data-cy="year-selector"]').click()
cy.contains('2021').click()
})
it('Budget page should be RGAA compliant', function () {
cy.visit('/budget')
checkA11Y()
})
})

View File

@ -108,6 +108,7 @@ export default function Budget() {
onSelectionChange={(year) => {
setSelectedYear(year as (typeof years)[number])
}}
data-cy="year-selector"
>
{years
.filter((year) => !!year)