mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-30 17:38:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
 | |
| import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
 | |
| import 'package:flutter_test/flutter_test.dart';
 | |
| import 'package:integration_test/integration_test.dart';
 | |
| 
 | |
| import 'util/database_test_op.dart';
 | |
| import 'util/util.dart';
 | |
| 
 | |
| void main() {
 | |
|   IntegrationTestWidgetsFlutterBinding.ensureInitialized();
 | |
| 
 | |
|   group('grid', () {
 | |
|     testWidgets('update layout', (tester) async {
 | |
|       await tester.initializeAppFlowy();
 | |
|       await tester.tapGoButton();
 | |
| 
 | |
|       await tester.createNewPageWithName(layout: ViewLayoutPB.Grid);
 | |
| 
 | |
|       // 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();
 | |
| 
 | |
|       await tester.createNewPageWithName(layout: ViewLayoutPB.Grid);
 | |
| 
 | |
|       // 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();
 | |
|     });
 | |
|   });
 | |
| }
 | 
