Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a704a2f

Browse files
authored
Reduce flakiness of spotlight tests (#9310)
1 parent 772df30 commit a704a2f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cypress/e2e/spotlight/spotlight.spec.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Cypress.Commands.add("startDM", (name: string) => {
125125
.should("have.focus")
126126
.type("Hey!{enter}");
127127
cy.contains(".mx_EventTile_body", "Hey!");
128-
cy.get(".mx_RoomSublist[aria-label=People]").should("contain", name);
128+
cy.contains(".mx_RoomSublist[aria-label=People]", name);
129129
});
130130

131131
describe("Spotlight", () => {
@@ -365,7 +365,10 @@ describe("Spotlight", () => {
365365
cy.spotlightSearch().clear().type(bot1.getUserId());
366366
cy.wait(1000); // wait for the dialog code to settle
367367
cy.spotlightResults().should("have.length", 2);
368-
cy.spotlightResults().eq(0).should("contain", groupDm.name);
368+
cy.contains(
369+
".mx_SpotlightDialog_section.mx_SpotlightDialog_results .mx_SpotlightDialog_option",
370+
groupDm.name,
371+
);
369372
});
370373

371374
// Search for ByteBot by id, should return group DM and user
@@ -374,7 +377,10 @@ describe("Spotlight", () => {
374377
cy.spotlightSearch().clear().type(bot2.getUserId());
375378
cy.wait(1000); // wait for the dialog code to settle
376379
cy.spotlightResults().should("have.length", 2);
377-
cy.spotlightResults().eq(0).should("contain", groupDm.name);
380+
cy.contains(
381+
".mx_SpotlightDialog_section.mx_SpotlightDialog_results .mx_SpotlightDialog_option",
382+
groupDm.name,
383+
);
378384
});
379385
});
380386
});

0 commit comments

Comments
 (0)