forked from baron/baron-sso
chore: fix formatting and lint errors across Makefile, backend, and adminfront
This commit addresses several linting and formatting issues that caused CI checks to fail: - Makefile: Removed obsolete '--organize-imports-enabled' from Biome and switched to '@biomejs/biome'. - backend: Fixed spacing and alignment issues according to gofmt. - adminfront: Fixed multiple unused variables and imports, and configured unsafe fixes in the Biome config to remove dead code.
This commit is contained in:
@@ -32,7 +32,7 @@ test.describe("Audit Logs Management", () => {
|
||||
headers: { "Access-Control-Allow-Origin": "*" },
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
await page.route("**/oidc/**", async (route) => {
|
||||
await route.fulfill({ json: { issuer: "http://localhost:5000/oidc" } });
|
||||
});
|
||||
@@ -67,19 +67,21 @@ test.describe("Audit Logs Management", () => {
|
||||
});
|
||||
|
||||
await page.goto("/audit-logs");
|
||||
|
||||
|
||||
// Check header
|
||||
await expect(page.getByText(/감사 로그|Audit Logs/i).first()).toBeVisible();
|
||||
|
||||
|
||||
// Check if table rows are rendered
|
||||
await expect(page.locator("tbody tr")).toHaveCount(20);
|
||||
|
||||
|
||||
// Check specific data visible in the row
|
||||
await expect(page.locator("tbody")).toContainText("user-even");
|
||||
await expect(page.locator("tbody")).toContainText("CREATE_TENANT");
|
||||
});
|
||||
|
||||
test("should load more logs on scroll (infinite scroll)", async ({ page }) => {
|
||||
test("should load more logs on scroll (infinite scroll)", async ({
|
||||
page,
|
||||
}) => {
|
||||
let callCount = 0;
|
||||
await page.route("**/api/v1/audit?limit=50*", async (route) => {
|
||||
const logs = generateMockLogs(20, callCount * 20);
|
||||
@@ -93,10 +95,12 @@ test.describe("Audit Logs Management", () => {
|
||||
await page.goto("/audit-logs");
|
||||
await expect(page.locator("tbody tr")).toHaveCount(20);
|
||||
|
||||
const loadMoreBtn = page.getByRole('button', { name: /더 보기|Load more/i });
|
||||
const loadMoreBtn = page.getByRole("button", {
|
||||
name: /더 보기|Load more/i,
|
||||
});
|
||||
await expect(loadMoreBtn).toBeVisible();
|
||||
await loadMoreBtn.click();
|
||||
|
||||
|
||||
// Wait for the next page to load
|
||||
await expect(page.locator("tbody tr")).toHaveCount(40);
|
||||
// user-even and CREATE_TENANT should still be visible in the newly loaded rows
|
||||
@@ -118,10 +122,10 @@ test.describe("Audit Logs Management", () => {
|
||||
// Search by User ID
|
||||
const userIdInput = page.getByTestId("audit-search-user-id");
|
||||
await userIdInput.fill("user-even");
|
||||
|
||||
|
||||
// Wait for deferred value to apply
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
|
||||
// Half of 20 logs are user-even
|
||||
await expect(page.locator("tbody tr")).toHaveCount(10);
|
||||
await expect(page.locator("tbody")).not.toContainText("user-odd");
|
||||
@@ -135,7 +139,7 @@ test.describe("Audit Logs Management", () => {
|
||||
const actionInput = page.getByTestId("audit-search-action");
|
||||
await actionInput.fill("ROTATE_SECRET");
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
|
||||
// Check that we only see ROTATE_SECRET (20 - 7 = 13)
|
||||
await expect(page.locator("tbody tr")).toHaveCount(13);
|
||||
await expect(page.locator("tbody")).not.toContainText("CREATE_TENANT");
|
||||
@@ -158,11 +162,11 @@ test.describe("Audit Logs Management", () => {
|
||||
// ID % 5 === 0 are status "failure"
|
||||
// IDs: 0, 5, 10, 15 => 4 items
|
||||
await expect(page.locator("tbody tr")).toHaveCount(4);
|
||||
|
||||
|
||||
// Select "Success" status
|
||||
await page.getByTestId("audit-filter-status").selectOption("success");
|
||||
|
||||
|
||||
// IDs: 1,2,3,4, 6,7,8,9, 11,12,13,14, 16,17,18,19 => 16 items
|
||||
await expect(page.locator("tbody tr")).toHaveCount(16);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user