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

Commit

Permalink
Fix flakiness of kick.spec.ts due to `cy.get(...).contains(...).shoul…
Browse files Browse the repository at this point in the history
…d(...);` anti-pattern (#9411)

* Update kick.spec.ts

* Update kick.spec.ts
  • Loading branch information
t3chguy authored Oct 13, 2022
1 parent 714ba6d commit aa9f8ea
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cypress/e2e/integration-manager/kick.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,10 @@ function sendActionFromIntegrationManager(integrationManagerUrl: string, targetR

function expectKickedMessage(shouldExist: boolean) {
// Expand any event summaries
cy.get(".mx_RoomView_MessageList").within(roomView => {
if (roomView.find(".mx_GenericEventListSummary_toggle[aria-expanded=false]").length > 0) {
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click({ multiple: true });
}
});
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click({ multiple: true });

// Check for the event message (or lack thereof)
cy.get(".mx_EventTile_line")
.contains(`${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`)
cy.contains(".mx_EventTile_line", `${USER_DISPLAY_NAME} removed ${BOT_DISPLAY_NAME}: ${KICK_REASON}`)
.should(shouldExist ? "exist" : "not.exist");
}

Expand Down

0 comments on commit aa9f8ea

Please sign in to comment.