diff --git a/adminfront/tests/audit.spec.ts b/adminfront/tests/audit.spec.ts index e2c8ad21..486ea6a7 100644 --- a/adminfront/tests/audit.spec.ts +++ b/adminfront/tests/audit.spec.ts @@ -71,9 +71,9 @@ test.describe("Audit Logs Management", () => { headers: { "Access-Control-Allow-Origin": "*" }, }); }); - }); + }); - const generateMockLogs = (count: number, offset = 0) => { + const generateMockLogs = (count: number, offset = 0) => { return Array.from({ length: count }, (_, i) => { const id = offset + i; return { @@ -91,9 +91,9 @@ test.describe("Audit Logs Management", () => { }), }; }); - }; + }; - test("should load initial logs and display correctly", async ({ page }) => { + test("should load initial logs and display correctly", async ({ page }) => { console.log("[test] Navigating to /audit-logs"); await page.goto("/audit-logs"); @@ -108,11 +108,11 @@ test.describe("Audit Logs Management", () => { // 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 ({ + test("should load more logs on scroll (infinite scroll)", async ({ page, - }) => { + }) => { await page.goto("/audit-logs"); await expect(page.locator("tbody tr")).toHaveCount(20, { timeout: 15000 }); @@ -127,9 +127,9 @@ test.describe("Audit Logs Management", () => { // Wait for the next page to load (should reach 40) await expect(page.locator("tbody tr")).toHaveCount(40, { timeout: 15000 }); await expect(page.locator("tbody")).toContainText("user-even"); - }); + }); - test("should filter logs by Action and User ID locally", async ({ page }) => { + test("should filter logs by Action and User ID locally", async ({ page }) => { await page.goto("/audit-logs"); await expect(page.locator("tbody tr")).toHaveCount(20, { timeout: 15000 }); @@ -152,9 +152,9 @@ test.describe("Audit Logs Management", () => { // Check that we only see ROTATE_SECRET (20 - 7 = 13) await expect(page.locator("tbody tr")).toHaveCount(13, { timeout: 15000 }); await expect(page.locator("tbody")).not.toContainText("CREATE_TENANT"); - }); + }); - test("should filter logs by Status locally", async ({ page }) => { + test("should filter logs by Status locally", async ({ page }) => { await page.goto("/audit-logs"); await expect(page.locator("tbody tr")).toHaveCount(20, { timeout: 15000 }); @@ -168,5 +168,5 @@ test.describe("Audit Logs Management", () => { await page.getByTestId("audit-filter-status").selectOption("success"); await expect(page.locator("tbody tr")).toHaveCount(16, { timeout: 15000 }); - }); + }); });