database_row_test.dart 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.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('create row of the grid', (tester) async {
  10. await tester.initializeAppFlowy();
  11. await tester.tapGoButton();
  12. await tester.createNewPageWithName(layout: ViewLayoutPB.Grid);
  13. await tester.tapCreateRowButtonInGrid();
  14. // The initial number of rows is 3
  15. await tester.assertNumberOfRowsInGridPage(4);
  16. await tester.pumpAndSettle();
  17. });
  18. testWidgets('create row from row menu of the grid', (tester) async {
  19. await tester.initializeAppFlowy();
  20. await tester.tapGoButton();
  21. await tester.createNewPageWithName(layout: ViewLayoutPB.Grid);
  22. await tester.hoverOnFirstRowOfGrid();
  23. await tester.tapCreateRowButtonInRowMenuOfGrid();
  24. // The initial number of rows is 3
  25. await tester.assertNumberOfRowsInGridPage(4);
  26. await tester.assertRowCountInGridPage(4);
  27. await tester.pumpAndSettle();
  28. });
  29. testWidgets('delete row of the grid', (tester) async {
  30. await tester.initializeAppFlowy();
  31. await tester.tapGoButton();
  32. await tester.createNewPageWithName(layout: ViewLayoutPB.Grid);
  33. await tester.hoverOnFirstRowOfGrid();
  34. // Open the row menu and then click the delete
  35. await tester.tapRowMenuButtonInGrid();
  36. await tester.tapDeleteOnRowMenu();
  37. // The initial number of rows is 3
  38. await tester.assertNumberOfRowsInGridPage(2);
  39. await tester.assertRowCountInGridPage(2);
  40. await tester.pumpAndSettle();
  41. });
  42. testWidgets('check number of row indicator in the initial grid',
  43. (tester) async {
  44. await tester.initializeAppFlowy();
  45. await tester.tapGoButton();
  46. await tester.createNewPageWithName(layout: ViewLayoutPB.Grid);
  47. await tester.assertRowCountInGridPage(3);
  48. await tester.pumpAndSettle();
  49. });
  50. });
  51. }