From 3fa43f6092c793c272963debfb85848e868b8bd8 Mon Sep 17 00:00:00 2001 From: Taksh Date: Sat, 12 Sep 2026 09:46:13 +0530 Subject: [PATCH] test: set appNapWouldApply in RelayActivityAssertion update tests update() starts from TransportState defaults where nap is false, so setting only bleRelayActive never held the assertion and CI failed. --- bitchatTests/RelayActivityAssertionTests.swift | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/bitchatTests/RelayActivityAssertionTests.swift b/bitchatTests/RelayActivityAssertionTests.swift index eae50788..8731f8dc 100644 --- a/bitchatTests/RelayActivityAssertionTests.swift +++ b/bitchatTests/RelayActivityAssertionTests.swift @@ -190,7 +190,12 @@ struct RelayActivityAssertionTests { let spy = SpyAsserter() let assertion = RelayActivityAssertion(asserter: spy) - assertion.update { $0.bleRelayActive = true } + // update() starts from TransportState defaults (nap=false). Set nap so + // the policy can hold — production always feeds window visibility too. + assertion.update { + $0.appNapWouldApply = true + $0.bleRelayActive = true + } #expect(assertion.isHolding) #expect(spy.beginCount == 1) @@ -206,8 +211,14 @@ struct RelayActivityAssertionTests { let spy = SpyAsserter() let assertion = RelayActivityAssertion(asserter: spy) - assertion.update { $0.bleRelayActive = true } - assertion.update { $0.bleRelayActive = true } + assertion.update { + $0.appNapWouldApply = true + $0.bleRelayActive = true + } + assertion.update { + $0.appNapWouldApply = true + $0.bleRelayActive = true + } #expect(spy.beginCount == 1) }