fix(test): unblock Click V2 handshake in emulation profile integration tests

ZwiftClickV2.shouldAutoConnect gates connect() on ClickV2Onboarding.isPending,
which reads true from this suite's empty-prefs setUp (env.resetState()).
That held both Click V2 sides out of the connect queue, so connect() returned
early and the handshake write these tests wait for never arrived, timing out.
Mark onboarding done in setUp so the gate doesn't interfere with tests that
exercise a connected controller's button/profile behaviour.
This commit is contained in:
Jonas Bark
2026-08-03 16:26:31 +02:00
parent 37152aafbe
commit e74c5920fb

View File

@@ -31,6 +31,14 @@ Future<void> main() async {
// doesn't, does that). Initialize it here so Click V2 button presses
// don't hit a LateInitializationError.
propPrefs.initialize(core.settings.prefs);
// These tests exercise a *connected* Click V2's button/profile behaviour;
// the unlock-mode onboarding gate (ClickV2Onboarding.isPending) is
// orthogonal to that. env.resetState() starts from empty prefs, so
// isPending would otherwise read true and ZwiftClickV2.shouldAutoConnect
// would hold the controller out of the connect queue -- connect() returns
// early, no BLE link opens, and the handshake write these tests wait for
// never arrives. Mark onboarding done so the gate doesn't interfere.
await core.settings.setClickV2OnboardingDone(true);
stubActions = StubActions();
stubActions.supportedApp = Zwift();
core.actionHandler = stubActions;