From e38b6c918aa6205079950f9de0e16e928515ce80 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Mon, 23 Jun 2025 14:26:05 +0300 Subject: [PATCH 01/11] chore(ui5-flexible-column-layout): migrate wdio tests to cypress --- packages/fiori/cypress/specs/FCL.cy.tsx | 941 +++++++++++++++++++++++- 1 file changed, 940 insertions(+), 1 deletion(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 6626b94417a1..2873a47b2f12 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -106,7 +106,7 @@ describe("ACC", () => { .find("slot[name=endColumn]") .should("have.attr", "aria-hidden"); }); - + it("verifies that aria-valuenow is set on separators", () => { cy.mount( @@ -130,3 +130,942 @@ describe("ACC", () => { .should("have.attr", "aria-valuenow"); }); }); + +describe("FlexibleColumnLayout Behavior", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1000, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("tests Desktop size 1400px", () => { + cy.viewport(1400, 1080); + + cy.get("#fcl3") + .invoke("attr", "_visible-columns") + .should("equal", "3"); + }); + + it("tests Tablet Size 1000px", () => { + cy.viewport(1000, 1080); + + cy.get("#fcl3") + .invoke("attr", "_visible-columns") + .should("equal", "2"); + }); + + it("tests Phone size 500px", () => { + cy.viewport(320, 1080); + + cy.get("#fcl3") + .invoke("attr", "_visible-columns") + .should("equal", "1"); + }); +}); + +describe("Layout API Tests", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1600, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("tests change layout with API", () => { + cy.get("#fcl1") + .invoke("attr", "_visible-columns") + .should("equal", "2"); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + + cy.get("#fcl1") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl1") + .invoke("attr", "_visible-columns") + .should("equal", "3"); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + }); + + it("tests change layout upon dragging the separator to a new layout", () => { + cy.get("#fcl1") + .invoke("prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + + cy.get("#fcl1") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsMidExpanded"); + + cy.get("#fcl1") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(400, 0) + .realMouseUp(); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + }); +}); + +describe("Column Expansion Tests", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1600, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { + cy.get("#fcl-expansion") + .invoke("prop", "layout", "TwoColumnsMidExpanded"); + + cy.get("#fcl-expansion") + .invoke("prop", "layout") + .should("equal", "TwoColumnsMidExpanded"); + }); + + it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { + cy.get("#fcl-expansion") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl-expansion") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl-expansion") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl-expansion") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + }); +}); + +describe("Start Column Expansion Test", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1600, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { + cy.get("#fcl-start") + .invoke("prop", "layout", "TwoColumnsMidExpanded"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "TwoColumnsMidExpanded"); + + cy.get("#fcl-start") + .invoke("prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + }); + + it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { + cy.get("#fcl-start") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsStartExpandedEndHidden"); + }); + + it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { + cy.get("#fcl-start") + .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsStartExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + }); + + it("allows expand end column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { + cy.get("#fcl-start") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl-start") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl-start") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + }); +}); + +describe("Layout change by dragging end-separator on desktop", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1600, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + }); + + it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsEndExpanded"); + }); +}); + +describe("Layout change by dragging start-separator on tablet", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1000, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { + cy.get("#fcl1") + .invoke("prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + + cy.get("#fcl1") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsMidExpanded"); + }); + + it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { + cy.get("#fcl1") + .invoke("prop", "layout", "TwoColumnsMidExpanded"); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsMidExpanded"); + + cy.get("#fcl1") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(400, 0) + .realMouseUp(); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + }); + + it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { + cy.get("#fcl1") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl1") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(300, 0) + .realMouseUp(); + + cy.get("#fcl1") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + }); +}); + +describe("Tablet Layout Tests", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1000, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(400, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsStartExpandedEndHidden"); + }); + + it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsStartExpandedEndHidden"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + }); + + it("preserves ThreeColumnsMidExpandedEndHidden when dragging to shrink start column", () => { + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(-100, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + }); +}); + +describe("Layout change by dragging end-separator on tablet", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1000, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + }); + + it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-300, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsEndExpanded"); + }); +}); + +describe("Preserves column min-width", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1400, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("complies with min-width requirement on smallest desktop", () => { + const smallestDesktopWidth = 1024; + const smallestColumnWidth = 248; + + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .invoke("css", "width", `${smallestDesktopWidth}px`); + + cy.get("#fcl3") + .should("have.css", "width", `${smallestDesktopWidth}px`); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--start") + .should($startColumn => { + const width = $startColumn.width(); + expect(width).to.equal(smallestColumnWidth); + }); + }); + + it("preserves min-width of begin column", () => { + const smallestColumnWidth = 248; + + cy.get("#fcl3") + .invoke("prop", "layout", "TwoColumnsMidExpanded"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "TwoColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--start") + .then($startColumn => { + const initialWidth = $startColumn.width(); + + const differenceFromSmallestWidth = initialWidth - smallestColumnWidth; + const testOffsetX = differenceFromSmallestWidth + 50; + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(-testOffsetX, 0) + .realMouseUp(); + + // Check what actually happened + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--start") + .then($finalColumn => { + const finalWidth = $finalColumn.width(); + }); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "TwoColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--start") + .should($startColumn => { + const finalWidth = $startColumn.width(); + expect(finalWidth).to.be.at.least(smallestColumnWidth); + }); + }); + }); + + it("preserves min-width of mid column in 2-column layout", () => { + const smallestColumnWidth = 248; + + cy.get("#fcl3") + .invoke("prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--middle") + .then($midColumn => { + const midColumnWidth = $midColumn.width(); + const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; + const testOffsetX = differenceFromSmallestWidth + 10; + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(testOffsetX, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "TwoColumnsStartExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--middle") + .then($finalMidColumn => { + const finalWidth = $finalMidColumn.width(); + + expect(finalWidth).to.be.closeTo(smallestColumnWidth, 5); + }); + }); + }); + + it("preserves min-width of mid column in 3-column layout", () => { + const smallestColumnWidth = 248; + + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--middle") + .then($midColumn => { + const midColumnWidth = $midColumn.width(); + const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; + const testOffsetX = differenceFromSmallestWidth + 10; + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-testOffsetX, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsEndExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--middle") + .then($finalMidColumn => { + const finalWidth = $finalMidColumn.width(); + + expect(finalWidth).to.be.closeTo(smallestColumnWidth, 10); + }); + }); + }); + + it("preserves min-width of end column", () => { + const smallestColumnWidth = 248; + + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--end") + .then($endColumn => { + const endColumnWidth = $endColumn.width(); + const differenceFromSmallestWidth = endColumnWidth - smallestColumnWidth; + const testOffsetX = differenceFromSmallestWidth + 10; + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(testOffsetX, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--end") + .then($finalEndColumn => { + const finalWidth = $finalEndColumn.width(); + + expect(finalWidth).to.be.closeTo(smallestColumnWidth, 10); + }); + }); + }); + + it("fully reveals the end-column on dragging the end-separator only few pixels", () => { + const smallestColumnWidth = 248; + + cy.get("#fcl3") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-100, 0) + .realMouseUp(); + + cy.get("#fcl3") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl3") + .shadow() + .find(".ui5-fcl-column--end") + .should($endColumn => { + const width = $endColumn.width(); + expect(width).to.be.closeTo(smallestColumnWidth, 10); + }); + }); +}); + +describe("Accessibility with Animation Disabled", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + + cy.get("#fclAcc").then(($fcl) => { + ($fcl[0] as any).accessibilityAttributes = { + startColumn: { + name: "Products list", + }, + midColumn: { + name: "Product information", + }, + endColumn: { + name: "Product detailed information", + }, + startSeparator: { + name: "Start Draggable Splitter", + }, + endSeparator: { + name: "End Draggable Splitter", + }, + }; + }); + }); + + it("tests separator acc attrs", () => { + const startSeparatorText = "Start Draggable Splitter"; + const endSeparatorText = "End Draggable Splitter"; + + cy.get("#fclAcc") + .shadow() + .find(".ui5-fcl-separator-start") + .should("have.attr", "title", startSeparatorText); + + cy.get("#fclAcc") + .shadow() + .find(".ui5-fcl-separator-end") + .should("have.attr", "title", endSeparatorText); + }); + + it("tests acc default roles", () => { + cy.get("#fclAcc") + .shadow() + .find(".ui5-fcl-column--start") + .should("have.attr", "role", "region"); + + cy.get("#fclAcc") + .shadow() + .find(".ui5-fcl-column--middle") + .should("have.attr", "role", "region"); + + cy.get("#fclAcc") + .shadow() + .find(".ui5-fcl-column--end") + .should("not.have.attr", "role"); + + cy.get("#fclAcc") + .shadow() + .find(".ui5-fcl-separator-start") + .should("have.attr", "role", "separator"); + + cy.get("#fclAcc") + .shadow() + .find(".ui5-fcl-separator-end") + .should("have.attr", "role", "separator"); + }); + + it("tests acc custom roles", () => { + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + + cy.get("#fclAccRoles").then(($fcl) => { + ($fcl[0] as any).accessibilityAttributes = { + startColumn: { role: "complementary" }, + startSeparator: { role: "navigation" }, + midColumn: { role: "main" }, + endSeparator: { role: "navigation" }, + endColumn: { role: "complementary" }, + }; + }); + + cy.get("#fclAccRoles") + .shadow() + .find(".ui5-fcl-column--start") + .should("have.attr", "role", "complementary"); + + cy.get("#fclAccRoles") + .shadow() + .find(".ui5-fcl-column--middle") + .should("have.attr", "role", "main"); + + cy.get("#fclAccRoles") + .shadow() + .find(".ui5-fcl-column--end") + .should("have.attr", "role", "complementary"); + + cy.get("#fclAccRoles") + .shadow() + .find(".ui5-fcl-separator-start") + .should("have.attr", "role", "navigation"); + + cy.get("#fclAccRoles") + .shadow() + .find(".ui5-fcl-separator-end") + .should("have.attr", "role", "navigation"); + }); + + it("tests acc attrs", () => { + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + + cy.get("#fclAccAttrs") + .shadow() + .find(".ui5-fcl-column--start") + .should("not.have.attr", "aria-hidden"); + + cy.get("#fclAccAttrs") + .shadow() + .find(".ui5-fcl-column--middle") + .should("have.attr", "aria-hidden", "true"); + }); +}); + +describe("First column closing arrow behavior", () => { + beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + + cy.viewport(1400, 1080); + + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + }); + + it("should switch layout and update arrow icon on desktop", () => { + cy.get("#fcl10") + .invoke("prop", "layout", "ThreeColumnsStartHiddenMidExpanded"); + + cy.get("#fcl10") + .shadow() + .find(".ui5-fcl-arrow--start") + .should("have.attr", "icon", "slim-arrow-right"); + + cy.get("#fcl10") + .shadow() + .find(".ui5-fcl-arrow--start") + .click(); + + cy.get("#fcl10") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsMidExpanded"); + + cy.get("#fcl10") + .shadow() + .find(".ui5-fcl-arrow--start") + .should("have.attr", "icon", "slim-arrow-left"); + + cy.get("#fcl10") + .shadow() + .find(".ui5-fcl-arrow--start") + .click(); + + cy.get("#fcl10") + .invoke("prop", "layout") + .should("equal", "ThreeColumnsStartHiddenMidExpanded"); + + cy.get("#fcl10") + .shadow() + .find(".ui5-fcl-arrow--start") + .should("have.attr", "icon", "slim-arrow-right"); + }); +}); \ No newline at end of file From 691aba90b3cd74b3bb7d7a587877a17bec644643 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Mon, 23 Jun 2025 17:06:28 +0300 Subject: [PATCH 02/11] refactor: move animation mode setup to global before hook --- packages/fiori/cypress/specs/FCL.cy.tsx | 43 ++++--------------------- 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 2873a47b2f12..107c3bf76cb9 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -2,11 +2,15 @@ import { setAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationM import FlexibleColumnLayout from "../../src/FlexibleColumnLayout.js"; import AnimationMode from "@ui5/webcomponents-base/dist/types/AnimationMode.js"; +before(() => { + cy.wrap({ setAnimationMode }) + .then(api => { + return api.setAnimationMode("none"); + }); + }); + describe("Columns resize", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.mount(
some content
@@ -133,9 +137,6 @@ describe("ACC", () => { describe("FlexibleColumnLayout Behavior", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1000, 1080); cy.mount( @@ -174,9 +175,6 @@ describe("FlexibleColumnLayout Behavior", () => { describe("Layout API Tests", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1600, 1080); cy.mount( @@ -243,9 +241,6 @@ describe("Layout API Tests", () => { describe("Column Expansion Tests", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1600, 1080); cy.mount( @@ -285,9 +280,6 @@ describe("Column Expansion Tests", () => { describe("Start Column Expansion Test", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1600, 1080); cy.mount( @@ -366,9 +358,6 @@ describe("Start Column Expansion Test", () => { describe("Layout change by dragging end-separator on desktop", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1600, 1080); cy.mount( @@ -423,9 +412,6 @@ describe("Layout change by dragging end-separator on desktop", () => { describe("Layout change by dragging start-separator on tablet", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1000, 1080); cy.mount( @@ -500,9 +486,6 @@ describe("Layout change by dragging start-separator on tablet", () => { describe("Tablet Layout Tests", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1000, 1080); cy.mount( @@ -577,9 +560,6 @@ describe("Tablet Layout Tests", () => { describe("Layout change by dragging end-separator on tablet", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1000, 1080); cy.mount( @@ -634,9 +614,6 @@ describe("Layout change by dragging end-separator on tablet", () => { describe("Preserves column min-width", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1400, 1080); cy.mount( @@ -875,9 +852,6 @@ describe("Preserves column min-width", () => { describe("Accessibility with Animation Disabled", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.mount(
some content
@@ -1017,9 +991,6 @@ describe("Accessibility with Animation Disabled", () => { describe("First column closing arrow behavior", () => { beforeEach(() => { - cy.wrap({ setAnimationMode }) - .invoke("setAnimationMode", AnimationMode.None); - cy.viewport(1400, 1080); cy.mount( From a370abb76404b9639ab216c7b883d21b42189d1b Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Tue, 24 Jun 2025 11:18:15 +0300 Subject: [PATCH 03/11] refactor: comment out the problematic tests --- packages/fiori/cypress/specs/FCL.cy.tsx | 245 ++++++++++++------------ 1 file changed, 122 insertions(+), 123 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 107c3bf76cb9..acde1017066a 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -1,6 +1,5 @@ import { setAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationMode.js"; import FlexibleColumnLayout from "../../src/FlexibleColumnLayout.js"; -import AnimationMode from "@ui5/webcomponents-base/dist/types/AnimationMode.js"; before(() => { cy.wrap({ setAnimationMode }) @@ -389,25 +388,25 @@ describe("Layout change by dragging end-separator on desktop", () => { .should("equal", "ThreeColumnsMidExpanded"); }); - it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { - cy.get("#fcl3") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); - - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-separator-end") - .realMouseDown() - .realMouseMove(-400, 0) - .realMouseUp(); - - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsEndExpanded"); - }); + // it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { + // cy.get("#fcl3") + // .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsMidExpanded"); + + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-separator-end") + // .realMouseDown() + // .realMouseMove(-400, 0) + // .realMouseUp(); + + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsEndExpanded"); + // }); }); describe("Layout change by dragging start-separator on tablet", () => { @@ -443,45 +442,45 @@ describe("Layout change by dragging start-separator on tablet", () => { .should("equal", "TwoColumnsMidExpanded"); }); - it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { - cy.get("#fcl1") - .invoke("prop", "layout", "TwoColumnsMidExpanded"); - - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsMidExpanded"); - - cy.get("#fcl1") - .shadow() - .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(400, 0) - .realMouseUp(); - - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); - }); - - it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("#fcl1") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); - - cy.get("#fcl1") - .shadow() - .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(300, 0) - .realMouseUp(); - - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); - }); + // it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { + // cy.get("#fcl1") + // .invoke("prop", "layout", "TwoColumnsMidExpanded"); + + // cy.get("#fcl1") + // .invoke("prop", "layout") + // .should("equal", "TwoColumnsMidExpanded"); + + // cy.get("#fcl1") + // .shadow() + // .find(".ui5-fcl-separator-start") + // .realMouseDown() + // .realMouseMove(400, 0) + // .realMouseUp(); + + // cy.get("#fcl1") + // .invoke("prop", "layout") + // .should("equal", "TwoColumnsStartExpanded"); + // }); + + // it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { + // cy.get("#fcl1") + // .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + // cy.get("#fcl1") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsMidExpanded"); + + // cy.get("#fcl1") + // .shadow() + // .find(".ui5-fcl-separator-start") + // .realMouseDown() + // .realMouseMove(300, 0) + // .realMouseUp(); + + // cy.get("#fcl1") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsMidExpandedEndHidden"); + // }); }); describe("Tablet Layout Tests", () => { @@ -517,25 +516,25 @@ describe("Tablet Layout Tests", () => { .should("equal", "ThreeColumnsStartExpandedEndHidden"); }); - it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("#fcl3") - .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + // it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { + // cy.get("#fcl3") + // .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsStartExpandedEndHidden"); + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsStartExpandedEndHidden"); - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(-400, 0) - .realMouseUp(); + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-separator-start") + // .realMouseDown() + // .realMouseMove(-400, 0) + // .realMouseUp(); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); - }); + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsMidExpandedEndHidden"); + // }); it("preserves ThreeColumnsMidExpandedEndHidden when dragging to shrink start column", () => { cy.get("#fcl3") @@ -591,25 +590,25 @@ describe("Layout change by dragging end-separator on tablet", () => { .should("equal", "ThreeColumnsMidExpanded"); }); - it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { - cy.get("#fcl3") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); - - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-separator-end") - .realMouseDown() - .realMouseMove(-300, 0) - .realMouseUp(); - - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsEndExpanded"); - }); + // it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { + // cy.get("#fcl3") + // .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsMidExpanded"); + + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-separator-end") + // .realMouseDown() + // .realMouseMove(-300, 0) + // .realMouseUp(); + + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsEndExpanded"); + // }); }); describe("Preserves column min-width", () => { @@ -819,35 +818,35 @@ describe("Preserves column min-width", () => { }); }); - it("fully reveals the end-column on dragging the end-separator only few pixels", () => { - const smallestColumnWidth = 248; - - cy.get("#fcl3") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); - - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-separator-end") - .realMouseDown() - .realMouseMove(-100, 0) - .realMouseUp(); - - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); - - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-column--end") - .should($endColumn => { - const width = $endColumn.width(); - expect(width).to.be.closeTo(smallestColumnWidth, 10); - }); - }); + // it("fully reveals the end-column on dragging the end-separator only few pixels", () => { + // const smallestColumnWidth = 248; + + // cy.get("#fcl3") + // .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsMidExpandedEndHidden"); + + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-separator-end") + // .realMouseDown() + // .realMouseMove(-100, 0) + // .realMouseUp(); + + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "ThreeColumnsMidExpanded"); + + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-column--end") + // .should($endColumn => { + // const width = $endColumn.width(); + // expect(width).to.be.closeTo(smallestColumnWidth, 10); + // }); + // }); }); describe("Accessibility with Animation Disabled", () => { From 0afad6e18cd5a47df8d9989479e4fef90f589eb5 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Tue, 24 Jun 2025 11:30:19 +0300 Subject: [PATCH 04/11] refactor: comment out the problematic tests --- packages/fiori/cypress/specs/FCL.cy.tsx | 72 ++++++++++++------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index acde1017066a..83475341fd18 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -698,45 +698,45 @@ describe("Preserves column min-width", () => { }); }); - it("preserves min-width of mid column in 2-column layout", () => { - const smallestColumnWidth = 248; - - cy.get("#fcl3") - .invoke("prop", "layout", "TwoColumnsStartExpanded"); - - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); - - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-column--middle") - .then($midColumn => { - const midColumnWidth = $midColumn.width(); - const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; - - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(testOffsetX, 0) - .realMouseUp(); + // it("preserves min-width of mid column in 2-column layout", () => { + // const smallestColumnWidth = 248; - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); + // cy.get("#fcl3") + // .invoke("prop", "layout", "TwoColumnsStartExpanded"); - cy.get("#fcl3") - .shadow() - .find(".ui5-fcl-column--middle") - .then($finalMidColumn => { - const finalWidth = $finalMidColumn.width(); + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "TwoColumnsStartExpanded"); - expect(finalWidth).to.be.closeTo(smallestColumnWidth, 5); - }); - }); - }); + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-column--middle") + // .then($midColumn => { + // const midColumnWidth = $midColumn.width(); + // const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; + // const testOffsetX = differenceFromSmallestWidth + 10; + + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-separator-start") + // .realMouseDown() + // .realMouseMove(testOffsetX, 0) + // .realMouseUp(); + + // cy.get("#fcl3") + // .invoke("prop", "layout") + // .should("equal", "TwoColumnsStartExpanded"); + + // cy.get("#fcl3") + // .shadow() + // .find(".ui5-fcl-column--middle") + // .then($finalMidColumn => { + // const finalWidth = $finalMidColumn.width(); + + // expect(finalWidth).to.be.closeTo(smallestColumnWidth, 5); + // }); + // }); + // }); it("preserves min-width of mid column in 3-column layout", () => { const smallestColumnWidth = 248; From ea4212ded62cd14eaf8d2c85bbdb4071cee80922 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Wed, 25 Jun 2025 14:29:36 +0300 Subject: [PATCH 05/11] refactor: address comments --- packages/fiori/cypress/specs/FCL.cy.tsx | 765 +++++++++++------------- packages/fiori/test/specs/FCL.spec.js | 590 ------------------ 2 files changed, 361 insertions(+), 994 deletions(-) delete mode 100644 packages/fiori/test/specs/FCL.spec.js diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 83475341fd18..e27959a6e955 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -135,40 +135,49 @@ describe("ACC", () => { }); describe("FlexibleColumnLayout Behavior", () => { - beforeEach(() => { - cy.viewport(1000, 1080); + it("tests Desktop size 1400px", () => { + cy.viewport(1400, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); - }); - it("tests Desktop size 1400px", () => { - cy.viewport(1400, 1080); - - cy.get("#fcl3") - .invoke("attr", "_visible-columns") - .should("equal", "3"); + cy.get("[ui5-flexible-column-layout]") + .should("have.attr", "_visible-columns", "3"); }); it("tests Tablet Size 1000px", () => { cy.viewport(1000, 1080); - cy.get("#fcl3") - .invoke("attr", "_visible-columns") - .should("equal", "2"); + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + + cy.get("[ui5-flexible-column-layout]") + .should("have.attr", "_visible-columns", "2"); }); it("tests Phone size 500px", () => { cy.viewport(320, 1080); - cy.get("#fcl3") - .invoke("attr", "_visible-columns") - .should("equal", "1"); + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + + cy.get("[ui5-flexible-column-layout]") + .should("have.attr", "_visible-columns", "1"); }); }); @@ -177,64 +186,57 @@ describe("Layout API Tests", () => { cy.viewport(1600, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("tests change layout with API", () => { - cy.get("#fcl1") - .invoke("attr", "_visible-columns") - .should("equal", "2"); + cy.get("[ui5-flexible-column-layout]") + .should("have.attr", "_visible-columns", "2"); - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); - cy.get("#fcl1") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl1") - .invoke("attr", "_visible-columns") - .should("equal", "3"); + cy.get("[ui5-flexible-column-layout]") + .should("have.attr", "_visible-columns", "3"); - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); }); it("tests change layout upon dragging the separator to a new layout", () => { - cy.get("#fcl1") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "TwoColumnsStartExpanded"); - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); - cy.get("#fcl1") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsMidExpanded"); - cy.get("#fcl1") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .realMouseDown() .realMouseMove(400, 0) .realMouseUp(); - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); }); }); @@ -243,37 +245,34 @@ describe("Column Expansion Tests", () => { cy.viewport(1600, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { - cy.get("#fcl-expansion") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "TwoColumnsMidExpanded"); - cy.get("#fcl-expansion") - .invoke("prop", "layout") - .should("equal", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsMidExpanded"); }); it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("#fcl-expansion") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl-expansion") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl-expansion") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl-expansion") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); }); }); @@ -282,76 +281,68 @@ describe("Start Column Expansion Test", () => { cy.viewport(1600, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "TwoColumnsMidExpanded"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsMidExpanded"); - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "TwoColumnsStartExpanded"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); }); it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsStartExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); }); it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsStartExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); }); it("allows expand end column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl-start") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl-start") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); }); }); @@ -360,53 +351,49 @@ describe("Layout change by dragging end-separator on desktop", () => { cy.viewport(1600, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); }); - // it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { - // cy.get("#fcl3") - // .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsMidExpanded"); - - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-separator-end") - // .realMouseDown() - // .realMouseMove(-400, 0) - // .realMouseUp(); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsEndExpanded"); - // }); + it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { + cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsEndExpanded"); + }); }); describe("Layout change by dragging start-separator on tablet", () => { @@ -414,73 +401,67 @@ describe("Layout change by dragging start-separator on tablet", () => { cy.viewport(1000, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { - cy.get("#fcl1") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "TwoColumnsStartExpanded"); - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); - cy.get("#fcl1") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("#fcl1") - .invoke("prop", "layout") - .should("equal", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsMidExpanded"); }); - // it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { - // cy.get("#fcl1") - // .invoke("prop", "layout", "TwoColumnsMidExpanded"); - - // cy.get("#fcl1") - // .invoke("prop", "layout") - // .should("equal", "TwoColumnsMidExpanded"); - - // cy.get("#fcl1") - // .shadow() - // .find(".ui5-fcl-separator-start") - // .realMouseDown() - // .realMouseMove(400, 0) - // .realMouseUp(); - - // cy.get("#fcl1") - // .invoke("prop", "layout") - // .should("equal", "TwoColumnsStartExpanded"); - // }); - - // it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { - // cy.get("#fcl1") - // .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - - // cy.get("#fcl1") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsMidExpanded"); - - // cy.get("#fcl1") - // .shadow() - // .find(".ui5-fcl-separator-start") - // .realMouseDown() - // .realMouseMove(300, 0) - // .realMouseUp(); - - // cy.get("#fcl1") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsMidExpandedEndHidden"); - // }); + it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { + cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "TwoColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(400, 0) + .realMouseUp(); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); + }); + + it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { + cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(300, 0) + .realMouseUp(); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + }); }); describe("Tablet Layout Tests", () => { @@ -488,72 +469,66 @@ describe("Tablet Layout Tests", () => { cy.viewport(1000, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .realMouseDown() .realMouseMove(400, 0) .realMouseUp(); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsStartExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); }); - // it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { - // cy.get("#fcl3") - // .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { + cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsStartExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-separator-start") - // .realMouseDown() - // .realMouseMove(-400, 0) - // .realMouseUp(); + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsMidExpandedEndHidden"); - // }); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + }); it("preserves ThreeColumnsMidExpandedEndHidden when dragging to shrink start column", () => { - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .realMouseDown() .realMouseMove(-100, 0) .realMouseUp(); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); }); }); @@ -562,53 +537,49 @@ describe("Layout change by dragging end-separator on tablet", () => { cy.viewport(1000, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); }); - // it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { - // cy.get("#fcl3") - // .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsMidExpanded"); - - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-separator-end") - // .realMouseDown() - // .realMouseMove(-300, 0) - // .realMouseUp(); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsEndExpanded"); - // }); + it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { + cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-300, 0) + .realMouseUp(); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsEndExpanded"); + }); }); describe("Preserves column min-width", () => { @@ -616,10 +587,10 @@ describe("Preserves column min-width", () => { cy.viewport(1400, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); @@ -628,20 +599,19 @@ describe("Preserves column min-width", () => { const smallestDesktopWidth = 1024; const smallestColumnWidth = 248; - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("css", "width", `${smallestDesktopWidth}px`); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .should("have.css", "width", `${smallestDesktopWidth}px`); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") .should($startColumn => { @@ -653,14 +623,13 @@ describe("Preserves column min-width", () => { it("preserves min-width of begin column", () => { const smallestColumnWidth = 248; - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "TwoColumnsMidExpanded"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsMidExpanded"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") .then($startColumn => { @@ -669,26 +638,24 @@ describe("Preserves column min-width", () => { const differenceFromSmallestWidth = initialWidth - smallestColumnWidth; const testOffsetX = differenceFromSmallestWidth + 50; - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .realMouseDown() .realMouseMove(-testOffsetX, 0) .realMouseUp(); - // Check what actually happened - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") .then($finalColumn => { const finalWidth = $finalColumn.width(); }); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsMidExpanded"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") .should($startColumn => { @@ -698,57 +665,54 @@ describe("Preserves column min-width", () => { }); }); - // it("preserves min-width of mid column in 2-column layout", () => { - // const smallestColumnWidth = 248; - - // cy.get("#fcl3") - // .invoke("prop", "layout", "TwoColumnsStartExpanded"); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "TwoColumnsStartExpanded"); - - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-column--middle") - // .then($midColumn => { - // const midColumnWidth = $midColumn.width(); - // const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; - // const testOffsetX = differenceFromSmallestWidth + 10; - - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-separator-start") - // .realMouseDown() - // .realMouseMove(testOffsetX, 0) - // .realMouseUp(); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "TwoColumnsStartExpanded"); - - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-column--middle") - // .then($finalMidColumn => { - // const finalWidth = $finalMidColumn.width(); - - // expect(finalWidth).to.be.closeTo(smallestColumnWidth, 5); - // }); - // }); - // }); + it("preserves min-width of mid column in 2-column layout", () => { + const smallestColumnWidth = 248; + + cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-column--middle") + .then($midColumn => { + const midColumnWidth = $midColumn.width(); + const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; + const testOffsetX = differenceFromSmallestWidth + 10; + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-start") + .realMouseDown() + .realMouseMove(testOffsetX, 0) + .realMouseUp(); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-column--middle") + .then($finalMidColumn => { + const finalWidth = $finalMidColumn.width(); + + expect(finalWidth).to.be.closeTo(smallestColumnWidth, 5); + }); + }); + }); it("preserves min-width of mid column in 3-column layout", () => { const smallestColumnWidth = 248; - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--middle") .then($midColumn => { @@ -756,18 +720,17 @@ describe("Preserves column min-width", () => { const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; const testOffsetX = differenceFromSmallestWidth + 10; - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") .realMouseDown() .realMouseMove(-testOffsetX, 0) .realMouseUp(); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsEndExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsEndExpanded"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--middle") .then($finalMidColumn => { @@ -781,14 +744,13 @@ describe("Preserves column min-width", () => { it("preserves min-width of end column", () => { const smallestColumnWidth = 248; - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--end") .then($endColumn => { @@ -796,18 +758,17 @@ describe("Preserves column min-width", () => { const differenceFromSmallestWidth = endColumnWidth - smallestColumnWidth; const testOffsetX = differenceFromSmallestWidth + 10; - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") .realMouseDown() .realMouseMove(testOffsetX, 0) .realMouseUp(); - cy.get("#fcl3") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl3") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--end") .then($finalEndColumn => { @@ -818,48 +779,46 @@ describe("Preserves column min-width", () => { }); }); - // it("fully reveals the end-column on dragging the end-separator only few pixels", () => { - // const smallestColumnWidth = 248; - - // cy.get("#fcl3") - // .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsMidExpandedEndHidden"); - - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-separator-end") - // .realMouseDown() - // .realMouseMove(-100, 0) - // .realMouseUp(); - - // cy.get("#fcl3") - // .invoke("prop", "layout") - // .should("equal", "ThreeColumnsMidExpanded"); - - // cy.get("#fcl3") - // .shadow() - // .find(".ui5-fcl-column--end") - // .should($endColumn => { - // const width = $endColumn.width(); - // expect(width).to.be.closeTo(smallestColumnWidth, 10); - // }); - // }); + it("fully reveals the end-column on dragging the end-separator only few pixels", () => { + const smallestColumnWidth = 248; + + cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-end") + .realMouseDown() + .realMouseMove(-100, 0) + .realMouseUp(); + + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-column--end") + .should($endColumn => { + const width = $endColumn.width(); + expect(width).to.be.closeTo(smallestColumnWidth, 10); + }); + }); }); describe("Accessibility with Animation Disabled", () => { beforeEach(() => { cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); - cy.get("#fclAcc").then(($fcl) => { + cy.get("[ui5-flexible-column-layout]").then(($fcl) => { ($fcl[0] as any).accessibilityAttributes = { startColumn: { name: "Products list", @@ -884,39 +843,39 @@ describe("Accessibility with Animation Disabled", () => { const startSeparatorText = "Start Draggable Splitter"; const endSeparatorText = "End Draggable Splitter"; - cy.get("#fclAcc") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .should("have.attr", "title", startSeparatorText); - cy.get("#fclAcc") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") .should("have.attr", "title", endSeparatorText); }); it("tests acc default roles", () => { - cy.get("#fclAcc") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") .should("have.attr", "role", "region"); - cy.get("#fclAcc") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--middle") .should("have.attr", "role", "region"); - cy.get("#fclAcc") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--end") .should("not.have.attr", "role"); - cy.get("#fclAcc") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .should("have.attr", "role", "separator"); - cy.get("#fclAcc") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") .should("have.attr", "role", "separator"); @@ -924,14 +883,14 @@ describe("Accessibility with Animation Disabled", () => { it("tests acc custom roles", () => { cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); - cy.get("#fclAccRoles").then(($fcl) => { + cy.get("[ui5-flexible-column-layout]").then(($fcl) => { ($fcl[0] as any).accessibilityAttributes = { startColumn: { role: "complementary" }, startSeparator: { role: "navigation" }, @@ -941,27 +900,27 @@ describe("Accessibility with Animation Disabled", () => { }; }); - cy.get("#fclAccRoles") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") .should("have.attr", "role", "complementary"); - cy.get("#fclAccRoles") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--middle") .should("have.attr", "role", "main"); - cy.get("#fclAccRoles") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--end") .should("have.attr", "role", "complementary"); - cy.get("#fclAccRoles") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") .should("have.attr", "role", "navigation"); - cy.get("#fclAccRoles") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") .should("have.attr", "role", "navigation"); @@ -969,19 +928,19 @@ describe("Accessibility with Animation Disabled", () => { it("tests acc attrs", () => { cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); - cy.get("#fclAccAttrs") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") .should("not.have.attr", "aria-hidden"); - cy.get("#fclAccAttrs") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--middle") .should("have.attr", "aria-hidden", "true"); @@ -993,47 +952,45 @@ describe("First column closing arrow behavior", () => { cy.viewport(1400, 1080); cy.mount( - -
some content
-
some content
-
some content
+ +
some content
+
some content
+
some content
); }); it("should switch layout and update arrow icon on desktop", () => { - cy.get("#fcl10") + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsStartHiddenMidExpanded"); - cy.get("#fcl10") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-arrow--start") .should("have.attr", "icon", "slim-arrow-right"); - cy.get("#fcl10") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-arrow--start") .click(); - cy.get("#fcl10") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("#fcl10") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-arrow--start") .should("have.attr", "icon", "slim-arrow-left"); - cy.get("#fcl10") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-arrow--start") .click(); - cy.get("#fcl10") - .invoke("prop", "layout") - .should("equal", "ThreeColumnsStartHiddenMidExpanded"); + cy.get("[ui5-flexible-column-layout]") + .should("have.prop", "layout", "ThreeColumnsStartHiddenMidExpanded"); - cy.get("#fcl10") + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-arrow--start") .should("have.attr", "icon", "slim-arrow-right"); diff --git a/packages/fiori/test/specs/FCL.spec.js b/packages/fiori/test/specs/FCL.spec.js deleted file mode 100644 index aa11d2712377..000000000000 --- a/packages/fiori/test/specs/FCL.spec.js +++ /dev/null @@ -1,590 +0,0 @@ -import { assert } from "chai"; - - -describe("FlexibleColumnLayout Behavior", () => { - before(async () => { - await browser.setWindowSize(1000, 1080); - await browser.url(`test/pages/FCL.html?sap-ui-animationMode=none`); - }); - - it("tests Desktop size 1400px", async () => { - // act - await browser.setWindowSize(1400, 1080); - - const layoutChangeCounter = await browser.$("#testLayoutChange"); - const visibleColumns = await browser.$("#fcl3").getAttribute("_visible-columns"); - - // assert - assert.strictEqual(visibleColumns, "3", "3 columns are visible"); - assert.strictEqual(await layoutChangeCounter.getValue(), "1", "The event layout-change is not fired."); - }); - - it("tests Tablet Size 1000px", async () => { - // act - await browser.setWindowSize(1000, 1080); - - const layoutChangeCounter = await browser.$("#testLayoutChange"); - const visibleColumns = await browser.$("#fcl3").getAttribute("_visible-columns"); - - // assert - assert.strictEqual(visibleColumns, "2", "2 columns are visible"); - assert.strictEqual(await layoutChangeCounter.getValue(), "2", "The event layout-change after resizing."); - }); - - it("tests Phone size 500px", async () => { - // act - await browser.setWindowSize(500, 1080); - - const layoutChangeCounter = await browser.$("#testLayoutChange"); - const visibleColumns = await browser.$("#fcl3").getAttribute("_visible-columns"); - - // assert - assert.strictEqual(visibleColumns, "1", "1 columns are visible"); - assert.strictEqual(await layoutChangeCounter.getValue(), "3", "The event layout-change after resizing."); - - // reset - await browser.setWindowSize(1400, 1080); - }); - - it("tests change layout with API", async () => { - const fcl = await browser.$("#fcl1"); - const btn = await browser.$("#switchBtn1"); - - let visibleColumns = await browser.$("#fcl1").getAttribute("_visible-columns"); - - assert.strictEqual(visibleColumns, "2", "2 columns are visible"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "new layout set"); - - // act - await btn.click(); // fcl1.layout = "ThreeColumnsMidExpanded" - - visibleColumns = await browser.$("#fcl1").getAttribute("_visible-columns"); - - // assert - assert.strictEqual(visibleColumns, "3", "3 columns are visible"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - }); - - it("tests change layout upon dragging the separator to a new layout", async () => { - const fcl = await browser.$("#fcl1"); - const layoutChangeCounter = await browser.$("#layoutChangeRes4"); - const separator = await fcl.shadow$(".ui5-fcl-separator-start"); - let counter = parseInt(await layoutChangeCounter.getValue()) || 0; - - // set init state - await fcl.setProperty("layout", "TwoColumnsStartExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "expected initilal layout"); - - // act - await separator.dragAndDrop({ x: -400, y: 0 }); // drag to "TwoColumnsMidExpanded" - - // assert - assert.strictEqual(await layoutChangeCounter.getValue(), `${++counter}`, "The event layout-change fired once."); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsMidExpanded", "new layout set"); - - // act - await separator.dragAndDrop({ x: 400, y: 0 }); // drag to "TwoColumnsStartExpanded" - - // assert - assert.strictEqual(await layoutChangeCounter.getValue(), `${++counter}`, "The event layout-change fired again."); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "new layout set"); - }); -}); - -describe("Layout change by dragging start-separator on desktop", () => { - before(async () => { - await browser.url(`test/pages/FCL.html?sap-ui-animationMode=none`); - }); - - it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", async () => { - const fcl = await browser.$("#fcl1"); - const startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "TwoColumnsStartExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "expected initilal layout"); - - // act - await startSeparator.dragAndDrop({ x: -400, y: 0 }); // expand the mid column - - // assert - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsMidExpanded", "new layout set"); - }); - - it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", async () => { - const fcl = await browser.$("#fcl1"); - const separator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "TwoColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsMidExpanded", "expected initilal layout"); - - // act - await separator.dragAndDrop({ x: 400, y: 0 }); // expand the start column - - // assert - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "new layout set"); - }); - - it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "ThreeColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "expected initilal layout"); - - // act: expand start-column - await startSeparator.dragAndDrop({ x: 300, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - }); - - it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "ThreeColumnsMidExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - - // act - await startSeparator.dragAndDrop({ x: 100, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsStartExpandedEndHidden", "new layout set"); - }); - - it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "ThreeColumnsStartExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsStartExpandedEndHidden", "new layout set"); - - // act - await startSeparator.dragAndDrop({ x: -100, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - }); - - it("allows expand end column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // assert init state - await fcl.setProperty("layout", "ThreeColumnsMidExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "expected initilal layout"); - - // act: expand start-column - await startSeparator.dragAndDrop({ x: -300, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - }); -}); - -describe("Layout change by dragging end-separator on desktop", () => { - before(async () => { - await browser.url(`test/pages/FCL.html?sap-ui-animationMode=none`); - }); - - it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", async () => { - const fcl = await browser.$("#fcl3"), - endSeparator = await fcl.shadow$(".ui5-fcl-separator-end"); - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - - // act: drag to show the end column - await endSeparator.dragAndDrop({ x: -400, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - }); - - it("allows exoand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", async () => { - const fcl = await browser.$("#fcl3"), - endSeparator = await fcl.shadow$(".ui5-fcl-separator-end"); - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - - // act: drag to make the end column wider than mid-column - await endSeparator.dragAndDrop({ x: -400, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsEndExpanded", "new layout set"); - }); -}); - -describe("Layout change by dragging start-separator on tablet", () => { - before(async () => { - await browser.url(`test/pages/FCL.html?sap-ui-animationMode=none`); - }); - - it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", async () => { - await browser.setWindowSize(1000, 1080); // set tablet size - - const fcl = await browser.$("#fcl1"); - const startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "TwoColumnsStartExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "expected initilal layout"); - - // act - await startSeparator.dragAndDrop({ x: -400, y: 0 }); // expand the mid column - - // assert - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsMidExpanded", "new layout set"); - }); - - it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", async () => { - const fcl = await browser.$("#fcl1"); - const separator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "TwoColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsMidExpanded", "expected initilal layout"); - - // act - await separator.dragAndDrop({ x: 400, y: 0 }); // expand the start column - - // assert - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "new layout set"); - }); - - it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "ThreeColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "expected initilal layout"); - - // act: expand start-column - await startSeparator.dragAndDrop({ x: 300, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - }); - - it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "ThreeColumnsMidExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - - // act - await startSeparator.dragAndDrop({ x: 400, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsStartExpandedEndHidden", "new layout set"); - }); - - it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // set init state - await fcl.setProperty("layout", "ThreeColumnsStartExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsStartExpandedEndHidden", "new layout set"); - - // act - await startSeparator.dragAndDrop({ x: -400, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - }); - - it("preserves ThreeColumnsMidExpandedEndHidden when dragging to shrink start column", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"); - - // assert init state - await fcl.setProperty("layout", "ThreeColumnsMidExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "expected initilal layout"); - - // act: expand start-column - await startSeparator.dragAndDrop({ x: -100, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "layout is preserved"); - }); -}); - -describe("Layout change by dragging end-separator on tablet", () => { - before(async () => { - await browser.url(`test/pages/FCL.html?sap-ui-animationMode=none`); - }); - - it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", async () => { - const fcl = await browser.$("#fcl3"), - endSeparator = await fcl.shadow$(".ui5-fcl-separator-end"); - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - - // act: drag to show the end column - await endSeparator.dragAndDrop({ x: -400, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - }); - - it("allows exoand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", async () => { - const fcl = await browser.$("#fcl3"), - endSeparator = await fcl.shadow$(".ui5-fcl-separator-end"); - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - - // act: drag to make the end column wider than mid-column - await endSeparator.dragAndDrop({ x: -300, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsEndExpanded", "new layout set"); - }); -}); - -describe("Preserves column min-width", () => { - before(async () => { - await browser.url(`test/pages/FCL.html?sap-ui-animationMode=none`); - }); - - it("complies with min-width requiremet on smallest desktop", async () => { - await browser.setWindowSize(1400, 1080); - - const fcl = await browser.$("#fcl3"), - smallestDesktopWidth = 1024, - smallestColumnWidth = 248; - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - - // set FCL width to the smallest desktop width - await browser.executeAsync(async (newWidth, done) => { - document.getElementById("fcl3").style.width = `${newWidth}px`; - done(); - }, smallestDesktopWidth); - - const startColumn = await fcl.shadow$(".ui5-fcl-column--start"); - const startColumnWidth = await startColumn.getSize("width"); - const fclWidth = await fcl.getSize("width"); - - // assert - assert.strictEqual(fclWidth, smallestDesktopWidth, "fcl is the smallest desktop width"); - assert.strictEqual(startColumnWidth, smallestColumnWidth, "min-width is respected"); - }); - - it("preserves min-width of begin column", async () => { - await browser.setWindowSize(1400, 1080); - - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"), - smallestColumnWidth = 248; - - // set initial state - await fcl.setProperty("layout", "TwoColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsMidExpanded", "new layout set"); - - const startColumn = await fcl.shadow$(".ui5-fcl-column--start"); - const startColumnWidth = await startColumn.getSize("width"); - const differenceFromSmallestWidth = startColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; // surpass allowed diff with 10px - - // act: drag srink below min-width - await startSeparator.dragAndDrop({ x: -testOffsetX, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsMidExpanded", "the layout is preserved"); - assert.strictEqual(await startColumn.getSize("width"), smallestColumnWidth, "min-width is preserved"); - }); - - it("preserves min-width of mid column in 2-column layout", async () => { - const fcl = await browser.$("#fcl3"), - startSeparator = await fcl.shadow$(".ui5-fcl-separator-start"), - smallestColumnWidth = 248; - - // set initial state - await fcl.setProperty("layout", "TwoColumnsStartExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "new layout set"); - - const midColumn = await fcl.shadow$(".ui5-fcl-column--middle"); - const midColumnWidth = await midColumn.getSize("width"); - const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; // surpass allowed diff with 10px - - // act: drag to srink below min-width - await startSeparator.dragAndDrop({ x: testOffsetX, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "TwoColumnsStartExpanded", "the layout is preserved"); - assert.strictEqual(await midColumn.getSize("width"), smallestColumnWidth, "min-width is preserved"); - }); - - it("preserves min-width of mid column in 3-column layout", async () => { - const fcl = await browser.$("#fcl3"), - endSeparator = await fcl.shadow$(".ui5-fcl-separator-end"), - smallestColumnWidth = 248; - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - - const midColumn = await fcl.shadow$(".ui5-fcl-column--middle"); - const midColumnWidth = await midColumn.getSize("width"); - const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; // surpass allowed diff with 10px - - // act: drag to srink below min-width - await endSeparator.dragAndDrop({ x: -testOffsetX, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsEndExpanded", "the layout is updated"); - assert.strictEqual(await midColumn.getSize("width"), smallestColumnWidth, "min-width is preserved"); - }); - - it("preserves min-width of end column", async () => { - const fcl = await browser.$("#fcl3"), - endSeparator = await fcl.shadow$(".ui5-fcl-separator-end"), - smallestColumnWidth = 248; - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpanded"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - - const endColumn = await fcl.shadow$(".ui5-fcl-column--end"); - const endColumnWidth = await endColumn.getSize("width"); - const differenceFromSmallestWidth = endColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; // surpass allowed diff with 10px - - // act: drag to srink below min-width - await endSeparator.dragAndDrop({ x: testOffsetX, y: 0 }); - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "the layout is preserved"); - assert.strictEqual(await endColumn.getSize("width"), smallestColumnWidth, "min-width is preserved"); - }); - - it("fully reveals the end-column on dragging the end-separator only few pixels", async () => { - const fcl = await browser.$("#fcl3"), - endSeparator = await fcl.shadow$(".ui5-fcl-separator-end"), - endColumn = await fcl.shadow$(".ui5-fcl-column--end"), - smallestColumnWidth = 248; - - // set initial state - await fcl.setProperty("layout", "ThreeColumnsMidExpandedEndHidden"); - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpandedEndHidden", "new layout set"); - - // act: drag to show the end column - await endSeparator.dragAndDrop({ x: -100, y: 0 }); - - // assert - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "new layout set"); - assert.strictEqual(await endColumn.getSize("width"), smallestColumnWidth, "min-width is ensured"); - }); -}); - -describe("ACC", () => { - before(async () => { - await browser.url(`test/pages/FCL.html?sap-ui-animationMode=none`); - }); - - it("tests separator acc attrs", async () => { - const fcl = await browser.$("#fclAcc"); - const startSeparatorDOM = await fcl.shadow$(".ui5-fcl-separator-start"); - const endSeparatorDOM = await fcl.shadow$(".ui5-fcl-separator-end"); - const startSeparatorText = "Start Draggable Splitter"; - const endSeparatorText = "End Draggable Splitter"; - - // assert - assert.strictEqual(await startSeparatorDOM.getAttribute("title"), startSeparatorText, - "Start arrow container has the correct label."); - assert.strictEqual(await endSeparatorDOM.getAttribute("title"), endSeparatorText, - "End arrow container has the correct label."); - }); - - it("tests acc default roles", async () => { - let fcl = await browser.$("#fclAcc"); - - const startColumnDOM = await fcl.shadow$(".ui5-fcl-column--start"); - const middleColumnDOM = await fcl.shadow$(".ui5-fcl-column--middle"); - const endColumnDOM = await fcl.shadow$(".ui5-fcl-column--end"); - - const startSeparatorDOM = await fcl.shadow$(".ui5-fcl-separator-start"); - const endSeparatorDOM = await fcl.shadow$(".ui5-fcl-separator-end"); - - // assert - assert.strictEqual(await startColumnDOM.getAttribute("role"), "region", - "Start column has the correct default role."); - - assert.strictEqual(await middleColumnDOM.getAttribute("role"), "region", - "Middle column has the correct default role."); - - assert.strictEqual(await endColumnDOM.getAttribute("role"), null, - "End column has the correct default role."); // hidden column - - assert.strictEqual(await startSeparatorDOM.getAttribute("role"), "separator", - "Start arrow container has the correct default role."); - - assert.strictEqual(await endSeparatorDOM.getAttribute("role"), "separator", - "End arrow container has the correct default role."); - }); - - it("tests acc custom roles", async () => { - let fcl = await browser.$("#fclAccRoles"); - - const startColumnDOM = await fcl.shadow$(".ui5-fcl-column--start"); - const middleColumnDOM = await fcl.shadow$(".ui5-fcl-column--middle"); - const endColumnDOM = await fcl.shadow$(".ui5-fcl-column--end"); - - const startSeparatorDOM = await fcl.shadow$(".ui5-fcl-separator-start"); - const endSeparatorDOM = await fcl.shadow$(".ui5-fcl-separator-end"); - - // assert - assert.strictEqual(await startColumnDOM.getAttribute("role"), "complementary", - "Start column has the correct custom role."); - - assert.strictEqual(await middleColumnDOM.getAttribute("role"), "main", - "Middle column has the correct custom role."); - - assert.strictEqual(await endColumnDOM.getAttribute("role"), "complementary", - "End column has the correct custom role."); - - assert.strictEqual(await startSeparatorDOM.getAttribute("role"), "navigation", - "Start arrow container has the correct custom role."); - - assert.strictEqual(await endSeparatorDOM.getAttribute("role"), "navigation", - "End arrow container has the correct custom role."); - }); - - it("tests acc attrs", async () => { - let fcl = await browser.$("#fclAccAttrs"); - - const startColumnDOM = await fcl.shadow$(".ui5-fcl-column--start"); - const middleColumnDOM = await fcl.shadow$(".ui5-fcl-column--middle"); - - // assert - assert.strictEqual(await startColumnDOM.getAttribute("aria-hidden"), null, - "Start column is not hidden from the acc tree."); - - assert.strictEqual(await middleColumnDOM.getAttribute("aria-hidden"), "true", - "Middle column is hidden from the acc tree."); - }); -}); - -describe("First column closing arrow behavior", () => { - it("should switch layout and update arrow icon on desktop", async () => { - const fcl = await browser.$("#fcl10"); - const arrowBtn = await fcl.shadow$(".ui5-fcl-arrow--start"); - - await fcl.setProperty("layout", "ThreeColumnsStartHiddenMidExpanded"); - assert.strictEqual(await arrowBtn.getAttribute("icon"), "slim-arrow-right", "Arrow should point right"); - - await arrowBtn.click(); - - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsMidExpanded", "Layout should switch to ThreeColumnsMidExpanded"); - assert.strictEqual(await arrowBtn.getAttribute("icon"), "slim-arrow-left", "Arrow should point left"); - - await arrowBtn.click(); - - assert.strictEqual(await fcl.getProperty("layout"), "ThreeColumnsStartHiddenMidExpanded", "Layout should switch to ThreeColumnsStartHiddenMidExpanded"); - assert.strictEqual(await arrowBtn.getAttribute("icon"), "slim-arrow-right", "Arrow should point right"); - }); -}); \ No newline at end of file From 87c26e9cdfb4659c1c84e36315c520e6a7ffa68b Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Wed, 25 Jun 2025 15:04:52 +0300 Subject: [PATCH 06/11] fix: failing tests --- packages/fiori/cypress/specs/FCL.cy.tsx | 100 ++++++++++++++++++------ 1 file changed, 74 insertions(+), 26 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index e27959a6e955..09911dcd6df9 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -3,10 +3,10 @@ import FlexibleColumnLayout from "../../src/FlexibleColumnLayout.js"; before(() => { cy.wrap({ setAnimationMode }) - .then(api => { - return api.setAnimationMode("none"); - }); - }); + .then(api => { + return api.setAnimationMode("none"); + }); +}); describe("Columns resize", () => { beforeEach(() => { @@ -437,8 +437,17 @@ describe("Layout change by dragging start-separator on tablet", () => { cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(400, 0) + .should("be.visible") + .as("separator"); + + // Separate the drag operations + cy.get("@separator") + .realMouseDown(); + + cy.get("@separator") + .realMouseMove(400, 0); + + cy.get("@separator") .realMouseUp(); cy.get("[ui5-flexible-column-layout]") @@ -455,8 +464,16 @@ describe("Layout change by dragging start-separator on tablet", () => { cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(300, 0) + .should("be.visible") + .as("startSeparator"); + + cy.get("@startSeparator") + .realMouseDown(); + + cy.get("@startSeparator") + .realMouseMove(300, 0); + + cy.get("@startSeparator") .realMouseUp(); cy.get("[ui5-flexible-column-layout]") @@ -505,8 +522,16 @@ describe("Tablet Layout Tests", () => { cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(-400, 0) + .should("be.visible") + .as("separator"); + + cy.get("@separator") + .realMouseDown(); + + cy.get("@separator") + .realMouseMove(-400, 0); + + cy.get("@separator") .realMouseUp(); cy.get("[ui5-flexible-column-layout]") @@ -573,8 +598,16 @@ describe("Layout change by dragging end-separator on tablet", () => { cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") - .realMouseDown() - .realMouseMove(-300, 0) + .should("be.visible") + .as("endSeparator"); + + cy.get("@endSeparator") + .realMouseDown(); + + cy.get("@endSeparator") + .realMouseMove(-300, 0); + + cy.get("@endSeparator") .realMouseUp(); cy.get("[ui5-flexible-column-layout]") @@ -674,6 +707,12 @@ describe("Preserves column min-width", () => { cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-separator-start") + .should("be.visible") + .as("separator"); + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--middle") @@ -682,11 +721,13 @@ describe("Preserves column min-width", () => { const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; const testOffsetX = differenceFromSmallestWidth + 10; - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-separator-start") - .realMouseDown() - .realMouseMove(testOffsetX, 0) + cy.get("@separator") + .realMouseDown(); + + cy.get("@separator") + .realMouseMove(testOffsetX, 0); + + cy.get("@separator") .realMouseUp(); cy.get("[ui5-flexible-column-layout]") @@ -695,9 +736,8 @@ describe("Preserves column min-width", () => { cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--middle") - .then($finalMidColumn => { + .should($finalMidColumn => { const finalWidth = $finalMidColumn.width(); - expect(finalWidth).to.be.closeTo(smallestColumnWidth, 5); }); }); @@ -781,23 +821,31 @@ describe("Preserves column min-width", () => { it("fully reveals the end-column on dragging the end-separator only few pixels", () => { const smallestColumnWidth = 248; - + cy.get("[ui5-flexible-column-layout]") .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - + cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") - .realMouseDown() - .realMouseMove(-100, 0) + .should("be.visible") + .as("endSeparator"); + + cy.get("@endSeparator") + .realMouseDown(); + + cy.get("@endSeparator") + .realMouseMove(-100, 0); + + cy.get("@endSeparator") .realMouseUp(); - + cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--end") From 4b34fcd95172b5ffd1dbfe6283b4087448dc39dd Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Mon, 30 Jun 2025 10:39:21 +0300 Subject: [PATCH 07/11] refactor: change the realMouseMove --- packages/fiori/cypress/specs/FCL.cy.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 09911dcd6df9..319e42f4e4fe 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -388,7 +388,7 @@ describe("Layout change by dragging end-separator on desktop", () => { .shadow() .find(".ui5-fcl-separator-end") .realMouseDown() - .realMouseMove(-400, 0) + .realMouseMove(-600, 0) .realMouseUp(); cy.get("[ui5-flexible-column-layout]") @@ -445,7 +445,7 @@ describe("Layout change by dragging start-separator on tablet", () => { .realMouseDown(); cy.get("@separator") - .realMouseMove(400, 0); + .realMouseMove(600, 0) cy.get("@separator") .realMouseUp(); @@ -529,7 +529,7 @@ describe("Tablet Layout Tests", () => { .realMouseDown(); cy.get("@separator") - .realMouseMove(-400, 0); + .realMouseMove(-600, 0) cy.get("@separator") .realMouseUp(); @@ -605,7 +605,7 @@ describe("Layout change by dragging end-separator on tablet", () => { .realMouseDown(); cy.get("@endSeparator") - .realMouseMove(-300, 0); + .realMouseMove(-500, 0) cy.get("@endSeparator") .realMouseUp(); @@ -838,7 +838,7 @@ describe("Preserves column min-width", () => { .realMouseDown(); cy.get("@endSeparator") - .realMouseMove(-100, 0); + .realMouseMove(-150, 0) cy.get("@endSeparator") .realMouseUp(); From ee17fc9a5a7438728322e8c6d23ff9cf9395c5d3 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Mon, 30 Jun 2025 11:44:08 +0300 Subject: [PATCH 08/11] refactor: change the viewport --- packages/fiori/cypress/specs/FCL.cy.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 319e42f4e4fe..ffa10d518c5c 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -348,7 +348,7 @@ describe("Start Column Expansion Test", () => { describe("Layout change by dragging end-separator on desktop", () => { beforeEach(() => { - cy.viewport(1600, 1080); + cy.viewport(1400, 1080); cy.mount( @@ -388,7 +388,7 @@ describe("Layout change by dragging end-separator on desktop", () => { .shadow() .find(".ui5-fcl-separator-end") .realMouseDown() - .realMouseMove(-600, 0) + .realMouseMove(-400, 0) .realMouseUp(); cy.get("[ui5-flexible-column-layout]") @@ -398,7 +398,7 @@ describe("Layout change by dragging end-separator on desktop", () => { describe("Layout change by dragging start-separator on tablet", () => { beforeEach(() => { - cy.viewport(1000, 1080); + cy.viewport(800, 1080); cy.mount( @@ -445,7 +445,7 @@ describe("Layout change by dragging start-separator on tablet", () => { .realMouseDown(); cy.get("@separator") - .realMouseMove(600, 0) + .realMouseMove(400, 0); cy.get("@separator") .realMouseUp(); @@ -483,7 +483,7 @@ describe("Layout change by dragging start-separator on tablet", () => { describe("Tablet Layout Tests", () => { beforeEach(() => { - cy.viewport(1000, 1080); + cy.viewport(800, 1080); cy.mount( @@ -529,7 +529,7 @@ describe("Tablet Layout Tests", () => { .realMouseDown(); cy.get("@separator") - .realMouseMove(-600, 0) + .realMouseMove(-400, 0); cy.get("@separator") .realMouseUp(); @@ -559,7 +559,7 @@ describe("Tablet Layout Tests", () => { describe("Layout change by dragging end-separator on tablet", () => { beforeEach(() => { - cy.viewport(1000, 1080); + cy.viewport(800, 1080); cy.mount( @@ -605,7 +605,7 @@ describe("Layout change by dragging end-separator on tablet", () => { .realMouseDown(); cy.get("@endSeparator") - .realMouseMove(-500, 0) + .realMouseMove(-300, 0); cy.get("@endSeparator") .realMouseUp(); @@ -838,7 +838,7 @@ describe("Preserves column min-width", () => { .realMouseDown(); cy.get("@endSeparator") - .realMouseMove(-150, 0) + .realMouseMove(-100, 0); cy.get("@endSeparator") .realMouseUp(); From fd24a42f5a9818f6239b736f4cdb7b0ac31f3409 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Tue, 22 Jul 2025 11:29:19 +0300 Subject: [PATCH 09/11] chore: optimize tests --- packages/fiori/cypress/specs/FCL.cy.tsx | 855 ++++++++++++------------ 1 file changed, 446 insertions(+), 409 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index ffa10d518c5c..717dc53ff55a 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -181,89 +181,159 @@ describe("FlexibleColumnLayout Behavior", () => { }); }); -describe("Layout API Tests", () => { - beforeEach(() => { - cy.viewport(1600, 1080); +describe("First column closing arrow behavior", () => { + it("should switch layout and update arrow icon on desktop", () => { + cy.viewport(1400, 1080) cy.mount( - +
some content
some content
some content
); - }); - it("tests change layout with API", () => { cy.get("[ui5-flexible-column-layout]") - .should("have.attr", "_visible-columns", "2"); + .shadow() + .find(".ui5-fcl-arrow--start") + .should("have.attr", "icon", "slim-arrow-right"); cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsStartExpanded"); + .shadow() + .find(".ui5-fcl-arrow--start") + .click(); cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); cy.get("[ui5-flexible-column-layout]") - .should("have.attr", "_visible-columns", "3"); + .shadow() + .find(".ui5-fcl-arrow--start") + .should("have.attr", "icon", "slim-arrow-left"); cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - }); + .shadow() + .find(".ui5-fcl-arrow--start") + .click(); - it("tests change layout upon dragging the separator to a new layout", () => { cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "TwoColumnsStartExpanded"); + .should("have.prop", "layout", "ThreeColumnsStartHiddenMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .shadow() + .find(".ui5-fcl-arrow--start") + .should("have.attr", "icon", "slim-arrow-right"); + }); +}); + +describe("Layout Change API", () => { + it("tests change layout with API", () => { + cy.mount( + +
Column 1 content
+
Column 2 content
+
Column 3 content
+
+ ); cy.get("[ui5-flexible-column-layout]") + .should("have.attr", "_visible-columns", "2") .should("have.prop", "layout", "TwoColumnsStartExpanded"); cy.get("[ui5-flexible-column-layout]") + .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("[ui5-flexible-column-layout]") + .should("have.attr", "_visible-columns", "3") + .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + }); + + it("changes layout when dragging separator", () => { + cy.mount( + +
Start
+
Mid
+
End
+
+ ); + + cy.get("[ui5-flexible-column-layout]").then(($fcl) => { + const fcl = $fcl[0]; + fcl.addEventListener("layout-change", cy.stub().as("layoutChanged")); + }); + + cy.get("[ui5-flexible-column-layout]").as("fcl"); + + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") + .should("be.visible") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsMidExpanded"); + cy.get("@layoutChanged").should("have.been.calledOnce"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsMidExpanded"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") .realMouseDown() .realMouseMove(400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsStartExpanded"); + cy.get("@layoutChanged").should("have.been.calledTwice"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsStartExpanded"); }); }); describe("Column Expansion Tests", () => { beforeEach(() => { cy.viewport(1600, 1080); + }); + it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { cy.mount( - -
some content
-
some content
-
some content
+ +
Start
+
Mid
); - }); - it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsMidExpanded"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsStartExpanded"); + + cy.get("@fcl") + .shadow() + .find(".ui5-fcl-separator-start") + .should("be.visible") + .realMouseDown() + .realMouseMove(-400, 0) + .realMouseUp(); + + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsMidExpanded"); }); it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + cy.mount( + +
some content
+
some content
+
some content
+
+ ); cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "ThreeColumnsMidExpanded"); @@ -279,19 +349,16 @@ describe("Column Expansion Tests", () => { describe("Start Column Expansion Test", () => { beforeEach(() => { cy.viewport(1600, 1080); + }); + it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { cy.mount( - +
some content
some content
some content
); - }); - - it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "TwoColumnsMidExpanded"); cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "TwoColumnsMidExpanded"); @@ -304,8 +371,13 @@ describe("Start Column Expansion Test", () => { }); it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.mount( + +
some content
+
some content
+
some content
+
+ ); cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); @@ -318,8 +390,13 @@ describe("Start Column Expansion Test", () => { }); it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + cy.mount( + +
some content
+
some content
+
some content
+
+ ); cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); @@ -332,8 +409,13 @@ describe("Start Column Expansion Test", () => { }); it("allows expand end column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.mount( + +
some content
+
some content
+
some content
+
+ ); cy.get("[ui5-flexible-column-layout]") .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); @@ -347,547 +429,544 @@ describe("Start Column Expansion Test", () => { }); describe("Layout change by dragging end-separator on desktop", () => { - beforeEach(() => { - cy.viewport(1400, 1080); - + it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { cy.mount( - -
some content
-
some content
-
some content
+ +
Start
+
Mid
+
End
); - }); - it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-end") + .should("be.visible") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); }); it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + cy.mount( + +
Start
+
Mid
+
End
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-end") + .should("be.visible") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsEndExpanded"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsEndExpanded"); }); }); describe("Layout change by dragging start-separator on tablet", () => { beforeEach(() => { - cy.viewport(800, 1080); + cy.viewport(1000, 1080); + }); + it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { cy.mount( - -
some content
-
some content
-
some content
+ +
Start
+
Mid
); - }); - it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsStartExpanded"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsStartExpanded"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") + .should("be.visible") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsMidExpanded"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsMidExpanded"); }); it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "TwoColumnsMidExpanded"); + cy.mount( + +
Start
+
Mid
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsMidExpanded"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") .should("be.visible") - .as("separator"); - - // Separate the drag operations - cy.get("@separator") - .realMouseDown(); - - cy.get("@separator") - .realMouseMove(400, 0); - - cy.get("@separator") + .realMouseDown() + .realMouseMove(400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsStartExpanded"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsStartExpanded"); }); it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + cy.mount( + +
Start
+
Mid
+
End
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") .should("be.visible") - .as("startSeparator"); - - cy.get("@startSeparator") - .realMouseDown(); - - cy.get("@startSeparator") - .realMouseMove(300, 0); - - cy.get("@startSeparator") + .realMouseDown() + .realMouseMove(300, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); }); -}); - -describe("Tablet Layout Tests", () => { - beforeEach(() => { - cy.viewport(800, 1080); + it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { cy.mount( - -
some content
-
some content
-
some content
+ +
Start
+
Mid
+
End
); - }); - it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") + .should("be.visible") .realMouseDown() .realMouseMove(400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); }); it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + cy.mount( + +
Start
+
Mid
+
End
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsStartExpandedEndHidden"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") .should("be.visible") - .as("separator"); - - cy.get("@separator") - .realMouseDown(); - - cy.get("@separator") - .realMouseMove(-400, 0); - - cy.get("@separator") + .realMouseDown() + .realMouseMove(-400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); }); - it("preserves ThreeColumnsMidExpandedEndHidden when dragging to shrink start column", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + it("preserves ThreeColumnsMidExpandedEndHidden on tiny start column drag", () => { + cy.mount( + +
Start
+
Mid
+
End
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") + .should("be.visible") .realMouseDown() .realMouseMove(-100, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); }); }); describe("Layout change by dragging end-separator on tablet", () => { beforeEach(() => { - cy.viewport(800, 1080); + cy.viewport(1000, 1080); + }); + it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { cy.mount( - -
some content
-
some content
-
some content
+ +
Start
+
Mid
+
End
); - }); - it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-end") + .should("be.visible") .realMouseDown() .realMouseMove(-400, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); }); it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + cy.mount( + +
Start
+
Mid
+
End
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-end") .should("be.visible") - .as("endSeparator"); - - cy.get("@endSeparator") - .realMouseDown(); - - cy.get("@endSeparator") - .realMouseMove(-300, 0); - - cy.get("@endSeparator") + .realMouseDown() + .realMouseMove(-300, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsEndExpanded"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsEndExpanded"); }); }); describe("Preserves column min-width", () => { beforeEach(() => { cy.viewport(1400, 1080); - - cy.mount( - -
some content
-
some content
-
some content
-
- ); }); it("complies with min-width requirement on smallest desktop", () => { const smallestDesktopWidth = 1024; const smallestColumnWidth = 248; - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + cy.mount( + +
Start
+
Mid
+
End
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .invoke("css", "width", `${smallestDesktopWidth}px`); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("[ui5-flexible-column-layout]") - .should("have.css", "width", `${smallestDesktopWidth}px`); + cy.get("@fcl").should("have.prop", "offsetWidth", smallestDesktopWidth); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--start") - .should($startColumn => { - const width = $startColumn.width(); - expect(width).to.equal(smallestColumnWidth); - }); + .should("have.prop", "offsetWidth", smallestColumnWidth); }); it("preserves min-width of begin column", () => { const smallestColumnWidth = 248; + cy.mount( + +
Start
+
Mid
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "TwoColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsMidExpanded"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsMidExpanded"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--start") - .then($startColumn => { - const initialWidth = $startColumn.width(); - - const differenceFromSmallestWidth = initialWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 50; + .invoke("width") + .then((initialStartWidth) => { + const differenceFromMin = initialStartWidth - smallestColumnWidth; + const testOffsetX = differenceFromMin + 10; - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-start") + .should("be.visible") .realMouseDown() .realMouseMove(-testOffsetX, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-column--start") - .then($finalColumn => { - const finalWidth = $finalColumn.width(); - }); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsMidExpanded"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsMidExpanded"); - - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--start") - .should($startColumn => { - const finalWidth = $startColumn.width(); - expect(finalWidth).to.be.at.least(smallestColumnWidth); - }); + .should("have.prop", "offsetWidth", smallestColumnWidth); }); }); it("preserves min-width of mid column in 2-column layout", () => { const smallestColumnWidth = 248; + cy.mount( + +
Start
+
Mid
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "TwoColumnsStartExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsStartExpanded"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsStartExpanded"); - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-separator-start") - .should("be.visible") - .as("separator"); - - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--middle") - .then($midColumn => { - const midColumnWidth = $midColumn.width(); - const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; + .invoke("width") + .then((initialMidWidth) => { + const differenceFromMin = initialMidWidth - smallestColumnWidth; + const testOffsetX = differenceFromMin + 10; - cy.get("@separator") - .realMouseDown(); - - cy.get("@separator") - .realMouseMove(testOffsetX, 0); - - cy.get("@separator") + cy.get("@fcl") + .shadow() + .find(".ui5-fcl-separator-start") + .should("be.visible") + .realMouseDown() + .realMouseMove(testOffsetX, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "TwoColumnsStartExpanded"); + cy.get("@fcl").should("have.prop", "layout", "TwoColumnsStartExpanded"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--middle") - .should($finalMidColumn => { - const finalWidth = $finalMidColumn.width(); - expect(finalWidth).to.be.closeTo(smallestColumnWidth, 5); - }); + .should("have.prop", "offsetWidth", smallestColumnWidth); }); }); it("preserves min-width of mid column in 3-column layout", () => { const smallestColumnWidth = 248; - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + cy.mount( + +
Start
+
Mid
+
End
+
+ ); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--middle") - .then($midColumn => { - const midColumnWidth = $midColumn.width(); - const differenceFromSmallestWidth = midColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; + .invoke("width") + .then((initialMidWidth) => { + const differenceFromMin = initialMidWidth - smallestColumnWidth; + const testOffsetX = differenceFromMin + 10; - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-end") + .should("be.visible") .realMouseDown() .realMouseMove(-testOffsetX, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsEndExpanded"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsEndExpanded"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--middle") - .then($finalMidColumn => { - const finalWidth = $finalMidColumn.width(); - - expect(finalWidth).to.be.closeTo(smallestColumnWidth, 10); - }); + .should("have.prop", "offsetWidth") + .and("be.closeTo", smallestColumnWidth, 1); }); }); it("preserves min-width of end column", () => { + cy.mount( + +
Start
+
Mid
+
End
+
+ ); + const smallestColumnWidth = 248; - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("[ui5-flexible-column-layout]").as("fcl"); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") - .then($endColumn => { - const endColumnWidth = $endColumn.width(); - const differenceFromSmallestWidth = endColumnWidth - smallestColumnWidth; - const testOffsetX = differenceFromSmallestWidth + 10; + .invoke("width") + .then((endColumnWidth) => { + const testOffsetX = endColumnWidth - smallestColumnWidth + 10; - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-end") + .should("be.visible") .realMouseDown() .realMouseMove(testOffsetX, 0) .realMouseUp(); - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); - cy.get("[ui5-flexible-column-layout]") + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") - .then($finalEndColumn => { - const finalWidth = $finalEndColumn.width(); - - expect(finalWidth).to.be.closeTo(smallestColumnWidth, 10); - }); + .should("have.prop", "offsetWidth") + .and("be.closeTo", smallestColumnWidth, 1); }); }); it("fully reveals the end-column on dragging the end-separator only few pixels", () => { + cy.mount( + +
Start
+
Mid
+
End
+
+ ); + const smallestColumnWidth = 248; - - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); - - cy.get("[ui5-flexible-column-layout]") + + cy.get("[ui5-flexible-column-layout]").as("fcl"); + + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpandedEndHidden"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-separator-end") .should("be.visible") - .as("endSeparator"); - - cy.get("@endSeparator") - .realMouseDown(); - - cy.get("@endSeparator") - .realMouseMove(-100, 0); - - cy.get("@endSeparator") + .realMouseDown() + .realMouseMove(-100, 0) .realMouseUp(); - - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - - cy.get("[ui5-flexible-column-layout]") + + cy.get("@fcl").should("have.prop", "layout", "ThreeColumnsMidExpanded"); + + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") - .should($endColumn => { - const width = $endColumn.width(); - expect(width).to.be.closeTo(smallestColumnWidth, 10); - }); + .should("have.prop", "offsetWidth") + .and("be.closeTo", smallestColumnWidth, 1); }); }); describe("Accessibility with Animation Disabled", () => { - beforeEach(() => { + it("tests separator acc attrs", () => { cy.mount( - +
some content
some content
some content
); - cy.get("[ui5-flexible-column-layout]").then(($fcl) => { - ($fcl[0] as any).accessibilityAttributes = { - startColumn: { - name: "Products list", - }, - midColumn: { - name: "Product information", - }, - endColumn: { - name: "Product detailed information", - }, - startSeparator: { - name: "Start Draggable Splitter", - }, - endSeparator: { - name: "End Draggable Splitter", - }, - }; - }); - }); - - it("tests separator acc attrs", () => { const startSeparatorText = "Start Draggable Splitter"; const endSeparatorText = "End Draggable Splitter"; @@ -903,6 +982,14 @@ describe("Accessibility with Animation Disabled", () => { }); it("tests acc default roles", () => { + cy.mount( + +
some content
+
some content
+
some content
+
+ ); + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") @@ -931,23 +1018,23 @@ describe("Accessibility with Animation Disabled", () => { it("tests acc custom roles", () => { cy.mount( - +
some content
some content
some content
); - cy.get("[ui5-flexible-column-layout]").then(($fcl) => { - ($fcl[0] as any).accessibilityAttributes = { - startColumn: { role: "complementary" }, - startSeparator: { role: "navigation" }, - midColumn: { role: "main" }, - endSeparator: { role: "navigation" }, - endColumn: { role: "complementary" }, - }; - }); - cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--start") @@ -966,12 +1053,12 @@ describe("Accessibility with Animation Disabled", () => { cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-start") - .should("have.attr", "role", "navigation"); + .should("have.attr", "role", "region"); cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-separator-end") - .should("have.attr", "role", "navigation"); + .should("have.attr", "role", "region"); }); it("tests acc attrs", () => { @@ -993,54 +1080,4 @@ describe("Accessibility with Animation Disabled", () => { .find(".ui5-fcl-column--middle") .should("have.attr", "aria-hidden", "true"); }); -}); - -describe("First column closing arrow behavior", () => { - beforeEach(() => { - cy.viewport(1400, 1080); - - cy.mount( - -
some content
-
some content
-
some content
-
- ); - }); - - it("should switch layout and update arrow icon on desktop", () => { - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsStartHiddenMidExpanded"); - - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-arrow--start") - .should("have.attr", "icon", "slim-arrow-right"); - - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-arrow--start") - .click(); - - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsMidExpanded"); - - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-arrow--start") - .should("have.attr", "icon", "slim-arrow-left"); - - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-arrow--start") - .click(); - - cy.get("[ui5-flexible-column-layout]") - .should("have.prop", "layout", "ThreeColumnsStartHiddenMidExpanded"); - - cy.get("[ui5-flexible-column-layout]") - .shadow() - .find(".ui5-fcl-arrow--start") - .should("have.attr", "icon", "slim-arrow-right"); - }); }); \ No newline at end of file From eee6eff631676e51a67a48d9100e1e0cad542fb5 Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Tue, 22 Jul 2025 13:29:17 +0300 Subject: [PATCH 10/11] chore: return mistakenly deleted test --- packages/fiori/cypress/specs/FCL.cy.tsx | 56 +++++++++++++++++++++---- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 717dc53ff55a..79e14a09728e 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -1,15 +1,12 @@ import { setAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationMode.js"; import FlexibleColumnLayout from "../../src/FlexibleColumnLayout.js"; - -before(() => { - cy.wrap({ setAnimationMode }) - .then(api => { - return api.setAnimationMode("none"); - }); -}); +import AnimationMode from "@ui5/webcomponents-base/dist/types/AnimationMode.js"; describe("Columns resize", () => { beforeEach(() => { + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.None); + cy.mount(
some content
@@ -81,6 +78,44 @@ describe("Columns resize", () => { expect($el).to.have.class("ui5-fcl-column--hidden"); }); }); + + it("keeps hidden class on columns after rerendering", () => { + // Get a reference to the FCL first + cy.get("[ui5-flexible-column-layout]") + .as("fcl"); + + // Verify initial state + cy.get("@fcl") + .shadow() + .find(".ui5-fcl-column--end") + .should("have.class", "ui5-fcl-column--hidden"); + + // Change animation mode to "full" + cy.wrap({ setAnimationMode }) + .invoke("setAnimationMode", AnimationMode.Full); + + // Verify the end column has the animation class after changing animation mode + cy.get("@fcl") + .shadow() + .find(".ui5-fcl-column--end") + .should("have.class", "ui5-fcl-column-animation"); + + // Verify the end column still has the hidden class after rerendering + cy.get("@fcl") + .shadow() + .find(".ui5-fcl-column--end") + .should("have.class", "ui5-fcl-column--hidden"); + + // Change height by 10px + cy.get("@fcl") + .invoke("css", "height", "310px"); + + // Verify the end column still has the hidden class after height change + cy.get("@fcl") + .shadow() + .find(".ui5-fcl-column--end") + .should("have.class", "ui5-fcl-column--hidden"); + }); }); describe("ACC", () => { @@ -134,6 +169,13 @@ describe("ACC", () => { }); }); +before(() => { + cy.wrap({ setAnimationMode }) + .then(api => { + return api.setAnimationMode("none"); + }); +}); + describe("FlexibleColumnLayout Behavior", () => { it("tests Desktop size 1400px", () => { cy.viewport(1400, 1080); From 304254cfe0d9d8cda9d3a7f1265a5a41217a1fdf Mon Sep 17 00:00:00 2001 From: Nikola Anachkov Date: Mon, 11 Aug 2025 19:29:45 +0300 Subject: [PATCH 11/11] chore: address comments --- packages/fiori/cypress/specs/FCL.cy.tsx | 227 ++++++++++++------------ 1 file changed, 109 insertions(+), 118 deletions(-) diff --git a/packages/fiori/cypress/specs/FCL.cy.tsx b/packages/fiori/cypress/specs/FCL.cy.tsx index 79e14a09728e..8fd0b5f4de47 100644 --- a/packages/fiori/cypress/specs/FCL.cy.tsx +++ b/packages/fiori/cypress/specs/FCL.cy.tsx @@ -1,21 +1,22 @@ import { setAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationMode.js"; import FlexibleColumnLayout from "../../src/FlexibleColumnLayout.js"; import AnimationMode from "@ui5/webcomponents-base/dist/types/AnimationMode.js"; +import Button from "@ui5/webcomponents/dist/Button.js"; describe("Columns resize", () => { beforeEach(() => { cy.wrap({ setAnimationMode }) .invoke("setAnimationMode", AnimationMode.None); + }); + it("separator drag'n'drop", () => { cy.mount( - +
some content
some content
); - }); - it("separator drag'n'drop", () => { let oldWidthFirstCol: number; let widthAfterMove: number; @@ -71,6 +72,13 @@ describe("Columns resize", () => { }); it("sets dedicated class to hidden columns", () => { + cy.mount( + +
some content
+
some content
+
+ ); + cy.get("[ui5-flexible-column-layout]") .shadow() .find(".ui5-fcl-column--end") @@ -80,41 +88,42 @@ describe("Columns resize", () => { }); it("keeps hidden class on columns after rerendering", () => { - // Get a reference to the FCL first + cy.mount( + +
some content
+
some content
+
+ ); + cy.get("[ui5-flexible-column-layout]") .as("fcl"); - - // Verify initial state + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") .should("have.class", "ui5-fcl-column--hidden"); - // Change animation mode to "full" cy.wrap({ setAnimationMode }) .invoke("setAnimationMode", AnimationMode.Full); - // Verify the end column has the animation class after changing animation mode - cy.get("@fcl") - .shadow() - .find(".ui5-fcl-column--end") - .should("have.class", "ui5-fcl-column-animation"); + cy.wait(100); - // Verify the end column still has the hidden class after rerendering cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") - .should("have.class", "ui5-fcl-column--hidden"); + .should("have.class", "ui5-fcl-column-animation") + .and("not.have.class", "ui5-fcl-column--hidden"); - // Change height by 10px cy.get("@fcl") .invoke("css", "height", "310px"); - // Verify the end column still has the hidden class after height change + cy.wait(50); + cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") - .should("have.class", "ui5-fcl-column--hidden"); + .should("have.class", "ui5-fcl-column-animation") + .and("not.have.class", "ui5-fcl-column--hidden"); }); }); @@ -147,7 +156,7 @@ describe("ACC", () => { it("verifies that aria-valuenow is set on separators", () => { cy.mount( - +
some content
some content
some content
@@ -181,7 +190,7 @@ describe("FlexibleColumnLayout Behavior", () => { cy.viewport(1400, 1080); cy.mount( - +
some content
some content
some content
@@ -189,14 +198,21 @@ describe("FlexibleColumnLayout Behavior", () => { ); cy.get("[ui5-flexible-column-layout]") + .as("fcl") + .then($fcl => { + $fcl.get(0).addEventListener("layout-change", cy.stub().as("layoutChangeStub")); + }); + + cy.get("@fcl") .should("have.attr", "_visible-columns", "3"); + + cy.get("@layoutChangeStub") + .should("not.have.been.called"); }); it("tests Tablet Size 1000px", () => { - cy.viewport(1000, 1080); - cy.mount( - +
some content
some content
some content
@@ -204,14 +220,23 @@ describe("FlexibleColumnLayout Behavior", () => { ); cy.get("[ui5-flexible-column-layout]") + .as("fcl") + .then($fcl => { + $fcl.get(0).addEventListener("layout-change", cy.stub().as("layoutChangeStub")); + }); + + cy.viewport(1000, 1080); + + cy.get("@fcl") .should("have.attr", "_visible-columns", "2"); + + cy.get("@layoutChangeStub") + .should("have.been.calledOnce"); }); it("tests Phone size 500px", () => { - cy.viewport(320, 1080); - cy.mount( - +
some content
some content
some content
@@ -219,14 +244,23 @@ describe("FlexibleColumnLayout Behavior", () => { ); cy.get("[ui5-flexible-column-layout]") + .as("fcl") + .then($fcl => { + $fcl.get(0).addEventListener("layout-change", cy.stub().as("layoutChangeStub")); + }); + + cy.viewport(500, 1080); + + cy.get("@fcl") .should("have.attr", "_visible-columns", "1"); + + cy.get("@layoutChangeStub") + .should("have.been.calledOnce"); }); }); describe("First column closing arrow behavior", () => { it("should switch layout and update arrow icon on desktop", () => { - cy.viewport(1400, 1080) - cy.mount(
some content
@@ -271,23 +305,32 @@ describe("First column closing arrow behavior", () => { describe("Layout Change API", () => { it("tests change layout with API", () => { cy.mount( - -
Column 1 content
-
Column 2 content
-
Column 3 content
-
+ <> + + +
Column 1 content
+
Column 2 content
+
Column 3 content
+
+ ); - + + cy.get("[data-testid='switchBtn']") + .then($btn => { + $btn.get(0).addEventListener("click", () => { + const fcl = document.querySelector("[ui5-flexible-column-layout]") as any; + fcl.layout = "ThreeColumnsMidExpanded"; + }); + }); + cy.get("[ui5-flexible-column-layout]") .should("have.attr", "_visible-columns", "2") .should("have.prop", "layout", "TwoColumnsStartExpanded"); - - cy.get("[ui5-flexible-column-layout]") - .invoke("prop", "layout", "ThreeColumnsMidExpanded"); - + + cy.get("[data-testid='switchBtn']").click(); + cy.get("[ui5-flexible-column-layout]") .should("have.attr", "_visible-columns", "3") .should("have.prop", "layout", "ThreeColumnsMidExpanded"); @@ -296,9 +339,7 @@ describe("Layout Change API", () => { it("changes layout when dragging separator", () => { cy.mount( + layout="TwoColumnsStartExpanded">
Start
Mid
End
@@ -338,15 +379,10 @@ describe("Layout Change API", () => { }); describe("Column Expansion Tests", () => { - beforeEach(() => { - cy.viewport(1600, 1080); - }); - it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { cy.mount(
Start
Mid
@@ -370,7 +406,7 @@ describe("Column Expansion Tests", () => { it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { cy.mount( - +
some content
some content
some content
@@ -389,13 +425,9 @@ describe("Column Expansion Tests", () => { }); describe("Start Column Expansion Test", () => { - beforeEach(() => { - cy.viewport(1600, 1080); - }); - it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { cy.mount( - +
some content
some content
some content
@@ -414,7 +446,7 @@ describe("Start Column Expansion Test", () => { it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { cy.mount( - +
some content
some content
some content
@@ -433,7 +465,7 @@ describe("Start Column Expansion Test", () => { it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { cy.mount( - +
some content
some content
some content
@@ -452,7 +484,7 @@ describe("Start Column Expansion Test", () => { it("allows expand end column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { cy.mount( - +
some content
some content
some content
@@ -475,7 +507,6 @@ describe("Layout change by dragging end-separator on desktop", () => { cy.mount(
Start
Mid
@@ -501,9 +532,7 @@ describe("Layout change by dragging end-separator on desktop", () => { it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { cy.mount( + layout="ThreeColumnsMidExpanded">
Start
Mid
End
@@ -527,16 +556,10 @@ describe("Layout change by dragging end-separator on desktop", () => { }); describe("Layout change by dragging start-separator on tablet", () => { - beforeEach(() => { - cy.viewport(1000, 1080); - }); - it("allows expand mid column from TwoColumnsStartExpanded to TwoColumnsMidExpanded", () => { cy.mount( + layout="TwoColumnsStartExpanded">
Start
Mid
@@ -560,9 +583,7 @@ describe("Layout change by dragging start-separator on tablet", () => { it("allows expand start column from TwoColumnsMidExpanded to TwoColumnsStartExpanded", () => { cy.mount( + layout="TwoColumnsMidExpanded">
Start
Mid
@@ -586,9 +607,7 @@ describe("Layout change by dragging start-separator on tablet", () => { it("allows hide end column from ThreeColumnsMidExpanded to ThreeColumnsMidExpandedEndHidden", () => { cy.mount( + layout="ThreeColumnsMidExpanded">
Start
Mid
End
@@ -613,9 +632,7 @@ describe("Layout change by dragging start-separator on tablet", () => { it("allows expand start column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsStartExpandedEndHidden", () => { cy.mount( + layout="ThreeColumnsMidExpandedEndHidden">
Start
Mid
End
@@ -640,9 +657,7 @@ describe("Layout change by dragging start-separator on tablet", () => { it("allows expand mid column from ThreeColumnsStartExpandedEndHidden to ThreeColumnsMidExpandedEndHidden", () => { cy.mount( + layout="ThreeColumnsStartExpandedEndHidden">
Start
Mid
End
@@ -665,11 +680,11 @@ describe("Layout change by dragging start-separator on tablet", () => { }); it("preserves ThreeColumnsMidExpandedEndHidden on tiny start column drag", () => { + cy.viewport(1000, 1080); + cy.mount( + layout="ThreeColumnsMidExpandedEndHidden">
Start
Mid
End
@@ -700,9 +715,7 @@ describe("Layout change by dragging end-separator on tablet", () => { it("allows expand end-column from ThreeColumnsMidExpandedEndHidden to ThreeColumnsMidExpanded", () => { cy.mount( + layout="ThreeColumnsMidExpandedEndHidden">
Start
Mid
End
@@ -727,9 +740,7 @@ describe("Layout change by dragging end-separator on tablet", () => { it("allows expand end-column from ThreeColumnsMidExpanded to ThreeColumnsEndExpanded", () => { cy.mount( + layout="ThreeColumnsMidExpanded">
Start
Mid
End
@@ -753,10 +764,6 @@ describe("Layout change by dragging end-separator on tablet", () => { }); describe("Preserves column min-width", () => { - beforeEach(() => { - cy.viewport(1400, 1080); - }); - it("complies with min-width requirement on smallest desktop", () => { const smallestDesktopWidth = 1024; const smallestColumnWidth = 248; @@ -788,9 +795,7 @@ describe("Preserves column min-width", () => { const smallestColumnWidth = 248; cy.mount( + layout="TwoColumnsMidExpanded">
Start
Mid
@@ -829,9 +834,7 @@ describe("Preserves column min-width", () => { const smallestColumnWidth = 248; cy.mount( + layout="TwoColumnsStartExpanded">
Start
Mid
@@ -871,9 +874,7 @@ describe("Preserves column min-width", () => { cy.mount( + layout="ThreeColumnsMidExpanded">
Start
Mid
End
@@ -905,8 +906,7 @@ describe("Preserves column min-width", () => { cy.get("@fcl") .shadow() .find(".ui5-fcl-column--middle") - .should("have.prop", "offsetWidth") - .and("be.closeTo", smallestColumnWidth, 1); + .should("have.prop", "offsetWidth", smallestColumnWidth); }); }); @@ -914,7 +914,6 @@ describe("Preserves column min-width", () => { cy.mount(
Start
Mid
@@ -948,8 +947,7 @@ describe("Preserves column min-width", () => { cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") - .should("have.prop", "offsetWidth") - .and("be.closeTo", smallestColumnWidth, 1); + .should("have.prop", "offsetWidth", smallestColumnWidth); }); }); @@ -957,7 +955,6 @@ describe("Preserves column min-width", () => { cy.mount(
Start
Mid
@@ -984,8 +981,7 @@ describe("Preserves column min-width", () => { cy.get("@fcl") .shadow() .find(".ui5-fcl-column--end") - .should("have.prop", "offsetWidth") - .and("be.closeTo", smallestColumnWidth, 1); + .should("have.prop", "offsetWidth", smallestColumnWidth); }); }); @@ -993,12 +989,8 @@ describe("Accessibility with Animation Disabled", () => { it("tests separator acc attrs", () => { cy.mount( { it("tests acc default roles", () => { cy.mount( - +
some content
some content
some content
@@ -1061,12 +1053,11 @@ describe("Accessibility with Animation Disabled", () => { it("tests acc custom roles", () => { cy.mount( { it("tests acc attrs", () => { cy.mount( - +
some content
some content
some content