import 'package:flutter_test/flutter_test.dart';
import 'package:userfront/features/auth/domain/consent_scope_policy.dart';

void main() {
  group('consent scope policy', () {
    test('filters offline scope aliases from requested consent scopes', () {
      expect(
        filterConsentScopes([
          'openid',
          ' offline ',
          'profile',
          'offline_access',
          'email',
        ]),
        ['openid', 'profile', 'email'],
      );
    });

    test('detects refresh token scope aliases case-insensitively', () {
      expect(isRefreshTokenScopeAlias('OFFLINE'), isTrue);
      expect(isRefreshTokenScopeAlias(' offline_access '), isTrue);
      expect(isRefreshTokenScopeAlias('profile'), isFalse);
    });
  });
}
