mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
b8983e4466
* feat: add language selector on welcome page * feat: add hover effect and refactor layout * test: add basic languge selector testing * chore: increate place holder width * fix: add catch error for setLocale and finish the testing * chore: update comment * feat: refactor the skip login in page and add tests --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
46 lines
1.4 KiB
Dart
46 lines
1.4 KiB
Dart
import 'package:appflowy/workspace/presentation/settings/widgets/settings_language_view.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:integration_test/integration_test.dart';
|
|
|
|
import 'util/util.dart';
|
|
|
|
void main() {
|
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
group('document', () {
|
|
const location = 'appflowy';
|
|
|
|
setUpAll(() async {
|
|
await TestFolder.setTestLocation(location);
|
|
});
|
|
|
|
tearDownAll(() async {
|
|
await TestFolder.cleanTestLocation(null);
|
|
});
|
|
|
|
testWidgets(
|
|
'change the language successfully when launching the app for the first time',
|
|
(tester) async {
|
|
await tester.initializeAppFlowy();
|
|
|
|
await tester.tapLanguageSelectorOnWelcomePage();
|
|
expect(find.byType(LanguageItemsListView), findsOneWidget);
|
|
|
|
await tester.tapLanguageItem(languageCode: 'zh', countryCode: 'CN');
|
|
tester.expectToSeeText('开始');
|
|
|
|
await tester.tapLanguageItem(languageCode: 'en', scrollDelta: -100);
|
|
tester.expectToSeeText('Quick Start');
|
|
|
|
await tester.tapLanguageItem(languageCode: 'it', countryCode: 'IT');
|
|
tester.expectToSeeText('Andiamo');
|
|
});
|
|
|
|
/// Make sure this test is executed after the test above.
|
|
testWidgets('check the language after relaunching the app', (tester) async {
|
|
await tester.initializeAppFlowy();
|
|
tester.expectToSeeText('Andiamo');
|
|
});
|
|
});
|
|
}
|