2023-07-05 19:06:21 +02:00
|
|
|
import { stub } from "../support/mock";
|
2023-07-04 14:52:33 +02:00
|
|
|
|
|
|
|
|
describe("register", () => {
|
|
|
|
|
beforeEach(() => {
|
2024-08-06 09:34:45 +02:00
|
|
|
stub("zitadel.user.v2.UserService", "AddHumanUser", {
|
2023-07-04 14:52:33 +02:00
|
|
|
data: {
|
|
|
|
|
userId: "123",
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("should redirect a user who selects passwordless on register to /passkeys/add", () => {
|
|
|
|
|
cy.visit("/register");
|
|
|
|
|
cy.get('input[autocomplete="firstname"]').focus().type("John");
|
|
|
|
|
cy.get('input[autocomplete="lastname"]').focus().type("Doe");
|
|
|
|
|
cy.get('input[autocomplete="email"]').focus().type("john@zitadel.com");
|
|
|
|
|
cy.get('input[type="checkbox"][value="privacypolicy"]').check();
|
|
|
|
|
cy.get('input[type="checkbox"][value="tos"]').check();
|
|
|
|
|
cy.get('button[type="submit"]').click();
|
|
|
|
|
cy.location("pathname", { timeout: 10_000 }).should("eq", "/passkey/add");
|
|
|
|
|
});
|
|
|
|
|
});
|