forked from baron/baron-sso
26 lines
743 B
Dart
26 lines
743 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:userfront/features/auth/domain/consent_scope_policy.dart';
|
|
|
|
void main() {
|
|
group('consent scope policy', () {
|
|
test('keeps offline_access visible and filters only offline', () {
|
|
expect(
|
|
filterConsentScopes([
|
|
'openid',
|
|
' offline ',
|
|
'profile',
|
|
'offline_access',
|
|
'email',
|
|
]),
|
|
['openid', 'profile', 'offline_access', 'email'],
|
|
);
|
|
});
|
|
|
|
test('detects offline scope alias case-insensitively', () {
|
|
expect(isOfflineScopeAlias('OFFLINE'), isTrue);
|
|
expect(isOfflineScopeAlias(' offline_access '), isFalse);
|
|
expect(isOfflineScopeAlias('profile'), isFalse);
|
|
});
|
|
});
|
|
}
|