From 627baaa64d44e6736e695e4c99930452df24157f Mon Sep 17 00:00:00 2001 From: Jozef Koval Date: Mon, 2 Nov 2026 18:14:19 +0100 Subject: [PATCH] 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. --- bitchatTests/ChatViewModelTests.swift | 2 ++ bitchatTests/ConversationUIModelTests.swift | 3 +++ 2 files changed, 5 insertions(+) diff --git a/bitchatTests/ChatViewModelTests.swift b/bitchatTests/ChatViewModelTests.swift index 5d45d980..34377fff 100644 --- a/bitchatTests/ChatViewModelTests.swift +++ b/bitchatTests/ChatViewModelTests.swift @@ -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)" diff --git a/bitchatTests/ConversationUIModelTests.swift b/bitchatTests/ConversationUIModelTests.swift index a4f90e6c..23bd37ef 100644 --- a/bitchatTests/ConversationUIModelTests.swift +++ b/bitchatTests/ConversationUIModelTests.swift @@ -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)