Skip to content

test: complete E2E test coverage — 106 tests#21

Open
HMAKT99 wants to merge 1 commit into
mainfrom
feature/complete-e2e-tests
Open

test: complete E2E test coverage — 106 tests#21
HMAKT99 wants to merge 1 commit into
mainfrom
feature/complete-e2e-tests

Conversation

@HMAKT99
Copy link
Copy Markdown
Owner

@HMAKT99 HMAKT99 commented Apr 18, 2026

Summary

  • Adds 10 new tests across 3 files, bringing the total to 106 tests (all passing)
  • Fills gaps in edge case coverage, failure paths, and ProximityMonitor (previously 0 tests)

DaemonCoordinatorTests (+3)

  • authLateResponseAfterTimeoutIsNoOp — companion response after timeout is silently dropped; OnceContinuation does not double-resume
  • authBLESendFailureResultsInImmediateFailure — BLE send failure fast-fails without waiting the full timeout
  • authResponseWithWrongDeviceIDIsIgnored — spoofed response with unknown deviceID is dropped; correct response still wins

EndToEndTests (+3)

  • fullEndToEndFailsWithBadSignature — signing with an unregistered key returns PAM failure
  • fullEndToEndConcurrentRequests — 3 parallel PAM connections all succeed and produce 3 audit entries
  • fullEndToEndAuditEntryFields — validates every field of the audit entry (sessionID, surface, requestingProcess, result, authType, latencyMs, companionDevice)

ProximityMonitorTests (new file, +4)

  • Lock not triggered when monitor is disabled
  • Lock triggered after disconnect delay
  • Lock cancelled on reconnect before deadline fires
  • Lock cancelled on disable() before deadline fires

Test plan

  • CI passes on this branch
  • cd daemon && swift test → 106 tests, 0 failures

…total)

DaemonCoordinatorTests (+3):
- authLateResponseAfterTimeoutIsNoOp: confirms OnceContinuation handles
  late responses after timeout without crashing
- authBLESendFailureResultsInImmediateFailure: fast-fails when BLE send
  returns false instead of waiting the full timeout
- authResponseWithWrongDeviceIDIsIgnored: spoofed response with unknown
  deviceID is dropped; correct response still resolves auth

EndToEndTests (+3):
- fullEndToEndFailsWithBadSignature: wrong signing key -> PAM failure
- fullEndToEndConcurrentRequests: 3 parallel PAM connections all succeed
- fullEndToEndAuditEntryFields: validates every field of the audit entry

ProximityMonitorTests (new file, +4):
- Lock not triggered when monitor is disabled
- Lock triggered after disconnect delay
- Lock cancelled on reconnect before deadline
- Lock cancelled on disable() before deadline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant