1
0
forked from baron/baron-sso

adminfront /api-keys 새로고침 404 해결

This commit is contained in:
2026-05-18 11:36:43 +09:00
parent c7d25f3611
commit e7dab0f8fd
4 changed files with 176 additions and 2 deletions

View File

@@ -10,6 +10,10 @@ import {
} from "../../lib/adminApi";
import ApiKeyListPage from "./ApiKeyListPage";
vi.mock("../../lib/i18n", () => ({
t: (_key: string, fallback?: string) => fallback ?? "",
}));
vi.mock("../../lib/adminApi", () => ({
fetchApiKeys: vi.fn(async () => ({
items: [
@@ -102,4 +106,20 @@ describe("ApiKeyListPage", () => {
).toBeInTheDocument();
expect(fetchApiKeys).toHaveBeenCalled();
});
it("refresh button refetches the list without navigation", async () => {
const user = userEvent.setup();
renderPage();
await screen.findByText("client-id-stable");
const refreshButton = screen.getByRole("button", { name: /새로고침/ });
expect(refreshButton).toHaveAttribute("type", "button");
await user.click(refreshButton);
await waitFor(() => {
expect(fetchApiKeys).toHaveBeenCalledTimes(2);
});
});
});

View File

@@ -172,6 +172,7 @@ function ApiKeyListPage() {
actions={
<>
<Button
type="button"
variant="outline"
onClick={() => query.refetch()}
disabled={query.isFetching}