mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 09:54:00 +00:00
add stub
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user