Skip to content
Snippets Groups Projects
Unverified Commit 69ed17e9 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

[E2E] Fix `notifications` flake (#28408)

parent c7a19a40
Branches
Tags
No related merge requests found
......@@ -78,7 +78,7 @@ describe("scenarios > account > notifications", () => {
});
it("should be able to see help info", () => {
cy.visit("/account/notifications");
openUserNotifications();
cy.findByText("Not seeing one here?").click();
......@@ -91,7 +91,7 @@ describe("scenarios > account > notifications", () => {
});
it("should be able to see alerts notifications", () => {
cy.visit("/account/notifications");
openUserNotifications();
cy.findByText("Question");
cy.findByText("Emailed hourly", { exact: false });
......@@ -99,7 +99,7 @@ describe("scenarios > account > notifications", () => {
});
it("should be able to unsubscribe and delete an alert when the user created it", () => {
cy.visit("/account/notifications");
openUserNotifications();
cy.findByText("Question");
clickUnsubscribe();
......@@ -107,6 +107,7 @@ describe("scenarios > account > notifications", () => {
modal().within(() => {
cy.findByText("Confirm you want to unsubscribe");
cy.findByText("Unsubscribe").click();
cy.findByText("Unsubscribe").should("not.exist");
});
modal().within(() => {
......@@ -114,13 +115,14 @@ describe("scenarios > account > notifications", () => {
cy.findByText("Delete this alert").click();
});
cy.findByText("Question").should("not.exist");
modal().should("not.exist");
cy.findByTestId("notification-list").should("not.exist");
});
it("should be able to unsubscribe from an alert when the user has not created it", () => {
cy.signOut();
cy.signInAsAdmin();
cy.visit("/account/notifications");
openUserNotifications();
cy.findByText("Question");
clickUnsubscribe();
......@@ -146,7 +148,7 @@ describe("scenarios > account > notifications", () => {
});
it("should be able to see help info", () => {
cy.visit("/account/notifications");
openUserNotifications();
cy.findByText("Not seeing one here?").click();
......@@ -159,7 +161,7 @@ describe("scenarios > account > notifications", () => {
});
it("should be able to see pulses notifications", () => {
cy.visit("/account/notifications");
openUserNotifications();
cy.findByText("Subscription");
cy.findByText("Slack’d hourly", { exact: false });
......@@ -167,7 +169,7 @@ describe("scenarios > account > notifications", () => {
});
it("should be able to unsubscribe and delete a pulse when the user has created it", () => {
cy.visit("/account/notifications");
openUserNotifications();
cy.findByText("Subscription");
clickUnsubscribe();
......@@ -187,3 +189,9 @@ function clickUnsubscribe() {
cy.findByLabelText("close icon").click();
});
}
function openUserNotifications() {
cy.intercept("GET", "/api/pulse?*").as("loadSubscriptions");
cy.visit("/account/notifications");
cy.wait("@loadSubscriptions");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment