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));
    });
  });
}
