-
Notifications
You must be signed in to change notification settings - Fork 26
fix(seo): retrait des h1 dupliqués #6342
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
On repasse en mode light le temps de pouvoir modifier le h1 de la modale pour le SEO