import { mount } from "cypress/react18"; import { Button } from "./common/Button/Button"; describe("Button component tests", () => { const buttonText = "buttonText"; it("renders", () => { mount(); cy.get("button").should("exist"); }); it("Should have correct text", () => { mount(); cy.get("button").contains(buttonText); }); it("calls onClick when clicked", () => { const onClickStub = cy.stub().as("onClick"); mount(); cy.get("button").click(); cy.get("@onClick").should("have.been.calledOnce"); }); it("should be disabled", () => { mount(); cy.get("button").should("be.disabled"); }); });