This commit is contained in:
peintnermax
2024-04-04 09:59:28 +02:00
parent 4bbc9ea8a7
commit aa1e20179d

View File

@@ -47,12 +47,6 @@ describe("login", () => {
}); });
describe("password login", () => { describe("password login", () => {
beforeEach(() => { beforeEach(() => {
stub("zitadel.user.v2beta.UserService", "ListAuthenticationMethodTypes", {
data: {
authMethodTypes: [1], // 1 for password authentication
},
});
stub("zitadel.user.v2beta.UserService", "ListUsers", { stub("zitadel.user.v2beta.UserService", "ListUsers", {
data: { data: {
details: { details: {
@@ -85,6 +79,11 @@ describe("login", () => {
], ],
}, },
}); });
stub("zitadel.user.v2beta.UserService", "ListAuthenticationMethodTypes", {
data: {
authMethodTypes: [1], // 1 for password authentication
},
});
}); });
it("should redirect a user with password authentication to /password", () => { it("should redirect a user with password authentication to /password", () => {
cy.visit("/loginname?loginName=john%40zitadel.com&submit=true"); cy.visit("/loginname?loginName=john%40zitadel.com&submit=true");
@@ -119,6 +118,38 @@ describe("login", () => {
}); });
describe("passkey login", () => { describe("passkey login", () => {
beforeEach(() => { beforeEach(() => {
stub("zitadel.user.v2beta.UserService", "ListUsers", {
data: {
details: {
totalResult: 1,
},
result: [
{
userId: "221394658884845598",
state: 1,
username: "john@zitadel.com",
loginNames: ["john@zitadel.com"],
preferredLoginName: "john@zitadel.com",
human: {
userId: "221394658884845598",
state: 1,
username: "john@zitadel.com",
loginNames: ["john@zitadel.com"],
preferredLoginName: "john@zitadel.com",
profile: {
givenName: "John",
familyName: "Doe",
avatarUrl: "https://zitadel.com/avatar.jpg",
},
email: {
email: "john@zitadel.com",
isVerified: true,
},
},
},
],
},
});
stub("zitadel.user.v2beta.UserService", "ListAuthenticationMethodTypes", { stub("zitadel.user.v2beta.UserService", "ListAuthenticationMethodTypes", {
data: { data: {
authMethodTypes: [2], // 2 for passwordless authentication authMethodTypes: [2], // 2 for passwordless authentication