Skip to content

ADR-019 Phase 7: Integration testing and regression verification #644

@amiable-dev

Description

@amiable-dev

Summary

End-to-end integration tests and regression verification for the complete ADR-019 unified filter system. Verify that all linked/unlinked flows, collapsible panes, aggregate metrics, and keyboard shortcuts work together without regressions.

ADR-019 Decisions: All (D1–D12)
Estimate: 3–4h

Prompt

Write integration tests covering the full ADR-019 unified filter lifecycle. Test scenarios: (1) Linked filter propagation — click device in Signal Flow → Events stream filters to same device; (2) Unlink → diverge → re-link snap — unlink, select different devices in each panel, re-link and verify Signal Flow's state wins; (3) Mode pinning — pin to "Live" mode, verify both panels reflect it, verify daemon mode change doesn't override pinned state; (4) Auto-collapse — simulate workspace width <500px, verify filter pane collapses and density switches to compact; (5) Keyboard shortcuts — F, Shift+F, D, L all fire in correct scope and don't fire in text inputs; (6) Aggregate metrics — verify deviceMetrics updates when mappingsStore or signalPulseStore change; (7) Unmapped tagging — verify events get correct _unmapped flag across mode changes; (8) Regression — existing EventFilter tests still pass, existing DeviceStatusPills mute/unmute still works, existing filteredEvents behaviour unchanged for non-device filters.

Test Scenarios

T1: Linked Filter Propagation

1. Set activeDeviceFilter to Set(['mikro-mk3'])
2. Assert signalFlowDeviceFilter resolves to Set(['mikro-mk3'])
3. Assert eventsDeviceFilter resolves to Set(['mikro-mk3'])
4. Assert filteredEvents only contains events from 'mikro-mk3'

T2: Unlink → Diverge → Re-link

1. Set activeDeviceFilter to Set(['mikro-mk3'])
2. Call toggleFiltersLinked() → now unlinked
3. Set eventsDeviceOverride to Set(['launch-control'])
4. Assert signalFlowDeviceFilter still Set(['mikro-mk3'])
5. Assert eventsDeviceFilter now Set(['launch-control'])
6. Call toggleFiltersLinked() → re-link
7. Assert activeDeviceFilter is Set(['mikro-mk3']) (Signal Flow wins)
8. Assert signalFlowDeviceOverride is null
9. Assert eventsDeviceOverride is null

T3: Mode Pinning

1. activeModeFilter is null (current)
2. Set activeModeFilter to 'Live'
3. Simulate daemon mode change to 'Performance'
4. Assert activeModeFilter is still 'Live' (pinned)
5. Set activeModeFilter to null
6. Assert effective mode follows daemon's 'Performance'

T4: Auto-Collapse

1. signalFlowFilterCollapsed is false
2. Simulate resize event with width 480px
3. Assert signalFlowFilterCollapsed is true
4. Assert signalFlowDensity is 'compact'

T5: Keyboard Shortcuts

1. Focus workspace, press 'f' → signalFlowFilterCollapsed toggles
2. Focus sidebar, press Shift+F → eventsFilterCollapsed toggles
3. Press 'l' → filtersLinked toggles
4. Press 'd' → signalFlowDensity cycles
5. Focus <input>, press 'f' → nothing happens (not captured)

T6: Aggregate Metrics

1. Set mappingsStore with 3 Note + 2 CC mappings for Device A
2. Assert deviceMetrics['device-a'].mappingCount === 5
3. Assert deviceMetrics['device-a'].typeDistribution.get('note') === 3
4. Update signalPulseStore with fireRate 12.4 for Device A
5. Assert deviceMetrics['device-a'].fireRate === 12.4
6. Assert sparkline buffer updated

T7: Unmapped Tagging

1. Set up mode with one Note mapping: N36 on device A
2. Push event: Note N36 from device A → _unmapped: false
3. Push event: CC7 from device A → _unmapped: true
4. Change mode (different mappings) → both events re-evaluated

T8: Regressions

1. EventFilter type chip selection: CC → only CC events visible (same as before)
2. EventFilter fired toggle: OFF → fired entries hidden (same as before)
3. EventFilter channel dropdown: Ch.2 → only ch.2 events (same as before)
4. DeviceStatusPills right-click → mute/unmute still works
5. clearEvents() → event buffer and fire state cleared

Acceptance Criteria

  • All 8 test scenarios pass
  • No regressions in existing EventFilter.test.ts test suite
  • No regressions in existing events.test.ts test suite
  • Performance: filteredEvents derivation <1ms with 200 events and 30 mappings
  • Performance: deviceMetrics derivation <1ms with 5 devices and 30 mappings
  • All localStorage/sessionStorage keys round-trip correctly in test environment
  • Keyboard shortcuts tested with focus management simulation

References

  • ADR-019: docs/adrs/ADR-019-unified-workspace-filtering-and-aggregate-metrics.md — All decisions (D1–D12); Implementation Phases table; Specification: full document
  • Mockups: signal-flow-v3-mockups.html — All tabs (S1–S4, Combined) for visual regression comparison
  • Existing tests: conductor-gui/ui/src/lib/stores/events.test.ts, conductor-gui/ui/src/lib/components/EventFilter.test.ts — baseline test suites that must not regress

Dependencies

  • All Phase 1–6 issues must be complete

Metadata

Metadata

Assignees

No one assigned

    Labels

    adr-019ADR-019: Unified Workspace Filtering & Aggregate Metricsphase-7Phase 7testing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions