99 PanelItemOnSideBarCollapseOptions ,
1010} from "react-pattern-ui" ;
1111import { faBars , faCogs , faInfo , faHome , faPerson } from "@fortawesome/free-solid-svg-icons" ;
12+ import { mount } from "cypress/react18" ;
1213
1314type AppRoutes = "home" | "settings" | "dropdownTest" | "dropdown-test1" | "dropdown-test2" | "info" ;
1415type TSideBarMenuItem = PanelItem < AppRoutes > ;
@@ -136,7 +137,7 @@ const PanelSideBarNoTiles = (props: PanelSideBarProps) => {
136137
137138describe ( "PanelSidebar.cy.tsx" , ( ) => {
138139 it ( "icon and titles rendered correctly" , ( ) => {
139- cy . mount ( < PanelSideBarWithTiles /> ) ;
140+ mount ( < PanelSideBarWithTiles /> ) ;
140141
141142 // Check if icon are rendered
142143 cy . get ( '[data-icon="bars"]' ) . should ( "be.visible" ) ;
@@ -149,7 +150,7 @@ describe("PanelSidebar.cy.tsx", () => {
149150 } ) ;
150151
151152 it ( "flat menu entry" , ( ) => {
152- cy . mount ( < PanelSideBarWithTiles /> ) ;
153+ mount ( < PanelSideBarWithTiles /> ) ;
153154
154155 // Check page content changes
155156 cy . get ( "#home" ) . click ( ) ;
@@ -160,7 +161,7 @@ describe("PanelSidebar.cy.tsx", () => {
160161 } ) ;
161162
162163 it ( "nested menu entries" , ( ) => {
163- cy . mount ( < PanelSideBarWithTiles /> ) ;
164+ mount ( < PanelSideBarWithTiles /> ) ;
164165
165166 // Check page content changes
166167 cy . get ( "button[title=Settings]" ) . click ( ) ;
@@ -173,7 +174,7 @@ describe("PanelSidebar.cy.tsx", () => {
173174 } ) ;
174175
175176 it ( "disabled entries" , ( ) => {
176- cy . mount ( < PanelSideBarWithTiles disabled /> ) ;
177+ mount ( < PanelSideBarWithTiles disabled /> ) ;
177178
178179 // Check are disabled and page content not doesn't change
179180 cy . get ( "button[title=Home]" ) . should ( "have.attr" , "disabled" ) ;
@@ -185,7 +186,7 @@ describe("PanelSidebar.cy.tsx", () => {
185186 } ) ;
186187
187188 it ( "toggle sidebar" , ( ) => {
188- cy . mount ( < PanelSideBarWithTiles /> ) ;
189+ mount ( < PanelSideBarWithTiles /> ) ;
189190
190191 // Check toggle sidebar
191192 cy . get ( '[data-icon="angle-left"]' ) . should ( "be.visible" ) ;
@@ -196,26 +197,26 @@ describe("PanelSidebar.cy.tsx", () => {
196197 } ) ;
197198
198199 it ( "selected flat entry" , ( ) => {
199- cy . mount ( < PanelSideBarWithTiles active /> ) ;
200+ mount ( < PanelSideBarWithTiles active /> ) ;
200201
201202 // Check active entries
202203 cy . get ( "#home" ) . parent ( "div" ) . parent ( "li" ) . should ( "have.class" , "active" ) ;
203204 } ) ;
204205
205206 it ( "render correctly menu without tiles" , ( ) => {
206- cy . mount ( < PanelSideBarNoTiles /> ) ;
207+ mount ( < PanelSideBarNoTiles /> ) ;
207208 cy . get ( "#main-section" ) . should ( "have.class" , "section-no-tiles" ) ;
208209 cy . get ( ".side.nav__tiles" ) . should ( "not.exist" ) ;
209210 } ) ;
210211
211212 it ( "render correctly toggle button" , ( ) => {
212- cy . mount ( < PanelSideBarNoTiles /> ) ;
213+ mount ( < PanelSideBarNoTiles /> ) ;
213214 cy . get ( "#sidebar-toggle" ) . click ( ) ;
214215 cy . get ( "#side-nav" ) . should ( "have.css" , "width" , "0px" ) ;
215216 } ) ;
216217
217218 it ( "check dropdown correctly pre-expanded" , ( ) => {
218- cy . mount ( < PanelSideBarWithTiles expanded /> ) ;
219+ mount ( < PanelSideBarWithTiles expanded /> ) ;
219220 cy . get ( "button[title=Settings]" ) . click ( ) ;
220221 cy . get ( "#dropdown-test1" ) . should ( "be.visible" ) ;
221222 cy . get ( "#dropdown-test2" ) . should ( "be.visible" ) ;
@@ -231,7 +232,7 @@ describe("PanelSidebar.cy.tsx", () => {
231232 ) ;
232233 } ;
233234
234- cy . mount (
235+ mount (
235236 < PanelSideBarWithTiles expanded >
236237 < Button />
237238 </ PanelSideBarWithTiles > ,
@@ -254,7 +255,7 @@ describe("PanelSidebar.cy.tsx", () => {
254255 ) ;
255256 } ;
256257
257- cy . mount (
258+ mount (
258259 < PanelSideBarWithTiles expanded >
259260 < Button />
260261 </ PanelSideBarWithTiles > ,
@@ -282,7 +283,7 @@ describe("PanelSidebar.cy.tsx", () => {
282283 ) ;
283284 } ;
284285
285- cy . mount (
286+ mount (
286287 < PanelSideBarWithTiles >
287288 < Button />
288289 </ PanelSideBarWithTiles > ,
@@ -296,15 +297,15 @@ describe("PanelSidebar.cy.tsx", () => {
296297 } ) ;
297298
298299 it ( "check hidden panel" , ( ) => {
299- cy . mount ( < PanelSideBarWithTiles /> ) ;
300+ mount ( < PanelSideBarWithTiles /> ) ;
300301
301302 cy . get ( "button[title=Settings]" ) . should ( "be.visible" ) ;
302303 cy . get ( "button[title=Home]" ) . should ( "be.visible" ) ;
303304 cy . get ( "button[title=Info]" ) . should ( "not.exist" ) ;
304305 } ) ;
305306
306307 it ( "toggle sidebar with visible icons" , ( ) => {
307- cy . mount ( < PanelSideBarWithTiles onSidebarCollapseOptions = { { showIcon : true } } /> ) ;
308+ mount ( < PanelSideBarWithTiles onSidebarCollapseOptions = { { showIcon : true } } /> ) ;
308309 cy . get ( '[data-icon="angle-left"]' ) . should ( "be.visible" ) ;
309310 cy . get ( "#side-nav-toggle" ) . click ( ) ;
310311 cy . get ( '[data-icon="angle-right"]' ) . should ( "be.visible" ) ;
0 commit comments