implemented an E2E-encrypted Nextcloud push-v2 notification system with support for RSA decryption and signature verification; introduced an iOS Notification Service Extension and native AppDelegate handlers for Talk actions (inline reply and mark-as-read); replaced the legacy notification registration with a new lifecycle managing app passwords and secure keypair storage; added background message handling with tray synchronization and a test notification utility in the settings.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:marianum_mobile/push/push_registration.dart';
|
||||
|
||||
void main() {
|
||||
group('PushRegistration.isPermissionUsable', () {
|
||||
test('explicit denial blocks registration', () {
|
||||
expect(
|
||||
PushRegistration.isPermissionUsable(AuthorizationStatus.denied),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
test('all other statuses allow registration', () {
|
||||
const usable = [
|
||||
AuthorizationStatus.authorized,
|
||||
AuthorizationStatus.provisional,
|
||||
AuthorizationStatus.notDetermined,
|
||||
];
|
||||
for (final status in usable) {
|
||||
expect(
|
||||
PushRegistration.isPermissionUsable(status),
|
||||
isTrue,
|
||||
reason: '$status should be usable',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('covers every AuthorizationStatus value', () {
|
||||
// Guard: if firebase_messaging ever adds a status, revisit the gate.
|
||||
expect(AuthorizationStatus.values, hasLength(4));
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user