Skip to content

Commit

Permalink
Test fix attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
ikusteu committed Jul 8, 2023
1 parent cd8bc9d commit b235265
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions packages/e2e/integration/login_flow_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,18 @@ describe("login", () => {
describe("Login redirect", () => {
it("Redirects to customer bookings page on customer (non-admin) login", () => {
const password = "password";
cy.addAuthUser({ email: saul.email, password });
// log in saul, who is not an admin, but exists in customers collection
cy.clickButton(t(AuthTitle.SignInWithEmail));
cy.getAttrWith("type", "email").type(saul.email);
cy.clickButton(t(ActionButton.Next));
cy.contains(t(AuthTitle.SignIn));
cy.getAttrWith("type", "password").type(password);
cy.clickButton(t(ActionButton.SignIn));
// on successful login, should redirect to saul's customer bookings
cy.url().should("include", saul.secretKey);
cy.contains(`${saul.name} ${saul.surname}`);
cy.addAuthUser({ email: saul.email, password }).then(() => {
// log in saul, who is not an admin, but exists in customers collection
cy.clickButton(t(AuthTitle.SignInWithEmail));
cy.getAttrWith("type", "email").type(saul.email);
cy.clickButton(t(ActionButton.Next));
cy.contains(t(AuthTitle.SignIn));
cy.getAttrWith("type", "password").type(password);
cy.clickButton(t(ActionButton.SignIn));
// on successful login, should redirect to saul's customer bookings
cy.url().should("include", saul.secretKey);
return cy.contains(`${saul.name} ${saul.surname}`);
});
});

it("redirects to self registration page if user not admin, nor a registered customer", () => {
Expand Down

0 comments on commit b235265

Please sign in to comment.