appearance_settings_test.dart 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import 'package:appflowy/workspace/application/settings/prelude.dart';
  2. import 'package:appflowy/workspace/presentation/settings/widgets/settings_appearance_view.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:flutter_test/flutter_test.dart';
  5. import 'package:integration_test/integration_test.dart';
  6. import 'util/util.dart';
  7. void main() {
  8. IntegrationTestWidgetsFlutterBinding.ensureInitialized();
  9. group('appearance settings tests', () {
  10. testWidgets('after editing text field, button should be able to be clicked',
  11. (tester) async {
  12. await tester.initializeAppFlowy();
  13. await tester.tapGoButton();
  14. tester.expectToSeeHomePage();
  15. await tester.openSettings();
  16. await tester.openSettingsPage(SettingsPage.appearance);
  17. final dropDown = find.byKey(ThemeFontFamilySetting.popoverKey);
  18. await tester.tap(dropDown);
  19. await tester.pumpAndSettle();
  20. final textField = find.byKey(ThemeFontFamilySetting.textFieldKey);
  21. await tester.tap(textField);
  22. await tester.pumpAndSettle();
  23. await tester.enterText(textField, 'Abel');
  24. await tester.pumpAndSettle();
  25. final fontFamilyButton = find.byKey(const Key('Abel'));
  26. expect(fontFamilyButton, findsOneWidget);
  27. await tester.tap(fontFamilyButton);
  28. await tester.pumpAndSettle();
  29. // just switch the page and verify that the font family was set after that
  30. await tester.openSettingsPage(SettingsPage.files);
  31. await tester.openSettingsPage(SettingsPage.appearance);
  32. expect(find.textContaining('Abel'), findsOneWidget);
  33. });
  34. });
  35. }