mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-01 07:53:26 +00:00
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:
parent
e3a65f5d7c
commit
3fa43f6092
@ -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)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user