test register

This commit is contained in:
Max Peintner
2023-07-04 14:52:33 +02:00
parent 0fb88d4ff2
commit 22bf028fd1
5 changed files with 48 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import { addStub, removeStub } from "../support/mock";
describe("/passkey/login", () => {
describe("login", () => {
beforeEach(() => {
removeStub("zitadel.session.v2alpha.SessionService", "CreateSession");
addStub("zitadel.session.v2alpha.SessionService", "CreateSession", {

View File

@@ -0,0 +1,23 @@
import { addStub, removeStub } from "../support/mock";
describe("register", () => {
beforeEach(() => {
removeStub("zitadel.user.v2alpha.UserService", "AddHumanUser");
addStub("zitadel.user.v2alpha.UserService", "AddHumanUser", {
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");
});
});