mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
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:
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user