Skip to content
Snippets Groups Projects
Unverified Commit df7a8533 authored by Anton Kulyk's avatar Anton Kulyk Committed by GitHub
Browse files

Fix flaky dashboard subscription test (#42051)

parent 5f2e3234
No related branches found
No related tags found
No related merge requests found
......@@ -216,36 +216,30 @@ describe("scenarios > dashboard > subscriptions", () => {
});
describe("let non-users unsubscribe from subscriptions", () => {
it(
"should allow non-user to unsubscribe from subscription",
{ tags: "@flaky" },
() => {
const nonUserEmail = "non-user@example.com";
const otherUserEmail = "other-user@example.com";
const dashboardName = "Orders in a dashboard";
visitDashboard(ORDERS_DASHBOARD_ID);
setupSubscriptionWithRecipients([nonUserEmail, otherUserEmail]);
emailSubscriptionRecipients();
openEmailPage(dashboardName).then(() => {
cy.intercept("/api/session/pulse/unsubscribe").as("unsubscribe");
cy.findByText("Unsubscribe").click();
cy.wait("@unsubscribe");
cy.contains(
`You've unsubscribed ${nonUserEmail} from the "${dashboardName}" alert.`,
).should("exist");
});
openDashboardSubscriptions();
openPulseSubscription();
sidebar().findByText(nonUserEmail).should("not.exist");
sidebar().findByText(otherUserEmail).should("exist");
},
);
it("should allow non-user to unsubscribe from subscription", () => {
const nonUserEmail = "non-user@example.com";
const dashboardName = "Orders in a dashboard";
visitDashboard(ORDERS_DASHBOARD_ID);
setupSubscriptionWithRecipients([nonUserEmail]);
emailSubscriptionRecipients();
openEmailPage(dashboardName).then(() => {
cy.intercept("/api/session/pulse/unsubscribe").as("unsubscribe");
cy.findByText("Unsubscribe").click();
cy.wait("@unsubscribe");
cy.contains(
`You've unsubscribed ${nonUserEmail} from the "${dashboardName}" alert.`,
).should("exist");
});
openDashboardSubscriptions();
openPulseSubscription();
sidebar().findByText(nonUserEmail).should("not.exist");
});
it("should allow non-user to undo-unsubscribe from subscription", () => {
const nonUserEmail = "non-user@example.com";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment