1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-09 00:35:00 +00:00

tests(AE): correction du test AE

This commit is contained in:
Alice Dahan 2025-02-04 14:18:35 +01:00 committed by Jalil Arfaoui
parent 36daa71ef9
commit 603a13a7a0
5 changed files with 35 additions and 18 deletions

View file

@ -64,11 +64,11 @@ describe('Simulateur lodeom', { testIsolation: false }, function () {
cy.contains('Plus de 50 salariés').click()
cy.contains('Modifier mes réponses').click()
cy.get('div[data-cy="modal"]')
.eq(0)
.first()
.contains('Effectif')
.next()
.contains('100')
cy.get('div[data-cy="modal"]').eq(0).contains('Fermer').click()
cy.get('div[data-cy="modal"]').first().contains('Fermer').click()
cy.get(
'p[id="salarié___cotisations___exonérations___lodeom___montant-value"]'
@ -77,11 +77,11 @@ describe('Simulateur lodeom', { testIsolation: false }, function () {
cy.contains('Moins de 50 salariés').click()
cy.contains('Modifier mes réponses').click()
cy.get('div[data-cy="modal"]')
.eq(0)
.first()
.contains('Effectif')
.next()
.contains('10')
cy.get('div[data-cy="modal"]').eq(0).contains('Fermer').click()
cy.get('div[data-cy="modal"]').first().contains('Fermer').click()
})
it('should allow to select a scale', function () {

View file

@ -46,11 +46,11 @@ describe(
cy.contains('Plus de 50 salariés').click()
cy.contains('Modifier mes réponses').click()
cy.get('div[data-cy="modal"]')
.eq(0)
.first()
.contains('Effectif')
.next()
.contains('100')
cy.get('div[data-cy="modal"]').eq(0).contains('Fermer').click()
cy.get('div[data-cy="modal"]').first().contains('Fermer').click()
cy.get(
'p[id="salarié___cotisations___exonérations___réduction_générale-value"]'
@ -59,11 +59,11 @@ describe(
cy.contains('Moins de 50 salariés').click()
cy.contains('Modifier mes réponses').click()
cy.get('div[data-cy="modal"]')
.eq(0)
.first()
.contains('Effectif')
.next()
.contains('10')
cy.get('div[data-cy="modal"]').eq(0).contains('Fermer').click()
cy.get('div[data-cy="modal"]').first().contains('Fermer').click()
})
it('should allow to select an option for caisse de congés payés', function () {

View file

@ -1,21 +1,27 @@
import { checkA11Y, fr } from '../../support/utils'
describe('Simulateur auto-entrepreneur', { testIsolation: false }, function () {
describe('Simulateur auto-entrepreneur', function () {
if (!fr) {
return
}
const inputSelector = 'div[id="simulator-legend"] input[inputmode="numeric"]'
before(function () {
beforeEach(function () {
return cy.visit('/simulateurs/auto-entrepreneur')
})
it('should allow to enter the date of creation', function () {
cy.get(inputSelector).first().type('{selectall}50000')
cy.contains('button', 'Passer').click()
cy.contains('button', 'Passer').click()
cy.contains('Modifier mes réponses').click()
cy.get('div[data-cy="modal"]')
.first()
.contains('Date de création')
.next()
.click()
cy.contains("Début d'année").click()
cy.get('div[data-cy="modal"]').contains('Fermer').click()
cy.contains('ACRE')
})
@ -44,6 +50,8 @@ describe('Simulateur auto-entrepreneur', { testIsolation: false }, function () {
})
it('should display the correct CA when changing the second "Activité mixte"', function () {
cy.get(inputSelector).first().type('{selectall}5000')
cy.contains('Activité mixte').click()
cy.get(inputSelector).eq(2).type('{selectall}5000')
cy.get(inputSelector).first().should('have.value', '10000 €')
@ -55,6 +63,12 @@ describe('Simulateur auto-entrepreneur', { testIsolation: false }, function () {
.map((elem) => parseInt(elem.value.replace(/[\s,.€]/g, '')))
it('should display the correct results of "Activité mixte" when changing CA', function () {
cy.contains('Activité mixte').click()
cy.get(inputSelector).eq(1).type('{selectall}2500')
cy.get(inputSelector).eq(2).type('{selectall}5000')
cy.get(inputSelector).eq(3).type('{selectall}2500')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(500)
cy.get(inputSelector).first().type('{selectall}5000')
cy.get<HTMLInputElement>(inputSelector).should(($elem) => {
@ -65,6 +79,9 @@ describe('Simulateur auto-entrepreneur', { testIsolation: false }, function () {
})
it('should display the correct results of "Activité mixte" when changing "Revenu net Après impôt"', function () {
cy.get(inputSelector).first().type('{selectall}2500')
cy.contains('Activité mixte').click()
cy.get(inputSelector).eq(2).type('{selectall}2500')
cy.get(inputSelector).last().type('{selectall}2500')
cy.get<HTMLInputElement>(inputSelector).should(($elem) => {

View file

@ -11,16 +11,16 @@ describe.skip('Simulateur salarié : part time contract', function () {
cy.get('button').contains('SMIC').click()
cy.contains('Modifier mes réponses').click()
cy.get('div[data-cy="modal"]')
.eq(0)
.first()
.contains('Temps partiel')
.next()
.find('button')
.click()
cy.get('div[data-cy="modal"]').eq(1).contains('Fermer')
cy.get('div[data-cy="modal"]').eq(1).contains('Oui').click()
cy.get('div[data-cy="modal"]').eq(1).contains('Continuer').click()
cy.get('div[data-cy="modal"]').eq(0).contains('Fermer').click()
cy.get('div[data-cy="modal"]').last().contains('Fermer')
cy.get('div[data-cy="modal"]').last().contains('Oui').click()
cy.get('div[data-cy="modal"]').last().contains('Continuer').click()
cy.get('div[data-cy="modal"]').first().contains('Fermer').click()
})
it('should permit selecting the smic before part-time contrat', function () {

View file

@ -318,7 +318,7 @@ function AnswerElement(rule: RuleNode) {
dottedName={questionDottedName}
onChange={handleChange}
autoFocus
showSuggestions={false}
// showSuggestions={false}
onSubmit={onClose}
/>
</form>