---
id: w4/m11/t006
title: Test coverage — meaningful tests for the MFA dashboard behavior
worker: worker4
status: done
estimate: 30m
depends_on: [w4/m11/t007]
---

## Objective

Add meaningful dashboard tests for what m11 shipped: the settings page renders the three method sections from a Kratos flow fixture, the login route enters the aal2 step when the flow demands it, and error states (wrong code) render Kratos messages. Assert real behavior and failure modes — never trivial or snapshot-everything tests. (The server side is configuration; its behavior is covered by t003's script.)

## Context

- Standing closing task; follow `dashboard/CLAUDE.md` test conventions (as w4/m8 t004 does for API keys).

## Steps

1. Fixture-driven tests for settings-flow rendering (totp/webauthn/lookup_secret groups present, i18n keys resolve).
2. Login aal2-step routing test (flow with `requested_aal: aal2` → challenge UI).
3. Error-state test: Kratos error messages surface to the user.

## Files

- `dashboard/src/**/*.test.*` per repo conventions

## Acceptance criteria

- [ ] Tests fail if a method section disappears, the aal2 step is skipped, or errors are swallowed; dashboard test suite green.

## Out of scope

- Coverage-percentage gaming; re-testing Kratos itself.
