forked from baron/baron-sso
feat: i18n 개선 및 userfront 로그인/로케일 보완
This commit is contained in:
@@ -5,15 +5,36 @@
|
||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:userfront/main.dart' show BaronSSOApp;
|
||||
|
||||
class _TestAssetLoader extends AssetLoader {
|
||||
const _TestAssetLoader();
|
||||
|
||||
@override
|
||||
Future<Map<String, dynamic>> load(String path, Locale locale) async {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
testWidgets('BaronSSOApp builds', (WidgetTester tester) async {
|
||||
// runApp에서 ProviderScope로 감싸서 쓰고 있으니 테스트도 동일하게 감쌈
|
||||
await tester.pumpWidget(const ProviderScope(child: BaronSSOApp()));
|
||||
await tester.pumpWidget(
|
||||
EasyLocalization(
|
||||
supportedLocales: const [Locale('en'), Locale('ko')],
|
||||
fallbackLocale: const Locale('en'),
|
||||
startLocale: const Locale('en'),
|
||||
path: 'assets/translations',
|
||||
assetLoader: const _TestAssetLoader(),
|
||||
child: const ProviderScope(child: BaronSSOApp()),
|
||||
),
|
||||
);
|
||||
await tester.pump(); // 한 프레임 더
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user