1
0
forked from baron/baron-sso

75f192fb24 기준 병합 code-check 수정

This commit is contained in:
2026-06-02 11:46:40 +09:00
parent 38605ac8a3
commit 2c5eed1774
17 changed files with 276 additions and 188 deletions

View File

@@ -9,9 +9,10 @@ const listIdpConfigsMock = vi.fn();
const createIdpConfigMock = vi.fn();
vi.mock("react-router-dom", async () => {
const actual = await vi.importActual<typeof import("react-router-dom")>(
"react-router-dom",
);
const actual =
await vi.importActual<typeof import("react-router-dom")>(
"react-router-dom",
);
return {
...actual,
useParams: () => params,
@@ -19,10 +20,8 @@ vi.mock("react-router-dom", async () => {
});
vi.mock("../../../lib/devApi", () => ({
listIdpConfigsForClient: (clientId: string) =>
listIdpConfigsMock(clientId),
createIdpConfigForClient: (payload: unknown) =>
createIdpConfigMock(payload),
listIdpConfigsForClient: (clientId: string) => listIdpConfigsMock(clientId),
createIdpConfigForClient: (payload: unknown) => createIdpConfigMock(payload),
}));
vi.mock("../../../lib/i18n", () => ({
@@ -146,16 +145,15 @@ describe("ClientFederationPage", () => {
'input[name="oidc_client_secret"]',
) as HTMLInputElement | null;
expect(displayName).toBeTruthy();
expect(issuerUrl).toBeTruthy();
expect(clientId).toBeTruthy();
expect(clientSecret).toBeTruthy();
if (!displayName || !issuerUrl || !clientId || !clientSecret) {
throw new Error("Expected federation form inputs to be rendered");
}
await act(async () => {
await setInputValue(displayName!, "New Provider");
await setInputValue(issuerUrl!, "https://login.example");
await setInputValue(clientId!, "client-oidc");
await setInputValue(clientSecret!, "secret-value");
await setInputValue(displayName, "New Provider");
await setInputValue(issuerUrl, "https://login.example");
await setInputValue(clientId, "client-oidc");
await setInputValue(clientSecret, "secret-value");
});
const submitButton = Array.from(container.querySelectorAll("button")).find(