## SwiftUI Component QA

### 3-Layer Test Strategy

| Layer          | Tool           | What It Verifies                                 |
| -------------- | -------------- | ------------------------------------------------ |
| **Structural** | ViewInspector  | Hierarchy, subview existence, applied modifiers  |
| **Visual**     | Snapshot Tests | Pixel-accurate render: light/dark, RTL/LTR       |
| **Behavioral** | Unit Tests     | State changes, closures, configuration mutations |

### Pre-Commit 13-Item Checklist

1. No magic numbers: all values reference design tokens
2. Configuration purity: no side-effects or view logic
3. Modifier correctness: valid fluent API
4. Accessibility identifiers on every interactive element
5. Accessibility traits: correct VoiceOver traits
6. Analytics events tracked per spec
7. Localization: all user-facing strings use keys
8. Dark mode renders correctly
9. RTL layout mirrors correctly
10. Dynamic Type scales without breaking
11. Preview coverage: all meaningful variants
12. Code Connect: .figma.swift maps variants
13. FIGMA.md contains variant matrix

### Accessibility Verification

- Identifier on every interactive element
- Minimum tap target: 44x44pt
- VoiceOver labels and hints meaningful
- Dynamic Type: layout must not break at large sizes
