database_setting_test.dart 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
  2. import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
  3. import 'package:flutter_test/flutter_test.dart';
  4. import 'package:integration_test/integration_test.dart';
  5. import 'util/database_test_op.dart';
  6. import 'util/util.dart';
  7. void main() {
  8. IntegrationTestWidgetsFlutterBinding.ensureInitialized();
  9. group('grid', () {
  10. testWidgets('update layout', (tester) async {
  11. await tester.initializeAppFlowy();
  12. await tester.tapGoButton();
  13. await tester.createNewPageWithName(layout: ViewLayoutPB.Grid);
  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.createNewPageWithName(layout: ViewLayoutPB.Grid);
  27. // open setting
  28. await tester.tapDatabaseSettingButton();
  29. await tester.tapDatabaseLayoutButton();
  30. await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Board);
  31. await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Board);
  32. await tester.tapDatabaseSettingButton();
  33. await tester.tapDatabaseLayoutButton();
  34. await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Calendar);
  35. await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Calendar);
  36. await tester.pumpAndSettle();
  37. });
  38. });
  39. }