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-09-21 10:27:49 +02:00
|
|
|
stub("zitadel.user.v2beta.UserService", "StartIdentityProviderIntent", {
|
2023-08-02 14:47:38 +02:00
|
|
|
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", () => {
|
2024-04-04 11:52:05 +02:00
|
|
|
cy.visit("/idp");
|
2023-08-02 15:10:36 +02:00
|
|
|
cy.get('button[e2e="google"]').click();
|
2023-08-02 15:28:50 +02:00
|
|
|
cy.origin(IDP_URL, { args: IDP_URL }, (url) => {
|
|
|
|
|
cy.location("href", { timeout: 10_000 }).should("eq", url);
|
2023-08-02 15:21:34 +02:00
|
|
|
});
|
2023-08-02 13:44:19 +02:00
|
|
|
});
|
|
|
|
|
});
|