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

@@ -31,9 +31,10 @@ vi.mock("react-oidc-context", () => ({
}));
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,
useNavigate: () => navigateMock,
@@ -175,7 +176,9 @@ describe("ClientsPage", () => {
});
const container = await renderPage();
expect(container.textContent).toContain("총 6개의 애플리케이션이 등록되어 있습니다.");
expect(container.textContent).toContain(
"총 6개의 애플리케이션이 등록되어 있습니다.",
);
expect(container.textContent).toContain("App 6");
expect(container.textContent).toContain("App 2");
expect(container.textContent).not.toContain("App 1");
@@ -192,26 +195,27 @@ describe("ClientsPage", () => {
expect(container.textContent).toContain("App 6");
expect(container.textContent).toContain("접기");
const advancedButton = Array.from(container.querySelectorAll("button")).find(
(button) => button.textContent === "Advanced Filters",
);
const advancedButton = Array.from(
container.querySelectorAll("button"),
).find((button) => button.textContent === "Advanced Filters");
expect(advancedButton).toBeTruthy();
await act(async () => {
advancedButton?.dispatchEvent(
new MouseEvent("click", { bubbles: true }),
);
advancedButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
});
const searchInput = Array.from(
container.querySelectorAll("input"),
).find((input) =>
input.getAttribute("placeholder")?.includes("클라이언트 이름/ID로 검색"),
const searchInput = Array.from(container.querySelectorAll("input")).find(
(input) =>
input
.getAttribute("placeholder")
?.includes("클라이언트 이름/ID로 검색"),
) as HTMLInputElement | undefined;
expect(searchInput).toBeTruthy();
if (!searchInput) {
throw new Error("Expected search input to be rendered");
}
await act(async () => {
await setInputValue(searchInput!, "missing-client");
await setInputValue(searchInput, "missing-client");
});
expect(container.textContent).toContain("조건에 맞는 연동 앱이 없습니다.");
@@ -226,7 +230,7 @@ describe("ClientsPage", () => {
});
await act(async () => {
await setInputValue(searchInput!, "");
await setInputValue(searchInput, "");
});
expect(container.textContent).toContain("App 1");