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

22 lines
538 B
TypeScript
Raw Normal View History

2023-08-02 13:44:19 +02:00
import { stub } from "../support/mock";
2023-08-02 15:10:36 +02:00
const IDP_URL = "https://example.com/idp/url";
2023-08-02 13:44:19 +02:00
2023-08-02 14:21:35 +02:00
describe("register idps", () => {
2023-08-02 13:44:19 +02:00
beforeEach(() => {
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 15:10:36 +02:00
cy.get('button[e2e="google"]').click();
2023-08-02 15:21:34 +02:00
cy.origin(IDP_URL, () => {
2023-08-02 15:10:36 +02:00
cy.location("href", { timeout: 10_000 }).should("eq", IDP_URL);
2023-08-02 15:21:34 +02:00
});
2023-08-02 13:44:19 +02:00
});
});