Skip to content

Commit

Permalink
test: ajoute des tests cypress sur la page Budget
Browse files Browse the repository at this point in the history
  • Loading branch information
liliced committed Oct 8, 2024
1 parent d8ba9b0 commit ced680d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions site/cypress/integration/mon-entreprise/secondary-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand All @@ -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\/[^/]*$/)
Expand All @@ -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()
})
})
1 change: 1 addition & 0 deletions site/source/pages/budget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export default function Budget() {
onSelectionChange={(year) => {
setSelectedYear(year as (typeof years)[number])
}}
data-cy="year-selector"
>
{years
.filter((year) => !!year)
Expand Down

0 comments on commit ced680d

Please sign in to comment.