chore: fix tests

This commit is contained in:
appflowy
2022-07-17 12:57:25 +08:00
parent cca577f967
commit 5ea3213c4e
4 changed files with 12 additions and 11 deletions

View File

@ -9,13 +9,13 @@ use flowy_grid_data_model::revision::RowMetaChangeset;
async fn grid_create_row_count_test() {
let mut test = GridRowTest::new().await;
let scripts = vec![
AssertRowCount(3),
AssertRowCount(5),
CreateEmptyRow,
CreateEmptyRow,
CreateRow {
row_rev: test.row_builder().build(),
},
AssertRowCount(6),
AssertRowCount(8),
];
test.run_scripts(scripts).await;
}
@ -31,11 +31,11 @@ async fn grid_update_row() {
cell_by_field_id: Default::default(),
};
let scripts = vec![AssertRowCount(3), CreateRow { row_rev }, UpdateRow { changeset }];
let scripts = vec![AssertRowCount(5), CreateRow { row_rev }, UpdateRow { changeset }];
test.run_scripts(scripts).await;
let expected_row = test.last_row().unwrap();
let scripts = vec![AssertRow { expected_row }, AssertRowCount(4)];
let scripts = vec![AssertRow { expected_row }, AssertRowCount(6)];
test.run_scripts(scripts).await;
}
@ -46,19 +46,19 @@ async fn grid_delete_row() {
let row_2 = test.row_builder().build();
let row_ids = vec![row_1.id.clone(), row_2.id.clone()];
let scripts = vec![
AssertRowCount(3),
AssertRowCount(5),
CreateRow { row_rev: row_1 },
CreateRow { row_rev: row_2 },
AssertBlockCount(1),
AssertBlock {
block_index: 0,
row_count: 5,
row_count: 7,
start_row_index: 0,
},
DeleteRows { row_ids },
AssertBlock {
block_index: 0,
row_count: 3,
row_count: 5,
start_row_index: 0,
},
];