The fast suite in test/integration fakes the nsd plugin, so it can't
prove the OS-level pieces. Add integration_test (run with
`flutter test integration_test -d macos`) covering exactly those:
- Bonjour registration: the WiFi bridge's service resolves through the
real mDNSResponder, the TXT record (ble-service-uuids / mac-address /
serial-number) survives the platform-channel round trip, the
advertised port accepts a real TCP connection and flips the bridge's
isConnected. Withdrawal is proven functionally (port refuses, fresh
browse no longer served) — the in-process nsd browser is unreliable
for removal events on macOS.
- UI → wire: drives the real Smart Trainer details page (tap "Virtual
Shifting", confirm the consent dialog) and verifies actual mDNS
packets for the service type and the concrete instance name on the
224.0.0.251:5353 multicast group via a raw UDP sniffer, which also
multicasts a real PTR question to elicit an on-wire answer. "No
connection" stops the bridge again.
The BLE upstream is faked (no hardware / permission prompts); prefs are
kept in-memory so runs never touch the real app's storage; the DirCon
port range is rebased away from a possibly-running live app. All tests
live in one file: launching the macOS app twice back-to-back trips a
flutter-tool relaunch flake. First run prompts for the macOS "Local
Network" permission, which must be granted manually.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>