---
id: w4/m15/t005
title: "Test coverage: Audit Log renders under the new section"
worker: worker4
status: done
estimate: 30m
depends_on: [w4/m15/t003]
---

## Objective

Add a meaningful test asserting the Audit Log card renders **inside** the Security & Compliance section grouping on the Settings page — the observable end state this milestone ships — not merely that the panel exists somewhere.

## Context

- Dashboard test convention: vitest component tests in adjacent `__tests__/` dirs (e.g. `src/features/audit/components/__tests__/audit-log-panel.test.tsx`, `src/routes/__tests__/services.$serviceId.settings.test.tsx`). There is currently **no** test on the account settings page itself.
- The assertion must tie the card to the section — e.g. the Security & Compliance heading is present and the Audit Log card is within that section's subtree, distinguishing "grouped under Security & Compliance" from the old "bare sibling of Team/API Keys". Avoid a tautological "renders" snapshot.
- A real-browser smoke via Playwright MCP is optional supplementary verification (screenshot to `.playwright-mcp/` with a bare filename per repo rule); the committed test is the vitest one.

## Steps

1. Add a settings-page vitest test (new `src/features/auth/pages/settings-page/__tests__/index.test.tsx` or the nearest existing convention) mounting `SettingsPage` with `AuditLogPanel` mocked/permitted, asserting the section heading renders and the Audit Log card is nested under it.
2. Keep the existing `audit-log-panel.test.tsx` gating/503 assertions intact (they cover panel internals; this test covers placement).
3. `yarn test` green.

## Files

- `dashboard/src/features/auth/pages/settings-page/__tests__/index.test.tsx` (new)

## Acceptance criteria

- [ ] A test fails if the Audit Log card is moved back out of the Security & Compliance section (asserts nesting/relationship, not mere presence).
- [ ] Test asserts real behavior (section heading + card containment), no snapshot-everything or tautology.
- [ ] `yarn test` green.

## Out of scope

- Re-testing `AuditLogPanel`'s internal paging/gating (already covered by its own test).
