import { expect, test } from "@playwright/test" import { ApiClient } from "../api-client" import { SEED } from "../seed-constants" const apiClient = new ApiClient() test.describe("Audit Log Page @full", () => { test.beforeEach(async () => { await apiClient.login(SEED.admin.email, SEED.admin.password) await apiClient.resetDb() }) test("audit log page loads", async ({ page }) => { await page.goto("/audit-log") await expect( page .getByRole("heading", { name: /audit|protokoll/i }) .or(page.getByText(/audit/i).first()) ).toBeVisible() }) test("shows table or list structure", async ({ page }) => { await page.goto("/audit-log") // Should display audit entries in a table or list const table = page .getByRole("table") .or(page.locator("[data-testid='audit-log-table']")) .or(page.locator("[data-testid*='audit-entry']").first()) await expect(table.first()).toBeVisible() }) test("has filter or search capability", async ({ page }) => { await page.goto("/audit-log") // Should have some kind of filter/search input const filterInput = page .getByRole("searchbox") .or(page.getByPlaceholder(/such|filter|search/i)) .or(page.locator('[data-testid="audit-log-filter"]')) .or(page.locator("input[type='search']")) .or(page.getByRole("combobox")) await expect(filterInput.first()).toBeVisible() }) })