Skip to content
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
wants to merge 29 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Aug 13, 2024
1ce9937
chore: snap
Aug 13, 2024
8b018d5
feat: update algo
Aug 21, 2024
12a4d34
feat: implement publicode generation
Aug 22, 2024
4bcdc54
chore: publicode generation preavis licenciement
Aug 23, 2024
a699e61
feat: implement preavis licenciement simu publicode + TU modele
Aug 29, 2024
4134117
feat: implementation heure recherche emploi
Sep 6, 2024
458c408
refactor: move replace to publicode gen
Sep 6, 2024
3a5f83c
feat: ajout preavis demission
Sep 10, 2024
315d279
fix: notifications qui remonte pas preavis licenciement
Sep 10, 2024
bc17d74
feat: implement indemnite precarite
Sep 12, 2024
6aab13e
feat: implement formula indemnite preca
Sep 12, 2024
96678c9
feat: implement ineligibility
Sep 13, 2024
081bc36
fix: ts
Sep 16, 2024
fdf1296
chore: clean
Sep 16, 2024
3aa9588
feat: implement disabled worker preavis licenciement
Sep 16, 2024
d9539e8
fix: script
Sep 17, 2024
14d0a3a
chore: simplify script
Oct 7, 2024
ae95b9d
chore: review preavis licenciement & retraite
Oct 7, 2024
e63a109
fix: heure recherche emploi
Oct 7, 2024
e741dcb
chore: clean
Oct 7, 2024
2f86963
chore: update TU scheme
Oct 9, 2024
fc8ca64
chore: remove \n
Oct 9, 2024
6806f38
feat: update inde preca
Oct 9, 2024
d134aeb
feat: preavis licenciement format texte
Oct 15, 2024
2c36d8c
Merge branch 'dev' into 5985-analyse-dsfr--migration-des-anciens-simu…
Oct 15, 2024
2adedad
chore: format
Oct 15, 2024
9fa5cb6
feat: preavis demission result string
Oct 15, 2024
7b8e25a
fix: date calendaire
Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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";

Copy link
Contributor

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

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();
});
});
});
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();
});
});
});
});
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();
});
});
});
});
Loading
Loading