mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-13 17:13:55 +00:00
acceptance tests
This commit is contained in:
41
apps/login/cypress/integration/register-idp.cy.ts
Normal file
41
apps/login/cypress/integration/register-idp.cy.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user