-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ajout du TU UI indemnit de licenciement bug 675 (#5768)
* fix: utilisation extraInfos pour les salaires * chore: clean * chore: add TU UI --------- Co-authored-by: Victor <victor.zeinstra@gmail.com>
- Loading branch information
Showing
2 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
packages/code-du-travail-frontend/src/outils/IndemniteLicenciement/__tests__/cc675.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { fireEvent, render } from "@testing-library/react"; | ||
import React from "react"; | ||
import { CalculateurIndemnite } from "../.."; | ||
import { ui } from "./ui"; | ||
import userEvent from "@testing-library/user-event"; | ||
|
||
jest.spyOn(Storage.prototype, "setItem"); | ||
Storage.prototype.getItem = jest.fn( | ||
() => ` | ||
{ | ||
"url": "https://www.legifrance.gouv.fr/affichIDCC.do?idConvention=KALICONT000005635617", | ||
"id": "0675", | ||
"num": 675, | ||
"shortTitle": "Maisons à succursales de vente au détail d'habillement", | ||
"slug": "675-maisons-a-succursales-de-vente-au-detail-dhabillement", | ||
"title": "Convention collective nationale des maisons à succursales de vente au détail d'habillement du 30 juin 1972. Etendue par arrêté du 8 décembre 1972 (JO du 7 janvier 1973).", | ||
"contributions": true | ||
} | ||
` | ||
); | ||
|
||
describe("Indemnité licenciement - CC 675", () => { | ||
test("cas spécifique", () => { | ||
render(<CalculateurIndemnite icon={""} title={""} displayTitle={""} />); | ||
userEvent.click(ui.introduction.startButton.get()); | ||
userEvent.click(ui.contract.type.cdi.get()); | ||
userEvent.click(ui.contract.fauteGrave.non.get()); | ||
userEvent.click(ui.contract.inaptitude.non.get()); | ||
userEvent.click(ui.contract.arretTravail.non.get()); | ||
userEvent.click(ui.next.get()); | ||
userEvent.click(ui.next.get()); | ||
userEvent.click(ui.next.get()); | ||
userEvent.click(ui.next.get()); | ||
fireEvent.change(ui.information.agreement675.proCategory.get(), { | ||
target: { value: "'Employés'" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
fireEvent.change(ui.seniority.startDate.get(), { | ||
target: { value: "01/01/2021" }, | ||
}); | ||
fireEvent.change(ui.seniority.notificationDate.get(), { | ||
target: { value: "01/01/2024" }, | ||
}); | ||
fireEvent.change(ui.seniority.endDate.get(), { | ||
target: { value: "01/01/2024" }, | ||
}); | ||
fireEvent.click(ui.seniority.hasAbsence.non.get()); | ||
fireEvent.click(ui.next.get()); | ||
fireEvent.click(ui.salary.hasPartialTime.non.get()); | ||
fireEvent.click(ui.salary.hasSameSalary.oui.get()); | ||
fireEvent.change(ui.salary.sameSalaryValue.get(), { | ||
target: { value: "1488" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
|
||
expect(ui.activeStep.query()).toHaveTextContent("Indemnité"); | ||
expect(ui.result.resultatAgreement.get()).toHaveTextContent("446.4"); | ||
expect(ui.result.resultat.get()).toHaveTextContent("1116"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters