Фикс: 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

@@ -667,11 +667,15 @@ struct PushInAppBannerSuppressionExtendedTests {
@Test("Muted but NOT active — still suppressed")
func mutedNotActiveSuppressed() {
clearState()
shared?.set(["02muted_only"], forKey: "muted_chats_keys")
// Production checks DialogRepository (in-memory), not UserDefaults.
DialogRepository.shared.ensureDialog(
opponentKey: "02muted_only", title: "", username: "", myPublicKey: "me"
)
DialogRepository.shared.toggleMute(opponentKey: "02muted_only")
#expect(InAppNotificationManager.shouldSuppress(senderKey: "02muted_only") == true)
shared?.removeObject(forKey: "muted_chats_keys")
DialogRepository.shared.toggleMute(opponentKey: "02muted_only")
}
@Test("Active but NOT muted — suppressed (active chat open)")
@@ -690,11 +694,12 @@ struct PushInAppBannerSuppressionExtendedTests {
#expect(InAppNotificationManager.shouldSuppress(senderKey: "02normal") == false)
}
@Test("System presentation returns banner+sound for non-suppressed chats")
@Test("System presentation suppresses all foreground notifications (Telegram parity)")
func systemPresentationShowsBanner() {
clearState()
// Telegram parity: all foreground notifications suppressed messages arrive via WebSocket.
let options = AppDelegate.foregroundPresentationOptions(for: ["dialog": "02any_user"])
#expect(options == [.banner, .sound])
#expect(options == [])
}
}