mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 15:03:52 +00:00
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
|
|
import { stub } from "../support/mock";
|
||
|
|
|
||
|
|
const CUSTOM_TEXT = "Hubba Bubba";
|
||
|
|
const IDP_URL = "https://google.com";
|
||
|
|
|
||
|
|
describe("register", () => {
|
||
|
|
beforeEach(() => {
|
||
|
|
stub("zitadel.user.v2alpha.UserService", "StartIdentityProviderFlow", {
|
||
|
|
data: {
|
||
|
|
authUrl: IDP_URL,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
stub(
|
||
|
|
"zitadel.settings.v2alpha.SettingsService",
|
||
|
|
"GetActiveIdentityProviders",
|
||
|
|
{
|
||
|
|
data: {
|
||
|
|
identityProviders: [
|
||
|
|
{
|
||
|
|
id: "123",
|
||
|
|
name: CUSTOM_TEXT,
|
||
|
|
type: 10,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
}
|
||
|
|
);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("should show a custom text on the idp button", () => {
|
||
|
|
cy.visit("/register/idp");
|
||
|
|
cy.get('button[e2e="google"]').find("span").contains(CUSTOM_TEXT);
|
||
|
|
cy.location("pathname", { timeout: 10_000 }).should("eq", IDP_URL);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("should redirect a user who selects an idp on register to a url", () => {
|
||
|
|
cy.visit("/register/idp");
|
||
|
|
cy.get('button[e2e="google"]').click();
|
||
|
|
cy.location("pathname", { timeout: 10_000 }).should("eq", "/passkey/add");
|
||
|
|
});
|
||
|
|
});
|