test: rename group test (#3790)

* refactor: rename group

* test: add rename group test

* chore: add group operation interceptor

* refactor: impl interceptor trait

* chore: update type option when group change

---------

Co-authored-by: Richard Shiue <71320345+richardshiue@users.noreply.github.com>
This commit is contained in:
Nathan.fooo 2023-11-06 14:39:31 +08:00 committed by GitHub
parent eb54cf99d4
commit 2b684ae7bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,30 @@
use event_integration::EventIntegrationTest;
#[tokio::test]
async fn update_group_name_test() {
let test = EventIntegrationTest::new_with_guest_user().await;
let current_workspace = test.get_current_workspace().await.workspace;
let board_view = test
.create_board(&current_workspace.id, "my board view".to_owned(), vec![])
.await;
let groups = test.get_groups(&board_view.id).await;
assert_eq!(groups.len(), 4);
assert_eq!(groups[1].group_name, "To Do");
assert_eq!(groups[2].group_name, "Doing");
test
.update_group(
&board_view.id,
&groups[1].group_id,
&groups[1].field_id,
Some("To Do?".to_string()),
None,
)
.await;
let groups = test.get_groups(&board_view.id).await;
assert_eq!(groups.len(), 4);
assert_eq!(groups[1].group_name, "To Do?");
assert_eq!(groups[2].group_name, "Doing");
}

View File

@ -1 +1,2 @@
mod group_test;
mod test;

View File

@ -306,6 +306,8 @@ impl DatabaseEditor {
Ok(())
}
/// Update the field type option data.
/// Do nothing if the [TypeOptionData] is empty.
pub async fn update_field_type_option(
&self,
view_id: &str,