Files
zitadel/apps/login/cypress/integration/register-idp.cy.ts

37 lines
851 B
TypeScript
Raw Normal View History

2023-08-02 13:44:19 +02:00
import { stub } from "../support/mock";
const CUSTOM_TEXT = "Hubba Bubba";
const IDP_URL = "https://google.com";
2023-08-02 14:21:35 +02:00
describe("register idps", () => {
2023-08-02 13:44:19 +02:00
beforeEach(() => {
stub(
"zitadel.settings.v2alpha.SettingsService",
"GetActiveIdentityProviders",
{
data: {
identityProviders: [
{
id: "123",
name: CUSTOM_TEXT,
type: 10,
},
],
},
}
);
2023-08-02 14:47:38 +02:00
stub("zitadel.user.v2alpha.UserService", "StartIdentityProviderFlow", {
data: {
authUrl: IDP_URL,
},
});
2023-08-02 13:44:19 +02:00
});
2023-08-02 15:02:36 +02:00
it("should redirect the user to the correct url", () => {
2023-08-02 13:44:19 +02:00
cy.visit("/register/idp");
2023-08-02 14:53:10 +02:00
const button = cy.get('button[e2e="google"]');
button.click();
2023-08-02 15:02:36 +02:00
cy.location("href", { timeout: 10_000 }).should("eq", IDP_URL);
2023-08-02 13:44:19 +02:00
});
});