scroll buttons fixed

This commit is contained in:
Owen Rees
2023-06-20 17:45:40 +02:00
parent b90d7a25de
commit 156268e9bb
10 changed files with 58 additions and 9 deletions
+15
View File
@@ -0,0 +1,15 @@
import ScrollToTopButton from "@/components/ScrollToTopButton";
describe("Scroll to top button", () => {
it("desktop scroll button clickable", () => {
cy.viewport("macbook-15");
cy.mount(<ScrollToTopButton isLgScreen={true} />);
cy.get("[data-cy='scroll-to-top-button']").should("exist").click();
});
it("mobile scroll button clickable", () => {
cy.viewport(600, 600);
cy.mount(<ScrollToTopButton isLgScreen={false} />);
cy.get("[data-cy='scroll-to-top-button']").should("exist").click();
});
});
-3
View File
@@ -1,13 +1,10 @@
import React from "react";
import ThemeSwitcher from "../../components/ThemeSwitcher";
import Home from "@/app/page";
import "@/css/theme-toggle.css";
describe("ThemeSwitcher component", () => {
it("should toggle between light and dark mode", () => {
cy.mount(<Home />);
cy.mount(<ThemeSwitcher />);
cy.wait(100);
// checking that the toggle is there and light mode is active
cy.get("[data-cy='toggle']").should("exist");