2023-06-14 22:16:33 +08:00
|
|
|
import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
|
2023-12-31 07:29:40 +08:00
|
|
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
2023-06-14 22:16:33 +08:00
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:integration_test/integration_test.dart';
|
|
|
|
|
2023-11-27 18:54:31 -08:00
|
|
|
import '../util/database_test_op.dart';
|
|
|
|
import '../util/util.dart';
|
2023-06-14 22:16:33 +08:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
|
|
group('grid', () {
|
|
|
|
testWidgets('update layout', (tester) async {
|
|
|
|
await tester.initializeAppFlowy();
|
|
|
|
await tester.tapGoButton();
|
|
|
|
|
2023-12-27 11:42:39 +08:00
|
|
|
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
|
2023-06-14 22:16:33 +08:00
|
|
|
|
|
|
|
// open setting
|
|
|
|
await tester.tapDatabaseSettingButton();
|
|
|
|
// select the layout
|
|
|
|
await tester.tapDatabaseLayoutButton();
|
|
|
|
// select layout by board
|
|
|
|
await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Board);
|
|
|
|
await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Board);
|
|
|
|
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
});
|
|
|
|
|
|
|
|
testWidgets('update layout multiple times', (tester) async {
|
|
|
|
await tester.initializeAppFlowy();
|
|
|
|
await tester.tapGoButton();
|
|
|
|
|
2023-12-27 11:42:39 +08:00
|
|
|
await tester.createNewPageWithNameUnderParent(layout: ViewLayoutPB.Grid);
|
2023-06-14 22:16:33 +08:00
|
|
|
|
|
|
|
// open setting
|
|
|
|
await tester.tapDatabaseSettingButton();
|
|
|
|
await tester.tapDatabaseLayoutButton();
|
|
|
|
await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Board);
|
|
|
|
await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Board);
|
|
|
|
|
|
|
|
await tester.tapDatabaseSettingButton();
|
|
|
|
await tester.tapDatabaseLayoutButton();
|
|
|
|
await tester.selectDatabaseLayoutType(DatabaseLayoutPB.Calendar);
|
|
|
|
await tester.assertCurrentDatabaseLayoutType(DatabaseLayoutPB.Calendar);
|
|
|
|
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|