-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: formulation lorsque le résultat légal et cc est identique
- Loading branch information
Showing
3 changed files
with
106 additions
and
7 deletions.
There are no files selected for viewing
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
53 changes: 53 additions & 0 deletions
53
...avail-frontend/src/outils/DureePreavisLicenciement/__tests__/wording-same-result.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,53 @@ | ||
import { DureePreavisLicenciement } from "../index"; | ||
import { ui } from "./ui"; | ||
import { fireEvent, render, screen } from "@testing-library/react"; | ||
|
||
jest.spyOn(Storage.prototype, "setItem"); | ||
Storage.prototype.getItem = jest.fn( | ||
() => ` | ||
{ | ||
"num": 3239, | ||
"shortTitle": "shortTitle", | ||
"id": "id", | ||
"title": "title", | ||
"url": "https://www.url.fr", | ||
"slug": "3239" | ||
} | ||
` | ||
); | ||
|
||
describe("DureePreavisLicenciement : wording on same result", () => { | ||
test("Should display a specific message when legal and agreement result are equals", () => { | ||
render(<DureePreavisLicenciement icon={""} title={""} displayTitle={""} />); | ||
fireEvent.click(ui.introduction.startButton.get()); | ||
|
||
fireEvent.click(screen.getByTestId("seriousMisconduct-non")); | ||
fireEvent.click(ui.next.get()); | ||
|
||
fireEvent.click(screen.getByTestId("disabledWorker-non")); | ||
fireEvent.click(ui.next.get()); | ||
|
||
fireEvent.change(screen.getByTestId("cdt.ancienneté"), { | ||
target: { value: "42| 2 ans ou plus" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
|
||
fireEvent.click(ui.next.get()); | ||
|
||
fireEvent.change(screen.getByTestId("criteria.catégorie professionnelle"), { | ||
target: { value: "100| Salariés du particulier employeur" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
|
||
fireEvent.change(screen.getByTestId("criteria.ancienneté"), { | ||
target: { value: "42| 2 ans ou plus" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
|
||
expect( | ||
screen.queryByText( | ||
/La durée prévue par le code du travail est le même que celle prévue par la convention collective/ | ||
) | ||
).toBeInTheDocument(); | ||
}); | ||
}); |
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