Skip to content

Commit

Permalink
used await url instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Om-Thorat committed Jan 11, 2024
1 parent 537682b commit 363b944
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/auth_spec/redirect.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ describe("redirect", () => {
});

it("Check if login redirects to the right url", () => {
cy.visit("/resource/board");
cy.awaitUrl("/resource/board", true);
loginPage.loginManuallyAsStaff();
loginPage.CheckIfLoggedIn();
cy.url().should("include", "/resource/board");
});

it("Check if the redirect param works", () => {
cy.visit("login?redirect=http://localhost:4000/resource/board");
cy.awaitUrl("login?redirect=http://localhost:4000/resource/board", true);
loginPage.loginManuallyAsStaff();
loginPage.CheckIfLoggedIn();
cy.url().should("include", "/resource/board");
});

it("Check to ensure that redirect is the same origin", () => {
cy.visit("login?redirect=https://google.com");
cy.awaitUrl("login?redirect=https://google.com", true);
loginPage.loginManuallyAsStaff();
loginPage.CheckIfLoggedIn();
cy.url().should("include", "/facility");
Expand Down

0 comments on commit 363b944

Please sign in to comment.