This commit is contained in:
Alfonso Grillo
2023-01-30 17:45:10 +01:00
parent ce6799f1b1
commit 1332322df9
5 changed files with 183 additions and 6 deletions
@@ -44,5 +44,15 @@ class MockNotificationSettingsService: NotificationSettingsServiceType, Observab
keywords.remove(keyword)
}
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result<Void, Error>) -> Void)?) { }
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result<Void, Error>) -> Void)?) {
guard let ruleIndex = rules.firstIndex(where: { $0.ruleId == ruleId }) else {
completion?(.failure(NSError(domain: "fake", code: 0)))
return
}
rules[ruleIndex] = MockNotificationPushRule(ruleId: ruleId,
enabled: enabled,
actions: actions)
completion?(.success(()))
}
}