-
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.
- Loading branch information
victor
committed
Nov 12, 2024
1 parent
6cdf0ee
commit 4141195
Showing
5 changed files
with
79 additions
and
21 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
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
16 changes: 16 additions & 0 deletions
16
packages/code-du-travail-frontend/cypress/support/commands.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 |
---|---|---|
@@ -1,7 +1,23 @@ | ||
import "@testing-library/cypress/add-commands"; | ||
|
||
declare global { | ||
namespace Cypress { | ||
interface Chainable { | ||
selectByLabel: Chainable<Element>; | ||
} | ||
} | ||
} | ||
|
||
Cypress.Commands.add("checkCanonical", (path) => { | ||
cy.get("head > link[rel='canonical']") | ||
.should("have.prop", "href") | ||
.and("equal", `${Cypress.config().baseUrl}${path}`); | ||
}); | ||
|
||
Cypress.Commands.add("selectByLabel", (labelText) => { | ||
cy.contains("label", labelText) | ||
.invoke("attr", "for") | ||
.then((id) => { | ||
cy.get(`#${CSS.escape(id)}`); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { DocumentElasticWithSource, Tool } from "@socialgouv/cdtn-types"; | ||
|
||
export type ElasticTool = DocumentElasticWithSource<Tool>; |