tests(e2e): improve coverage

This commit is contained in:
Lucas Nogueira
2026-09-22 21:54:21 -03:00
parent 684feb2510
commit c8c373b48b
50 changed files with 1893 additions and 183 deletions
@@ -120,7 +120,8 @@ func showNotification(invoke: Invoke, notification: Notification)
}
struct CancelArgs: Decodable {
let notifications: [Int]
// `cancelAll()` sends no list: cancel every pending notification
let notifications: [Int]?
}
struct Action: Decodable {
@@ -216,9 +217,13 @@ class NotificationPlugin: Plugin {
@objc func cancel(_ invoke: Invoke) throws {
let args = try invoke.parseArgs(CancelArgs.self)
UNUserNotificationCenter.current().removePendingNotificationRequests(
withIdentifiers: args.notifications.map { String($0) }
)
if let notifications = args.notifications {
UNUserNotificationCenter.current().removePendingNotificationRequests(
withIdentifiers: notifications.map { String($0) }
)
} else {
UNUserNotificationCenter.current().removeAllPendingNotificationRequests()
}
invoke.resolve()
}