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 4381ba0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 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 @@ -40,7 +42,7 @@ context("Static Routes", () => {

cy.findByRole("complementary", { name: /Edit static route/i }).within(
() => {
cy.findByLabelText(/gateway ip/i).type("{Backspace}1");
cy.findByLabelText(/gateway ip/i).type("{Backspace}2");
cy.findByRole("button", { name: /save/i }).click();
}
);
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 4381ba0

Please sign in to comment.