Skip to content

Commit

Permalink
Use "contains" instead of "have.text" with an assumed whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
krisztianb committed Nov 30, 2024
1 parent 4d44fbf commit 170beaa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions test/merge-module-monorepo/test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ describe("modules/Project_2.merged.html", () => {
it("contains the category Alpha and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(2)";

cy.get(sectionSelector + " h2").should("have.text", " Alpha");
cy.get(sectionSelector + " h2").should("contain", "Alpha");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of A.");
});

it("contains the category Beta and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(3)";

cy.get(sectionSelector + " h2").should("have.text", " Beta");
cy.get(sectionSelector + " h2").should("contain", "Beta");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of B.");
});

it("contains the category Gamma and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(1)";

cy.get(sectionSelector + " h2").should("have.text", " Gamma");
cy.get(sectionSelector + " h2").should("contain", "Gamma");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of C.");
});
});
6 changes: 3 additions & 3 deletions test/merge-module/test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("modules/notMerged.html", () => {
it("contains the category Gamma and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(1)";

cy.get(sectionSelector + " h2").should("have.text", " Gamma");
cy.get(sectionSelector + " h2").should("contain", "Gamma");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of C.");
});
});
Expand All @@ -52,14 +52,14 @@ describe("modules/merged.html", () => {
it("contains the category Alpha and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(1)";

cy.get(sectionSelector + " h2").should("have.text", " Alpha");
cy.get(sectionSelector + " h2").should("contain", "Alpha");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of A.");
});

it("contains the category Beta and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(2)";

cy.get(sectionSelector + " h2").should("have.text", " Beta");
cy.get(sectionSelector + " h2").should("contain", "Beta");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of B.");
});
});
6 changes: 3 additions & 3 deletions test/merge-project-monorepo/test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ describe("modules.html", () => {
it("contains the category Alpha and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(1)";

cy.get(sectionSelector + " h2").should("have.text", " Alpha");
cy.get(sectionSelector + " h2").should("contain", "Alpha");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of A.");
});

it("contains the category Beta and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(2)";

cy.get(sectionSelector + " h2").should("have.text", " Beta");
cy.get(sectionSelector + " h2").should("contain", "Beta");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of B.");
});

it("contains the category Gamma and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(3)";

cy.get(sectionSelector + " h2").should("have.text", " Gamma");
cy.get(sectionSelector + " h2").should("contain", "Gamma");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of C.");
});
});
6 changes: 3 additions & 3 deletions test/merge-project/test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ describe("modules.html", () => {
it("contains the category Alpha and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(1)";

cy.get(sectionSelector + " h2").should("have.text", " Alpha");
cy.get(sectionSelector + " h2").should("contain", "Alpha");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of A.");
});

it("contains the category Beta and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(2)";

cy.get(sectionSelector + " h2").should("have.text", " Beta");
cy.get(sectionSelector + " h2").should("contain", "Beta");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of B.");
});

it("contains the category Gamma and its description", () => {
const sectionSelector = ".col-content .tsd-panel-group:nth-of-type(3)";

cy.get(sectionSelector + " h2").should("have.text", " Gamma");
cy.get(sectionSelector + " h2").should("contain", "Gamma");
cy.get(sectionSelector + " p").should("have.text", "Category description from the file of C.");
});
});

0 comments on commit 170beaa

Please sign in to comment.