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,44 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:marianum_mobile/push/push_registration.dart';
|
||||
|
||||
void main() {
|
||||
group('PushRegistration.endpointChanged', () {
|
||||
const live = 'https://connect.marianum-fulda.de/push-proxy/';
|
||||
const beta = 'https://connect-beta.marianum-fulda.de/push-proxy/';
|
||||
|
||||
test('different registered endpoint forces re-registration', () {
|
||||
expect(
|
||||
PushRegistration.endpointChanged(registered: live, current: beta),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('matching endpoint does not force re-registration', () {
|
||||
expect(
|
||||
PushRegistration.endpointChanged(registered: live, current: live),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
test('missing stored endpoint (pre-tracking install) does not force', () {
|
||||
expect(
|
||||
PushRegistration.endpointChanged(registered: null, current: live),
|
||||
isFalse,
|
||||
);
|
||||
expect(
|
||||
PushRegistration.endpointChanged(registered: '', current: live),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
|
||||
test('nextcloud base URL change is detected the same way', () {
|
||||
expect(
|
||||
PushRegistration.endpointChanged(
|
||||
registered: 'https://cloud.marianum-fulda.de',
|
||||
current: 'https://mhsl.eu/marianum/marianummobile/cloud',
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user