forked from baron/baron-sso
링크로 로그인 수정
This commit is contained in:
33
userfront/test/login_link_route_policy_test.dart
Normal file
33
userfront/test/login_link_route_policy_test.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:userfront/core/i18n/locale_registry.dart';
|
||||
import 'package:userfront/features/auth/domain/login_link_route_policy.dart';
|
||||
|
||||
void main() {
|
||||
group('login_link_route_policy', () {
|
||||
setUp(() {
|
||||
LocaleRegistry.setSupportedLocaleCodesForTest(['ko', 'en']);
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
LocaleRegistry.resetForTest();
|
||||
});
|
||||
|
||||
test('extracts short code from plain short-code route', () {
|
||||
final shortCode = extractLoginShortCode(Uri.parse('/l/AB123456'));
|
||||
expect(shortCode, 'AB123456');
|
||||
});
|
||||
|
||||
test('extracts short code from localized short-code route', () {
|
||||
final shortCode = extractLoginShortCode(Uri.parse('/ko/l/AB123456'));
|
||||
expect(shortCode, 'AB123456');
|
||||
});
|
||||
|
||||
test('treats localized short-code route as public path', () {
|
||||
final isPublic = isPublicAuthPath(
|
||||
'/l/AB123456',
|
||||
Uri.parse('/ko/l/AB123456'),
|
||||
);
|
||||
expect(isPublic, isTrue);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user