Фикс: upload ring progress доходит до 100% + completion notification через userInfo

This commit is contained in:
2026-04-17 08:28:39 +05:00
parent 88126c8673
commit 2adce86528
7 changed files with 109 additions and 25 deletions

View File

@@ -105,15 +105,17 @@ struct ForegroundNotificationTests {
@Test("Muted chat is suppressed")
func mutedChatSuppressed() {
clearActiveDialogs()
// Set up muted chat in App Group
let shared = UserDefaults(suiteName: "group.com.rosetta.dev")
let originalMuted = shared?.stringArray(forKey: "muted_chats_keys")
shared?.set(["02muted"], forKey: "muted_chats_keys")
// Production checks DialogRepository (in-memory), not UserDefaults.
DialogRepository.shared.ensureDialog(
opponentKey: "02muted", title: "", username: "", myPublicKey: "me"
)
DialogRepository.shared.toggleMute(opponentKey: "02muted")
#expect(InAppNotificationManager.shouldSuppress(senderKey: "02muted") == true)
// Restore
shared?.set(originalMuted, forKey: "muted_chats_keys")
// Restore toggleMute back to unmuted, then remove via ensureDialog pattern isn't needed
// since dialogs dict is in-memory and won't persist in test.
DialogRepository.shared.toggleMute(opponentKey: "02muted")
}
@Test("Non-muted chat is NOT suppressed")