# Panel System — Test Plan

## Unit tests (in `tests/panel-system.test.js`)

1. `createPanel` returns a panel object with all required fields
2. `destroyPanel` removes the panel from `list()`
3. `float` changes state to 'floating' and emits event
4. `pin` changes state to 'pinned-L' or 'pinned-R'
5. `dock` changes state to 'docked-*'
6. `minimize` changes state to 'minimized' (returns success)
7. `minimize` returns `pro_mode_locked` when `operatingMode === 'pro'`
8. `maximize` changes state to 'maximized'
9. `resize` updates size fields
10. `list` returns all panels
11. `on` registers event listener that fires on state change
12. `collapse` triggers auto-hide on Edge Panel

## Integration tests (in `tests/integration/`)

1. Edge Panel can be created, opened, closed, destroyed via Panel System
2. CMS Panel can be created with 8 tabs
3. Dev Panel can be created with 2 tabs
4. VibeChat transitions between 3 states
5. Custom panel can be created, exported, imported
6. Workspace Preset saves full panel arrangement
7. Mobile 45% rule applies at `window.innerWidth < 600`
8. Pro Mode lock disables minimize on all panels

## Drift-checks (in `tests/drift/`)

1. 15 invariants from §9
2. No panel in invalid state
3. No panel exceeds viewport bounds
4. No panel overlaps another on the same edge
5. Pill state matches panel state
6. Pro Mode lock enforced
7. Edge Panel has 5 tabs (not 14)
8. Edge Panel has no left-dock code paths
9. Edge Panel has no center-float code paths
10. Edge Panel auto-hides within 100ms after action
11. `__fvcmsOpenEdgePanel` defined at boot
12. 6 surfaces in Edge Panel
13. Max 2 columns per surface
14. 5 dead stubs removed (Layers, Layout, AI Chat, FvRE, PB Store, Triggers)
15. Manifest version is 0.9.0

## Pact-checks (in `tests/pact/`)

For each rule in `rules.md`:
- F-Panel-Create-001 ... F-Panel-Event-001: 11 functional rules
- I-Panel-001 ... I-Panel-006: 6 invariant rules
- F-Panel-Mobile-001, I-Panel-Mobile-001: 2 mobile rules
- F-Pro-Lock-001: 1 Pro Mode rule

Total: 20 rules to verify.
