Skip to content

Commit 9d32f83

Browse files
committed
e2e: scope index.cy.js tree assertions to the treeitem
cy.contains("preview")/("Emails") matched the label text directly, so wrapping the label (e.g. a truncating <div>, as in #484) made the assertions target the wrapper instead of the role="treeitem" element and fail on the role/aria-expanded attrs. Scope with cy.contains('[role="treeitem"]', ...) so the checks stay on the treeitem. Verified locally: passes both with and without the wrapper.
1 parent aae797d commit 9d32f83

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

e2e/mailing_tests/cypress/e2e/index.cy.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ describe("index page tests", () => {
66
it("should redirect index to previewFunction with tree", () => {
77
cy.location("pathname").should("eq", "/previews/Welcome/preview");
88

9-
cy.contains("preview")
9+
// Scope to the treeitem rather than the label text so the assertions stay
10+
// valid when the label is wrapped (e.g. in a truncating element).
11+
cy.contains('[role="treeitem"]', "preview")
1012
.should("have.attr", "aria-selected", "true")
1113
.should("have.attr", "role", "treeitem");
12-
cy.contains("Emails")
14+
cy.contains('[role="treeitem"]', "Emails")
1315
.should("have.attr", "aria-expanded", "true")
1416
.should("have.attr", "aria-selected", "false")
1517
.should("have.attr", "role", "treeitem");

0 commit comments

Comments
 (0)