Add iOS notification scheduler

This commit is contained in:
Mikhail Kilin
2026-05-21 15:55:54 +03:00
parent 5a32ee0a4c
commit c12f9f9b78
2 changed files with 62 additions and 0 deletions

View File

@@ -161,6 +161,17 @@ struct TeleTuiIOSSmokeTests {
precondition(policy.shouldNotify(chat: chat, message: incomingMention, mentionOnly: true))
precondition(!policy.shouldNotify(chat: chat, message: incomingPlain, mentionOnly: true))
precondition(!policy.shouldNotify(chat: muted, message: incomingMention, mentionOnly: false))
let scheduler = RecordingNotificationScheduler()
let mentionCoordinator = NotificationCoordinator(scheduler: scheduler, mentionOnly: true)
try await mentionCoordinator.handle(chat: chat, message: incomingPlain)
var scheduledCount = await scheduler.scheduledCount()
precondition(scheduledCount == 0)
try await mentionCoordinator.handle(chat: chat, message: incomingMention)
scheduledCount = await scheduler.scheduledCount()
precondition(scheduledCount == 1)
try await mentionCoordinator.handle(chat: muted, message: incomingMention)
scheduledCount = await scheduler.scheduledCount()
precondition(scheduledCount == 1)
let clipboard = InMemoryClipboardWriter()
await clipboard.write(text: "copied")