Skip to content

Commit

Permalink
test: update staticroutes.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
petermakowski committed Apr 8, 2024
1 parent a0347b4 commit 980634d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cypress/e2e/with-users/subnets/staticroutes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LONG_TIMEOUT } from "../../../constants";
import { generateMAASURL } from "../../utils";

context("Static Routes", () => {
Expand Down Expand Up @@ -27,7 +28,8 @@ context("Static Routes", () => {
});
cy.findByRole("button", { name: /save/i }).click();
cy.findByRole("complementary", { name: /Add static route/i }).should(
"not.exist"
"not.exist",
{ timeout: LONG_TIMEOUT }
);

// Edit static route
Expand All @@ -51,8 +53,9 @@ context("Static Routes", () => {
cy.findByText(staticRoute as string);
});
});
cy.findByRole("complementary", { name: /Add static route/i }).should(
"not.exist"
cy.findByRole("complementary", { name: /Edit static route/i }).should(
"not.exist",
{ timeout: LONG_TIMEOUT }
);

// Delete the static route
Expand All @@ -70,11 +73,15 @@ context("Static Routes", () => {
cy.findByRole("button", { name: /delete/i }).click();
}
);
cy.findByRole("complementary", {
name: /Delete static route/i,
}).should("not.exist", {
timeout: LONG_TIMEOUT,
});
cy.get("@staticRoute").then((staticRoute: unknown) => {
cy.findByRole("region", { name: /Static routes/i }).within(() => {
cy.findByText(staticRoute as string).should("not.exist");
});
});
cy.findByRole("region", { name: /side panel/i }).should("not.exist");
});
});

0 comments on commit 980634d

Please sign in to comment.