From 638a5a9a88b346118fc738ad5f237b1da308ac48 Mon Sep 17 00:00:00 2001 From: Tobias Merki <103021062+neotob@users.noreply.github.com> Date: Mon, 30 Jun 2025 18:11:55 -1000 Subject: [PATCH 1/4] move declarations into type file --- .../cypress/component/Paging/Paging.cy.tsx | 5 +- .../PanelSidebar/PanelSidebar.cy.tsx | 29 ++++++------ cypress/cypress/support/commands.ts | 47 ------------------- cypress/cypress/support/component-index.html | 14 ------ cypress/cypress/support/component.ts | 44 ----------------- 5 files changed, 18 insertions(+), 121 deletions(-) delete mode 100644 cypress/cypress/support/commands.ts delete mode 100644 cypress/cypress/support/component-index.html delete mode 100644 cypress/cypress/support/component.ts diff --git a/cypress/cypress/component/Paging/Paging.cy.tsx b/cypress/cypress/component/Paging/Paging.cy.tsx index 928fdcb..9404959 100644 --- a/cypress/cypress/component/Paging/Paging.cy.tsx +++ b/cypress/cypress/component/Paging/Paging.cy.tsx @@ -1,5 +1,6 @@ import { Paging } from "react-pattern-ui"; import { faker } from "@faker-js/faker"; +import { mount } from "cypress/react18"; describe("Paging.cy.tsx", () => { it("basic paging works", () => { @@ -8,7 +9,7 @@ describe("Paging.cy.tsx", () => { const currentPage = faker.datatype.number({ min: 2, max: pages - 1 }); const translations = { showedItemsText: "Item {from} to {to} from {total}", itemsPerPageDropdown: "Items per page" }; - cy.mount( + mount( { const currentPage = faker.datatype.number({ min: 2, max: pages - 1 }); const translations = { showedItemsText: "Item {from} to {to} from {total}", itemsPerPageDropdown: "Items per page" }; - cy.mount( + mount( ; @@ -136,7 +137,7 @@ const PanelSideBarNoTiles = (props: PanelSideBarProps) => { describe("PanelSidebar.cy.tsx", () => { it("icon and titles rendered correctly", () => { - cy.mount(); + mount(); // Check if icon are rendered cy.get('[data-icon="bars"]').should("be.visible"); @@ -149,7 +150,7 @@ describe("PanelSidebar.cy.tsx", () => { }); it("flat menu entry", () => { - cy.mount(); + mount(); // Check page content changes cy.get("#home").click(); @@ -160,7 +161,7 @@ describe("PanelSidebar.cy.tsx", () => { }); it("nested menu entries", () => { - cy.mount(); + mount(); // Check page content changes cy.get("button[title=Settings]").click(); @@ -173,7 +174,7 @@ describe("PanelSidebar.cy.tsx", () => { }); it("disabled entries", () => { - cy.mount(); + mount(); // Check are disabled and page content not doesn't change cy.get("button[title=Home]").should("have.attr", "disabled"); @@ -185,7 +186,7 @@ describe("PanelSidebar.cy.tsx", () => { }); it("toggle sidebar", () => { - cy.mount(); + mount(); // Check toggle sidebar cy.get('[data-icon="angle-left"]').should("be.visible"); @@ -196,26 +197,26 @@ describe("PanelSidebar.cy.tsx", () => { }); it("selected flat entry", () => { - cy.mount(); + mount(); // Check active entries cy.get("#home").parent("div").parent("li").should("have.class", "active"); }); it("render correctly menu without tiles", () => { - cy.mount(); + mount(); cy.get("#main-section").should("have.class", "section-no-tiles"); cy.get(".side.nav__tiles").should("not.exist"); }); it("render correctly toggle button", () => { - cy.mount(); + mount(); cy.get("#sidebar-toggle").click(); cy.get("#side-nav").should("have.css", "width", "0px"); }); it("check dropdown correctly pre-expanded", () => { - cy.mount(); + mount(); cy.get("button[title=Settings]").click(); cy.get("#dropdown-test1").should("be.visible"); cy.get("#dropdown-test2").should("be.visible"); @@ -231,7 +232,7 @@ describe("PanelSidebar.cy.tsx", () => { ); }; - cy.mount( + mount(