database_setting_test.dart 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
  2. import 'package:flutter_test/flutter_test.dart';
  3. import 'package:integration_test/integration_test.dart';
  4. import 'util/database_test_op.dart';
  5. import 'util/util.dart';
  6. void main() {
  7. IntegrationTestWidgetsFlutterBinding.ensureInitialized();
  8. group('grid', () {
  9. testWidgets('update layout', (tester) async {
  10. await tester.initializeAppFlowy();
  11. await tester.tapGoButton();
  12. await tester.tapAddButton();
  13. await tester.tapCreateGridButton();
  14. // open setting
  15. await tester.tapDatabaseSettingButton();
  16. // select the layout
  17. await tester.tapDatabaseLayoutButton();
  18. // select layout by board
  19. await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Board);
  20. await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Board);
  21. await tester.pumpAndSettle();
  22. });
  23. testWidgets('update layout multiple times', (tester) async {
  24. await tester.initializeAppFlowy();
  25. await tester.tapGoButton();
  26. await tester.tapAddButton();
  27. await tester.tapCreateGridButton();
  28. // open setting
  29. await tester.tapDatabaseSettingButton();
  30. await tester.tapDatabaseLayoutButton();
  31. await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Board);
  32. await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Board);
  33. await tester.tapDatabaseSettingButton();
  34. await tester.tapDatabaseLayoutButton();
  35. await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Calendar);
  36. await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Calendar);
  37. await tester.pumpAndSettle();
  38. });
  39. });
  40. }