-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 5985 dsfr migration des anciens simulateurs #6091
Open
Viczei
wants to merge
29
commits into
dev
Choose a base branch
from
5985-analyse-dsfr--migration-des-anciens-simulateurs
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
961f3cd
feat: migration des anciens simulateurs POC
1ce9937
chore: snap
8b018d5
feat: update algo
12a4d34
feat: implement publicode generation
4bcdc54
chore: publicode generation preavis licenciement
a699e61
feat: implement preavis licenciement simu publicode + TU modele
4134117
feat: implementation heure recherche emploi
458c408
refactor: move replace to publicode gen
3a5f83c
feat: ajout preavis demission
315d279
fix: notifications qui remonte pas preavis licenciement
bc17d74
feat: implement indemnite precarite
6aab13e
feat: implement formula indemnite preca
96678c9
feat: implement ineligibility
081bc36
fix: ts
fdf1296
chore: clean
3aa9588
feat: implement disabled worker preavis licenciement
d9539e8
fix: script
14d0a3a
chore: simplify script
ae95b9d
chore: review preavis licenciement & retraite
e63a109
fix: heure recherche emploi
e741dcb
chore: clean
2f86963
chore: update TU scheme
fc8ca64
chore: remove \n
6806f38
feat: update inde preca
d134aeb
feat: preavis licenciement format texte
2c36d8c
Merge branch 'dev' into 5985-analyse-dsfr--migration-des-anciens-simu…
2adedad
chore: format
9fa5cb6
feat: preavis demission result string
7b8e25a
fix: date calendaire
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
...e-du-travail-frontend/src/outils/DureePreavisDemission/__tests__/agreements/1043.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,80 @@ | ||
import { DureePreavisDemission } 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": 1043, | ||
"shortTitle": "shortTitle", | ||
"id": "id", | ||
"title": "title", | ||
"url": "https://www.url.fr", | ||
"slug": "1043" | ||
} | ||
` | ||
); | ||
|
||
describe("DureePreavisDemission", () => { | ||
beforeEach(() => { | ||
render(<DureePreavisDemission icon={""} title={""} displayTitle={""} />); | ||
fireEvent.click(ui.introduction.startButton.get()); | ||
|
||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
describe("criteria.logement = 1| Non-logé", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.logement"), { | ||
target: { value: "1| Non-logé" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
describe("criteria.coefficient = 21| Inférieur ou égal à 602", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.coefficient"), { | ||
target: { value: "21| Inférieur ou égal à 602" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/8 jours/g)[0]).toBeInTheDocument(); | ||
|
||
expect(screen.queryAllByText(/Article 14/)[0]).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe("criteria.coefficient = 22| Supérieur à 602", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.coefficient"), { | ||
target: { value: "22| Supérieur à 602" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/1 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect(screen.queryAllByText(/Article 14/)[0]).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("criteria.logement = 3| logés", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.logement"), { | ||
target: { value: "3| logés" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/1 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect(screen.queryAllByText(/Article 14/)[0]).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); |
138 changes: 138 additions & 0 deletions
138
...e-du-travail-frontend/src/outils/DureePreavisDemission/__tests__/agreements/1090.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,138 @@ | ||
import { DureePreavisDemission } 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": 1090, | ||
"shortTitle": "shortTitle", | ||
"id": "id", | ||
"title": "title", | ||
"url": "https://www.url.fr", | ||
"slug": "1090" | ||
} | ||
` | ||
); | ||
|
||
describe("DureePreavisDemission", () => { | ||
beforeEach(() => { | ||
render(<DureePreavisDemission icon={""} title={""} displayTitle={""} />); | ||
fireEvent.click(ui.introduction.startButton.get()); | ||
|
||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
describe("criteria.catégorie professionnelle = 23| Agents de maîtrise", () => { | ||
beforeEach(() => { | ||
fireEvent.change( | ||
screen.getByTestId("criteria.catégorie professionnelle"), | ||
{ | ||
target: { value: "23| Agents de maîtrise" }, | ||
} | ||
); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
describe("criteria.échelon = 4| De 17 à 19", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.échelon"), { | ||
target: { value: "4| De 17 à 19" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/2 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 4.10 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe("criteria.échelon = 5| De 20 à 25", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.échelon"), { | ||
target: { value: "5| De 20 à 25" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/3 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 4.10 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("criteria.catégorie professionnelle = 48| Cadres", () => { | ||
beforeEach(() => { | ||
fireEvent.change( | ||
screen.getByTestId("criteria.catégorie professionnelle"), | ||
{ | ||
target: { value: "48| Cadres" }, | ||
} | ||
); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/3 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 4.10 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe("criteria.catégorie professionnelle = 6| Ouvriers, Employés", () => { | ||
beforeEach(() => { | ||
fireEvent.change( | ||
screen.getByTestId("criteria.catégorie professionnelle"), | ||
{ | ||
target: { value: "6| Ouvriers, Employés" }, | ||
} | ||
); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
describe("criteria.échelon = 2| 1 et 2", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.échelon"), { | ||
target: { value: "2| 1 et 2" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/2 semaines/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 2.12 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe("criteria.échelon = 3| De 3 à 12", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.échelon"), { | ||
target: { value: "3| De 3 à 12" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/1 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 2.12 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); | ||
}); |
92 changes: 92 additions & 0 deletions
92
...e-du-travail-frontend/src/outils/DureePreavisDemission/__tests__/agreements/1147.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,92 @@ | ||
import { DureePreavisDemission } 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": 1147, | ||
"shortTitle": "shortTitle", | ||
"id": "id", | ||
"title": "title", | ||
"url": "https://www.url.fr", | ||
"slug": "1147" | ||
} | ||
` | ||
); | ||
|
||
describe("DureePreavisDemission", () => { | ||
beforeEach(() => { | ||
render(<DureePreavisDemission icon={""} title={""} displayTitle={""} />); | ||
fireEvent.click(ui.introduction.startButton.get()); | ||
|
||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
describe("criteria.catégorie professionnelle = 48| Cadres", () => { | ||
beforeEach(() => { | ||
fireEvent.change( | ||
screen.getByTestId("criteria.catégorie professionnelle"), | ||
{ | ||
target: { value: "48| Cadres" }, | ||
} | ||
); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/3 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 25 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe("criteria.catégorie professionnelle = 38| Non-cadres", () => { | ||
beforeEach(() => { | ||
fireEvent.change( | ||
screen.getByTestId("criteria.catégorie professionnelle"), | ||
{ | ||
target: { value: "38| Non-cadres" }, | ||
} | ||
); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
describe("criteria.ancienneté = 15| Moins de 6 mois", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.ancienneté"), { | ||
target: { value: "15| Moins de 6 mois" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/15 jours/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 25 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe("criteria.ancienneté = 23| 6 mois et plus", () => { | ||
beforeEach(() => { | ||
fireEvent.change(screen.getByTestId("criteria.ancienneté"), { | ||
target: { value: "23| 6 mois et plus" }, | ||
}); | ||
fireEvent.click(ui.next.get()); | ||
}); | ||
|
||
it("should display expected answer", () => { | ||
expect(screen.queryAllByText(/1 mois/g)[0]).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.queryAllByText(/Article 25 de la convention collective/)[0] | ||
).toBeInTheDocument(); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
il faudra qu'on format les fichier avant de les committer