mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
updated tests
This commit is contained in:
@@ -4,11 +4,11 @@ import Contact from "@/app/contactez-nous/page";
|
||||
|
||||
const navbarFooterCheck = () => {
|
||||
it("includes navbar", () => {
|
||||
cy.get("[data-cy='navbar']");
|
||||
cy.getByData("navbar");
|
||||
});
|
||||
|
||||
it("includes footer", () => {
|
||||
cy.get("[data-cy='footer']");
|
||||
cy.getByData("footer");
|
||||
});
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ describe("Verify component mount", () => {
|
||||
});
|
||||
|
||||
it("correct h1 tags with website name included", () => {
|
||||
cy.get("[data-cy='header1']").contains("echecs france", {
|
||||
cy.getByData("header1").contains("echecs france", {
|
||||
matchCase: false,
|
||||
});
|
||||
});
|
||||
@@ -33,7 +33,7 @@ describe("Verify component mount", () => {
|
||||
});
|
||||
|
||||
it("correct h1 tags with page title included", () => {
|
||||
cy.get("[data-cy='header2']").contains("qui sommes-nous", {
|
||||
cy.getByData("header2").contains("qui sommes-nous", {
|
||||
matchCase: false,
|
||||
});
|
||||
});
|
||||
@@ -47,7 +47,7 @@ describe("Verify component mount", () => {
|
||||
});
|
||||
|
||||
it("correct h1 tags with page title included", () => {
|
||||
cy.get("[data-cy='header2']").contains("contactez-nous", {
|
||||
cy.getByData("header2").contains("contactez-nous", {
|
||||
matchCase: false,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,12 +4,12 @@ describe("Scroll to top button", () => {
|
||||
it("desktop scroll button clickable", () => {
|
||||
cy.viewport("macbook-15");
|
||||
cy.mount(<ScrollToTopButton />);
|
||||
cy.get("[data-cy='scroll-to-top-button']").should("exist").click();
|
||||
cy.getByData("scroll-to-top-button").should("exist").click();
|
||||
});
|
||||
|
||||
it("mobile scroll button clickable", () => {
|
||||
cy.viewport(600, 600);
|
||||
cy.mount(<ScrollToTopButton />);
|
||||
cy.get("[data-cy='scroll-to-top-button']").should("exist").click();
|
||||
cy.getByData("scroll-to-top-button").should("exist").click();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,17 +7,17 @@ describe("ThemeSwitcher component", () => {
|
||||
cy.mount(<ThemeSwitcher />);
|
||||
|
||||
// checking that the toggle is there and light mode is active
|
||||
cy.get("[data-cy='toggle']").should("exist");
|
||||
cy.get("[data-cy='toggle']").should(($toggle) => {
|
||||
cy.getByData("toggle").should("exist");
|
||||
cy.getByData("toggle").should(($toggle) => {
|
||||
const backgroundImage = $toggle.css("background-image");
|
||||
expect(backgroundImage).to.include(
|
||||
"linear-gradient(rgb(0, 255, 255), rgb(135, 206, 235)"
|
||||
);
|
||||
});
|
||||
// checking that the toggle is clickable and dark mode is active
|
||||
cy.get("[data-cy='toggle']").click();
|
||||
cy.get("[data-cy='toggle-dark']").should("exist");
|
||||
cy.get("[data-cy='toggle-dark']").should(($toggle) => {
|
||||
cy.getByData("toggle").click();
|
||||
cy.getByData("toggle-dark").should("exist");
|
||||
cy.getByData("toggle-dark").should(($toggle) => {
|
||||
const backgroundImage = $toggle.css("background-image");
|
||||
expect(backgroundImage).to.include(
|
||||
"linear-gradient(rgb(25, 25, 112), rgb(102, 51, 153)"
|
||||
|
||||
Reference in New Issue
Block a user