Files
cannamanage/cannamanage-frontend/e2e/integration/12-audit-log.spec.ts
T
Patrick Plate 776149e7d3 test: add full-stack Playwright integration test infrastructure
Sprint 12 Phase 2: Real integration tests with seed DB
- R__seed_test_data.sql (Flyway repeatable, 7 members, strains, batches, docs, board, events)
- TestResetController (profile-gated per-test DB reset)
- docker-compose.test.yml (self-contained, tmpfs Postgres)
- Dockerfile.playwright (v1.60.0, pre-installed deps)
- 13 integration spec files, 70+ test cases (@smoke + @full)
- seed-constants.ts, selectors.ts, api-client.ts test helpers
2026-06-18 14:43:16 +02:00

47 lines
1.4 KiB
TypeScript

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()
})
})