From 3ef89d199d301127a08e128d0f75dff943371ef4 Mon Sep 17 00:00:00 2001 From: Alice Dahan Date: Thu, 26 Dec 2024 17:41:06 +0100 Subject: [PATCH] =?UTF-8?q?tests(lodeom):=20ajout=20de=20tests=20sur=20les?= =?UTF-8?q?=20bar=C3=A8mes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/mon-entreprise/lodeom.ts | 44 ++++++++++++------- .../mon-entreprise/reduction-generale.ts | 10 +---- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/site/cypress/integration/mon-entreprise/lodeom.ts b/site/cypress/integration/mon-entreprise/lodeom.ts index 38b5ea061..be896b8df 100755 --- a/site/cypress/integration/mon-entreprise/lodeom.ts +++ b/site/cypress/integration/mon-entreprise/lodeom.ts @@ -16,25 +16,24 @@ describe('Simulateur lodeom', { testIsolation: false }, function () { }) it('should allow to change time period', function () { - cy.get(inputSelector).first().type('{selectall}36000') + cy.contains('Barème de compétitivité').click() + cy.contains('Exonération annuelle').click() + cy.get(inputSelector).first().type('{selectall}42000') cy.contains('Exonération mensuelle').click() - // Wait for values to update - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(750) - cy.get(inputSelector).first().should('have.value', '3 000 €') + cy.get(inputSelector).first().should('have.value', '3 500 €') }) it('should display values for the lodeom', function () { cy.get( 'p[id="salarié___cotisations___exonérations___lodeom___montant-value"]' - ).should('include.text', '444,60 €') + ).should('include.text', '214,20 €') cy.get( 'p[id="salarié___cotisations___exonérations___lodeom___montant___imputation_retraite_complémentaire-value"]' - ).should('include.text', '83,66 €') + ).should('include.text', '40,31') cy.get( 'p[id="salarié___cotisations___exonérations___lodeom___montant___imputation_sécurité_sociale-value"]' - ).should('include.text', '360,94 €') + ).should('include.text', '173,89 €') }) it('should allow to select a company size', function () { @@ -49,7 +48,7 @@ describe('Simulateur lodeom', { testIsolation: false }, function () { cy.get( 'p[id="salarié___cotisations___exonérations___lodeom___montant-value"]' - ).should('include.text', '450,30 €') + ).should('include.text', '216,65 €') cy.contains('Moins de 50 salariés').click() cy.contains('Modifier mes réponses').click() @@ -61,7 +60,26 @@ describe('Simulateur lodeom', { testIsolation: false }, function () { cy.get('div[data-cy="modal"]').eq(0).contains('Fermer').click() }) + it('should allow to select a scale', function () { + cy.get('#salarié___cotisations___exonérations___lodeom___zone_un___barèmes') + .contains('Barème de compétitivité renforcée') + .click() + + cy.get( + 'p[id="salarié___cotisations___exonérations___lodeom___montant-value"]' + ).should('include.text', '1 117,90 €') + + cy.get('#salarié___cotisations___exonérations___lodeom___zone_un___barèmes') + .contains("Barème d'innovation et croissance") + .click() + + cy.get( + 'p[id="salarié___cotisations___exonérations___lodeom___montant-value"]' + ).should('include.text', '978,25 €') + }) + it('should display a warning for a remuneration too high', function () { + cy.contains('Barème de compétitivité').click() cy.get(inputSelector).first().type('{selectall}4000') cy.get('div[id="simulator-legend"]').should( @@ -86,9 +104,7 @@ describe('Simulateur lodeom', { testIsolation: false }, function () { cy.contains('Exonération mois par mois').click() cy.contains('Exonération Lodeom mois par mois :') - // Wait for values to update - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1) + cy.get(inputSelector) .should('have.length', 12) .each(($input) => { @@ -221,9 +237,7 @@ describe('Simulateur lodeom', { testIsolation: false }, function () { cy.wrap($input).type('{selectall}4000') } }) - // Wait for values to update - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(500) + cy.get('#recap-1er_trimestre-réduction').should('include.text', '442 €') cy.get('#recap-2ème_trimestre-régularisation').should( 'include.text', diff --git a/site/cypress/integration/mon-entreprise/reduction-generale.ts b/site/cypress/integration/mon-entreprise/reduction-generale.ts index 04897ddfd..19f751725 100755 --- a/site/cypress/integration/mon-entreprise/reduction-generale.ts +++ b/site/cypress/integration/mon-entreprise/reduction-generale.ts @@ -20,12 +20,10 @@ describe( }) it('should allow to change time period', function () { + cy.contains('Réduction annuelle').click() cy.get(inputSelector).first().type('{selectall}22800') cy.contains('Réduction mensuelle').click() - // Wait for values to update - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(750) cy.get(inputSelector).first().should('have.value', '1 900 €') }) @@ -110,9 +108,6 @@ describe( cy.contains('Réduction mois par mois').click() cy.contains('Réduction générale mois par mois :') - // Wait for values to update - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1) cy.get(inputSelector) .should('have.length', 12) .each(($input) => { @@ -248,9 +243,6 @@ describe( cy.wrap($input).type('{selectall}3000') } }) - // Wait for values to update - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1000) cy.get('#recap-1er_trimestre-réduction').should( 'include.text', '602,88 €'