Restore the panic gesture setting in two wipe tests from main

Main added two tests that complete a wipe after this branch started,
and both left panic.gestureMode armed. They now restore it like the
others; the async one restores before its next await.
This commit is contained in:
Jozef Koval 2026-11-02 18:14:19 +01:00
parent fae6bcebd6
commit 627baaa64d
2 changed files with 5 additions and 0 deletions

View File

@ -2455,6 +2455,8 @@ struct ChatViewModelPanicTests {
@Test @MainActor
func panicClearAllData_wipesTheLocationStateOfItsOwnManager() throws {
let gestureMode = PanicGestureModeSnapshot()
defer { gestureMode.restore() }
// Where the device has been, persisted the way the location manager
// writes it: a teleport and a bookmark.
let suiteName = "ChatViewModelPanicTests.\(UUID().uuidString)"

View File

@ -334,7 +334,10 @@ struct ConversationUIModelTests {
// The wipe reseeds every geohash identity and returns to the mesh,
// which takes the retired key out of the memo too.
let gestureMode = PanicGestureModeSnapshot()
viewModel.panicClearAllData()
// Before the next `await`, so no other test can save the armed value.
gestureMode.restore()
#expect(await TestHelpers.waitUntil({ uiModel.ownGeoChatSender == nil }, timeout: TestConstants.settleTimeout))
Self.show(geohash: Self.geohash, in: viewModel)
let newHex = try Self.myGeoHex(viewModel)