Skip to content

Commit

Permalink
tests: ajout de tests sur les options RGCP
Browse files Browse the repository at this point in the history
  • Loading branch information
liliced committed Dec 3, 2024
1 parent c5c0ad8 commit 4907585
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
41 changes: 25 additions & 16 deletions site/cypress/integration/mon-entreprise/reduction-generale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ describe(
})
})

it('should include annual regularisation', function () {
cy.contains('Régularisation annuelle').click()
cy.contains('Moins de 50 salariés').click()
it('should include progressive regularisation', function () {
cy.contains('Réduction mensuelle').click()
cy.get(inputSelector).first().type('{selectall}1900')
cy.contains('Réduction mois par mois').click()
Expand All @@ -158,35 +156,46 @@ describe(
).should('include.text', '0 €')
cy.get(
'#salarié___cotisations___exonérations___réduction_générale__régularisation-février'
).should('include.text', '0 €')
).should('include.text', '-92,12 €')
cy.get(
'#salarié___cotisations___exonérations___réduction_générale-mars'
).should('include.text', '493,43 €')
).should('include.text', '493,57 €')
cy.get(
'#salarié___cotisations___exonérations___réduction_générale-décembre'
).should('include.text', '432,49 €')
).should('include.text', '523,62 €')
})

it('should include progressive regularisation', function () {
cy.contains('Régularisation progressive').click()
cy.contains('Moins de 50 salariés').click()
cy.contains('Réduction mensuelle').click()
cy.get(inputSelector).first().type('{selectall}1900')
cy.contains('Réduction mois par mois').click()
cy.get(inputSelector).eq(1).type('{selectall}3000')
it('should include annual regularisation', function () {
cy.contains('Régularisation annuelle').click()

cy.get(
'#salarié___cotisations___exonérations___réduction_générale-février'
).should('include.text', '0 €')
cy.get(
'#salarié___cotisations___exonérations___réduction_générale__régularisation-février'
).should('include.text', '-92,12 €')
).should('include.text', '0 €')
cy.get(
'#salarié___cotisations___exonérations___réduction_générale-mars'
).should('include.text', '493,57 €')
).should('include.text', '493,43 €')
cy.get(
'#salarié___cotisations___exonérations___réduction_générale-décembre'
).should('include.text', '523,62 €')
).should('include.text', '432,49 €')
})

it('should include monthly options', function () {
cy.get(inputSelector).first().type('{selectall}2100')
cy.get(
'div[id="simulator-legend"] button[aria-describedby="options-description"]'
)
.should('have.length', 12)
.first()
.click()
cy.get('div[id="options-janvier"]').should('be.visible')
cy.get('div[id="options-janvier"] input').type('{selectall}28,15')

cy.get(
'#salarié___cotisations___exonérations___réduction_générale-janvier'
).should('include.text', '666,33 €')
})

it('should be RGAA compliant', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export default function MonthOptions({
}

return (
<Appear id={`options-${month}`}>
<InputContainer>
<Appear>
<InputContainer id={`options-${month}`}>
<FlexDiv>
<StyledSmallBody id={`heures-${additionalHours}-label`}>
{additionalHoursLabels[additionalHours]}
Expand Down

0 comments on commit 4907585

Please sign in to comment.