feat: add new group (#3854)

* feat: implement backend logic

* fix: did_create_row not working properly

* fix: did_delete_group not working properly

* fix: test

* chore: fix clippy

* fix: new card not editable and in wrong position

* feat: imlement UI for add new stack

* test: add integration test

* chore: i18n

* chore: remove debug message

* chore: merge conflict

---------

Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
Richard Shiue
2023-11-06 16:17:05 +08:00
committed by GitHub
parent 4d82bb5322
commit c4fc60612f
28 changed files with 674 additions and 138 deletions

View File

@ -67,6 +67,9 @@ pub enum GroupScript {
group_id: String,
group_name: String,
},
CreateGroup {
name: String,
},
}
pub struct DatabaseGroupTest {
@ -269,6 +272,11 @@ impl DatabaseGroupTest {
assert_eq!(group_id, group.group_id, "group index: {}", group_index);
assert_eq!(group_name, group.group_name, "group index: {}", group_index);
},
GroupScript::CreateGroup { name } => self
.editor
.create_group(&self.view_id, &name)
.await
.unwrap(),
}
}

View File

@ -486,3 +486,19 @@ async fn group_group_by_other_field() {
];
test.run_scripts(scripts).await;
}
#[tokio::test]
async fn group_manual_create_new_group() {
let mut test = DatabaseGroupTest::new().await;
let new_group_name = "Resumed";
let scripts = vec![
AssertGroupCount(4),
CreateGroup {
name: new_group_name.to_string(),
},
AssertGroupCount(5),
];
test.run_scripts(scripts).await;
let new_group = test.group_at_index(4).await;
assert_eq!(new_group.group_name, new_group_name);
}