Skip to content

Commit 0d5d93e

Browse files
committed
Fix cypress index test broken by the sidebar truncate wrapper (#484)
packages/cli/cypress/e2e/index.cy.js had the same brittle cy.contains("preview")/("Emails") assertions that #508 fixed in the e2e copy, but this repo-level copy was missed — so #484's truncate <div> made cy.contains match the wrapper (no role/aria-expanded) and the "cypress" workflow failed. Scope to cy.contains('[role="treeitem"]', ...) like #508. Also drop a stray unused `require("typescript")` at the top of the file.
1 parent 0aa9c55 commit 0d5d93e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/cli/cypress/e2e/index.cy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const { isBindingElement } = require("typescript");
2-
31
describe("index page tests", () => {
42
beforeEach(() => {
53
cy.visit("/");
@@ -8,10 +6,12 @@ describe("index page tests", () => {
86
it("should redirect index to previewFunction with tree", () => {
97
cy.location("pathname").should("eq", "/previews/Welcome/preview");
108

11-
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")
1212
.should("have.attr", "aria-selected", "true")
1313
.should("have.attr", "role", "treeitem");
14-
cy.contains("Emails")
14+
cy.contains('[role="treeitem"]', "Emails")
1515
.should("have.attr", "aria-expanded", "true")
1616
.should("have.attr", "aria-selected", "false")
1717
.should("have.attr", "role", "treeitem");

0 commit comments

Comments
 (0)