mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-31 18:15:09 +00:00 
			
		
		
		
	 61fd608200
			
		
	
	
		61fd608200
		
			
		
	
	
	
	
		
			
			* refactor: rename structs * chore: read database id from view * chore: fix open database error because of create a database view for database id * chore: fix tests * chore: rename datbase id to view id in flutter * refactor: move grid and board to database view folder * refactor: rename functions * refactor: move calender to datbase view folder * refactor: rename app_flowy to appflowy_flutter * chore: reanming * chore: fix freeze gen * chore: remove todos * refactor: view process events * chore: add link database test * chore: just open view if there is opened database
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use crate::database::block_test::script::DatabaseRowTest;
 | |
| use crate::database::block_test::script::RowScript::*;
 | |
| 
 | |
| use database_model::{DatabaseBlockMetaRevision, DatabaseBlockMetaRevisionChangeset};
 | |
| 
 | |
| #[tokio::test]
 | |
| async fn grid_create_block() {
 | |
|   let block_meta_rev = DatabaseBlockMetaRevision::new();
 | |
|   let scripts = vec![
 | |
|     AssertBlockCount(1),
 | |
|     CreateBlock {
 | |
|       block: block_meta_rev,
 | |
|     },
 | |
|     AssertBlockCount(2),
 | |
|   ];
 | |
|   DatabaseRowTest::new().await.run_scripts(scripts).await;
 | |
| }
 | |
| 
 | |
| #[tokio::test]
 | |
| async fn grid_update_block() {
 | |
|   let block_meta_rev = DatabaseBlockMetaRevision::new();
 | |
|   let mut cloned_grid_block = block_meta_rev.clone();
 | |
|   let changeset = DatabaseBlockMetaRevisionChangeset {
 | |
|     block_id: block_meta_rev.block_id.clone(),
 | |
|     start_row_index: Some(2),
 | |
|     row_count: Some(10),
 | |
|   };
 | |
| 
 | |
|   cloned_grid_block.start_row_index = 2;
 | |
|   cloned_grid_block.row_count = 10;
 | |
| 
 | |
|   let scripts = vec![
 | |
|     AssertBlockCount(1),
 | |
|     CreateBlock {
 | |
|       block: block_meta_rev,
 | |
|     },
 | |
|     UpdateBlock { changeset },
 | |
|     AssertBlockCount(2),
 | |
|     AssertBlockEqual {
 | |
|       block_index: 1,
 | |
|       block: cloned_grid_block,
 | |
|     },
 | |
|   ];
 | |
|   DatabaseRowTest::new().await.run_scripts(scripts).await;
 | |
| }
 |