diff --git a/site/cypress/integration/mon-entreprise/lodeom.ts b/site/cypress/integration/mon-entreprise/lodeom.ts index ae0d384d5..a502b99f3 100755 --- a/site/cypress/integration/mon-entreprise/lodeom.ts +++ b/site/cypress/integration/mon-entreprise/lodeom.ts @@ -15,8 +15,20 @@ describe('Simulateur lodeom', { testIsolation: false }, function () { cy.contains('Rémunération brute') }) - it('should allow to change time period', function () { + it('should display a warning when no zone is selected', function () { + cy.contains( + 'Veuillez sélectionner une localisation et un barème pour accéder au simulateur.' + ) + }) + + it('should display a warning when no scale is selected', function () { cy.contains('Guadeloupe, Guyane, Martinique, La Réunion').click() + cy.contains( + 'Veuillez sélectionner une localisation et un barème pour accéder au simulateur.' + ) + }) + + it('should allow to change time period', function () { cy.contains('Barème de compétitivité').click() cy.contains('Exonération annuelle').click() cy.get(inputSelector).first().type('{selectall}42000') diff --git a/site/source/locales/ui-en.yaml b/site/source/locales/ui-en.yaml index 7fb443394..6797f2930 100644 --- a/site/source/locales/ui-en.yaml +++ b/site/source/locales/ui-en.yaml @@ -1465,6 +1465,7 @@ pages: warnings: JEI: The Lodeom exemption cannot be combined with the Young Innovative Company (JEI) exemption. + barème: Please select a location and a scale to access the simulator. salaire: zone-deux: barème-moins-de-11-salariés: The scale for employers with fewer than 11 diff --git a/site/source/locales/ui-fr.yaml b/site/source/locales/ui-fr.yaml index 442de38f9..236590b03 100644 --- a/site/source/locales/ui-fr.yaml +++ b/site/source/locales/ui-fr.yaml @@ -1558,6 +1558,8 @@ pages: warnings: JEI: L'exonération Lodeom n'est pas cumulable avec l'exonération Jeune Entreprise Innovante (JEI). + barème: Veuillez sélectionner une localisation et un barème pour accéder au + simulateur. salaire: zone-deux: barème-moins-de-11-salariés: Le barème pour les employeurs de moins de 11 diff --git a/site/source/pages/simulateurs/lodeom/Goals.tsx b/site/source/pages/simulateurs/lodeom/Goals.tsx index 8f0c9af1a..bc52fc97f 100644 --- a/site/source/pages/simulateurs/lodeom/Goals.tsx +++ b/site/source/pages/simulateurs/lodeom/Goals.tsx @@ -7,6 +7,9 @@ import RéductionMoisParMois from '@/components/RéductionDeCotisations/Réducti import { SimulationGoals } from '@/components/Simulation' import { useEngine } from '@/components/utils/EngineContext' import useYear from '@/components/utils/useYear' +import { Message } from '@/design-system' +import { Body } from '@/design-system/typography/paragraphs' +import { useBarèmeLodeom } from '@/hooks/useBarèmeLodeom' import { useZoneLodeom } from '@/hooks/useZoneLodeom' import { situationSelector } from '@/store/selectors/simulationSelectors' import { @@ -42,6 +45,7 @@ export default function LodeomSimulationGoals({ const situation = useSelector(situationSelector) as SituationType const previousSituation = useRef(situation) const currentZone = useZoneLodeom() + const currentBarème = useBarèmeLodeom() const { t } = useTranslation() const codeRéduction = engine.evaluate( @@ -110,43 +114,54 @@ export default function LodeomSimulationGoals({ return ( - {monthByMonth ? ( - } - warningCondition={`${lodeomDottedName} = 0`} - warningTooltip={} - codeRéduction={ - codeRéduction && - t(`code {{ code }}`, { - code: codeRéduction, - }) - } - codeRégularisation={ - codeRégularisation && - t(`code {{ code }}`, { - code: codeRégularisation, - }) - } - withRépartitionAndRégularisation={currentZone === 'zone un'} - /> - ) : ( - } - warningCondition={`${lodeomDottedName} = 0`} - warningMessage={} - withRépartition={currentZone === 'zone un'} - /> + {!currentBarème && ( + + + {t( + 'pages.simulateurs.lodeom.warnings.barème', + 'Veuillez sélectionner une localisation et un barème pour accéder au simulateur.' + )} + + )} + {currentBarème && + (monthByMonth ? ( + } + warningCondition={`${lodeomDottedName} = 0`} + warningTooltip={} + codeRéduction={ + codeRéduction && + t(`code {{ code }}`, { + code: codeRéduction, + }) + } + codeRégularisation={ + codeRégularisation && + t(`code {{ code }}`, { + code: codeRégularisation, + }) + } + withRépartitionAndRégularisation={currentZone === 'zone un'} + /> + ) : ( + } + warningCondition={`${lodeomDottedName} = 0`} + warningMessage={} + withRépartition={currentZone === 'zone un'} + /> + ))} ) }