-
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(seo): retrait des h1 dupliqués (#6342)
- Loading branch information
Showing
19 changed files
with
693 additions
and
424 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/code-du-travail-frontend/app/besoin-plus-informations/page.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,20 @@ | ||
import { DsfrLayout } from "../../src/modules/layout"; | ||
import { generateDefaultMetadata } from "../../src/modules/common/metas"; | ||
import { BesoinPlusInformations } from "../../src/modules/besoin-plus-informations"; | ||
|
||
export const metadata = generateDefaultMetadata({ | ||
title: "Besoin de plus d'informations", | ||
description: | ||
"Les services du ministère du Travail en région informent, conseillent et orientent les salariés et les employeurs du secteur privé sur leurs questions en droit du travail.", | ||
path: "/besoin-plus-informations", | ||
}); | ||
|
||
function Index() { | ||
return ( | ||
<DsfrLayout> | ||
<BesoinPlusInformations /> | ||
</DsfrLayout> | ||
); | ||
} | ||
|
||
export default Index; |
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
18 changes: 18 additions & 0 deletions
18
...ntend/cypress/integration/light/besoin-plus-informations/besoin-plus-informations.spec.ts
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,18 @@ | ||
describe("Page Besoin de plus d'information", () => { | ||
it("Permet de rechercher le lien vers un service de renseignement", () => { | ||
cy.visit("/besoin-plus-informations"); | ||
cy.findByRole("heading", { level: 1 }) | ||
.should("have.text", "Besoin de plus d'informations") | ||
.click(); | ||
|
||
cy.contains("label", "Saisissez le numéro de votre département").as( | ||
"input-departement" | ||
); | ||
cy.get("@input-departement").type("75"); | ||
cy.get("@input-departement").type("{enter}"); | ||
|
||
cy.get( | ||
'a[href="https://idf.drieets.gouv.fr/Adresse-et-horaires-d-ouverture-de-l-unite-departementale-75"]' | ||
).should("have.attr", "target", "_blank"); | ||
}); | ||
}); |
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
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
49 changes: 49 additions & 0 deletions
49
...l-frontend/src/modules/besoin-plus-informations/__tests__/BesoinPlusInformations.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,49 @@ | ||
import { render } from "@testing-library/react"; | ||
import React from "react"; | ||
import { BesoinPlusInformations } from ".."; | ||
import { UserAction } from "../../../common"; | ||
import { getServiceInfo } from "../data/servicesDeRenseignement"; | ||
|
||
jest.mock("../data/servicesDeRenseignement"); | ||
|
||
describe("<BesoinPlusInformations />", () => { | ||
beforeAll(() => { | ||
(getServiceInfo as jest.Mock).mockImplementation((data: string) => { | ||
if (data === "75") { | ||
return { | ||
name: "PARIS", | ||
url: "https://idf.drieets.gouv.fr/Adresse-et-horaires-d-ouverture-de-l-unite-departementale-75", | ||
}; | ||
} | ||
return undefined; | ||
}); | ||
}); | ||
|
||
it("doit trouver la DREETs à partir de son code postal", () => { | ||
const { getByTestId, getByLabelText } = render(<BesoinPlusInformations />); | ||
const userAction = new UserAction(); | ||
userAction.setInput( | ||
getByLabelText("Saisissez le numéro de votre département"), | ||
"75" | ||
); | ||
userAction.click(getByTestId("button-search-service")); | ||
|
||
expect(getByTestId("result-search-service").textContent).toBe( | ||
"https://idf.drieets.gouv.fr/Adresse-et-horaires-d-ouverture-de-l-unite-departementale-75" | ||
); | ||
}); | ||
|
||
it("doit trouver indiquer si le code postal n'existe pas", () => { | ||
const { getByTestId, getByLabelText } = render(<BesoinPlusInformations />); | ||
const userAction = new UserAction(); | ||
userAction.setInput( | ||
getByLabelText("Saisissez le numéro de votre département"), | ||
"999" | ||
); | ||
userAction.click(getByTestId("button-search-service")); | ||
|
||
expect(getByTestId("result-search-service-failed").textContent).toBe( | ||
"Aucun service de renseignement n'a été trouvé pour ce département." | ||
); | ||
}); | ||
}); |
Oops, something went wrong.