1
0
forked from baron/baron-sso

#269 진행. 리다이렉트 등 파라미터 전체 전달

This commit is contained in:
Lectom C Han
2026-02-19 10:05:07 +09:00
parent 37e8fc4991
commit 7808d81bb4
7 changed files with 349 additions and 38 deletions

View File

@@ -0,0 +1,36 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:userfront/core/i18n/locale_registry.dart';
void main() {
tearDown(() {
LocaleRegistry.resetForTest();
});
group('locale_registry', () {
test(
'extractSupportedLocaleCodesFromAssets excludes template and invalid',
() {
final locales = extractSupportedLocaleCodesFromAssets([
'assets/translations/template.toml',
'assets/translations/en.toml',
'assets/translations/ko.toml',
'assets/translations/pt_BR.toml',
'assets/translations/readme.txt',
'assets/translations/nested/ja.toml',
]);
expect(locales, ['en', 'ko']);
},
);
test('fallback locale prefers en when available', () {
LocaleRegistry.setSupportedLocaleCodesForTest(['ko', 'en']);
expect(LocaleRegistry.fallbackLocaleCode, 'en');
});
test('fallback locale uses first sorted code when en is absent', () {
LocaleRegistry.setSupportedLocaleCodesForTest(['ko', 'ja']);
expect(LocaleRegistry.fallbackLocaleCode, 'ja');
});
});
}