twonly-app/test/services/notification_routing_test.dart
otsmr 6f597a08a1
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
improve video, remove deps, fix notifications
2026-08-31 23:00:09 +02:00

24 lines
845 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:twonly/src/services/notifications/native.notifications.dart';
void main() {
test('text notifications open their conversation', () {
expect(NativeNotificationService.opensConversation('text'), isTrue);
expect(NativeNotificationService.opensConversation('response'), isTrue);
});
test('media notifications stay on the chat overview', () {
for (final kind in ['twonly', 'image', 'video', 'audio']) {
expect(
NativeNotificationService.opensConversation(kind),
isFalse,
reason: kind,
);
}
});
test('missing and non-message kinds stay on the chat overview', () {
expect(NativeNotificationService.opensConversation(null), isFalse);
expect(NativeNotificationService.opensConversation('reaction'), isFalse);
});
}