mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
updated tests
This commit is contained in:
@@ -2,7 +2,7 @@ let tableRows: number;
|
||||
describe("Data fetching for map", () => {
|
||||
it("map markers is equal to table rows", () => {
|
||||
cy.visit("/tournois");
|
||||
cy.get('[data-cy="tournament-table"]')
|
||||
cy.getByData("tournament-table")
|
||||
.find("tr")
|
||||
.then((rows) => {
|
||||
tableRows = rows.length - 1;
|
||||
|
||||
@@ -25,7 +25,7 @@ describe("Test links", () => {
|
||||
cy.viewport(600, 600);
|
||||
cy.visit("/");
|
||||
pages.forEach((page) => {
|
||||
cy.get("[data-cy='hamburger-button']").click();
|
||||
cy.getByData("hamburger-button").click();
|
||||
cy.contains(page, { matchCase: false }).click();
|
||||
cy.location("pathname").should("eq", `/${navLinkToSlug(page)}`); // url path matches link name, replacing whitespace with hyphens
|
||||
cy.go("back");
|
||||
|
||||
@@ -5,12 +5,12 @@ describe("Mobile Navbar", () => {
|
||||
});
|
||||
|
||||
it("hamburger menu on mobile screens", () => {
|
||||
cy.get("[data-cy='mobile-menu']").should("be.visible");
|
||||
cy.get("[data-cy='desktop-menu']").should("be.not.visible");
|
||||
cy.getByData("mobile-menu").should("be.visible");
|
||||
cy.getByData("desktop-menu").should("be.not.visible");
|
||||
});
|
||||
|
||||
it("hamburger button available", () => {
|
||||
cy.get("[data-cy='hamburger-button']").should("be.visible");
|
||||
cy.getByData("hamburger-button").should("be.visible");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,11 +21,11 @@ describe("Desktop Navbar", () => {
|
||||
});
|
||||
|
||||
it("desktop menu on larger screens", () => {
|
||||
cy.get("[data-cy='mobile-menu']").should("be.hidden");
|
||||
cy.get("[data-cy='desktop-menu']").should("be.not.hidden");
|
||||
cy.getByData("mobile-menu").should("be.hidden");
|
||||
cy.getByData("desktop-menu").should("be.not.hidden");
|
||||
});
|
||||
|
||||
it("hamburger button hidden", () => {
|
||||
cy.get("[data-cy='hamburger-button']").should("be.not.visible");
|
||||
cy.getByData("hamburger-button").should("be.not.visible");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,8 +5,8 @@ describe("Scroll to top button", () => {
|
||||
|
||||
it("desktop scroll to top", () => {
|
||||
cy.viewport(1024, 800);
|
||||
cy.get("[data-cy='tournament-table-div']").scrollTo("bottom");
|
||||
cy.get("[data-cy='scroll-to-top-button']").click();
|
||||
cy.getByData("tournament-table-div").scrollTo("bottom");
|
||||
cy.getByData("scroll-to-top-button").click();
|
||||
// cy.get("[data-cy='tournament-table-div']")
|
||||
// .invoke("scrollTop")
|
||||
// .should("equal", 0);
|
||||
@@ -20,7 +20,7 @@ describe("Scroll to top button", () => {
|
||||
cy.viewport(600, 600);
|
||||
cy.scrollTo("bottom");
|
||||
cy.window().its("scrollY").should("not.equal", 0);
|
||||
cy.get("[data-cy='scroll-to-top-button']").click();
|
||||
cy.getByData("scroll-to-top-button").click();
|
||||
cy.window().its("scrollY").should("equal", 0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user