mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 10:25:58 +00:00
test register
This commit is contained in:
@@ -16,9 +16,11 @@ export default async function Page({
|
||||
const setPassword = !!(firstname && lastname && email);
|
||||
|
||||
const legal = await getLegalAndSupportSettings(server);
|
||||
console.log("legal", legal);
|
||||
const passwordComplexitySettings = await getPasswordComplexitySettings(
|
||||
server
|
||||
);
|
||||
console.log("complexity", passwordComplexitySettings);
|
||||
|
||||
return setPassword ? (
|
||||
<div className="flex flex-col items-center space-y-4">
|
||||
|
||||
@@ -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", {
|
||||
|
||||
23
apps/login/cypress/integration/register.cy.ts
Normal file
23
apps/login/cypress/integration/register.cy.ts
Normal 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");
|
||||
});
|
||||
});
|
||||
@@ -7,12 +7,30 @@
|
||||
{
|
||||
"service": "zitadel.settings.v2alpha.SettingsService",
|
||||
"method": "GetLegalAndSupportSettings",
|
||||
"out": {}
|
||||
"out": {
|
||||
"data": {
|
||||
"settings": {
|
||||
"tosLink": "http://whatever.com/help",
|
||||
"privacyPolicyLink": "http://whatever.com/help",
|
||||
"helpLink": "http://whatever.com/help"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"service": "zitadel.settings.v2alpha.SettingsService",
|
||||
"method": "GetPasswordComplexitySettings",
|
||||
"out": {}
|
||||
"out": {
|
||||
"data": {
|
||||
"settings": {
|
||||
"minLength": 8,
|
||||
"requiresUppercase": true,
|
||||
"requiresLowercase": true,
|
||||
"requiresNumber": true,
|
||||
"requiresSymbol": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"service": "zitadel.settings.v2alpha.SettingsService",
|
||||
|
||||
@@ -50,6 +50,7 @@ export function PrivacyPolicyCheckboxes({ legal, onChange }: Props) {
|
||||
<Checkbox
|
||||
className="mr-4"
|
||||
checked={false}
|
||||
value={"privacypolicy"}
|
||||
onChangeVal={(checked: boolean) => {
|
||||
setAcceptanceState({
|
||||
...acceptanceState,
|
||||
@@ -74,6 +75,7 @@ export function PrivacyPolicyCheckboxes({ legal, onChange }: Props) {
|
||||
<Checkbox
|
||||
className="mr-4"
|
||||
checked={false}
|
||||
value={"tos"}
|
||||
onChangeVal={(checked: boolean) => {
|
||||
setAcceptanceState({
|
||||
...acceptanceState,
|
||||
|
||||
Reference in New Issue
Block a user