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.
This commit is contained in:
Taksh 2026-09-12 09:46:13 +05:30
parent e3a65f5d7c
commit 3fa43f6092

View File

@ -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)
}