feat: support changing the workspace icon (#4898)

This commit is contained in:
Lucas.Xu
2024-03-15 13:10:30 +07:00
committed by GitHub
parent 8776ac5c36
commit ac34617e51
12 changed files with 269 additions and 42 deletions

View File

@ -29,18 +29,28 @@ async fn af_cloud_workspace_delete() {
}
#[tokio::test]
async fn af_cloud_workspace_name_change() {
async fn af_cloud_workspace_change_name_and_icon() {
user_localhost_af_cloud().await;
let test = EventIntegrationTest::new().await;
let user_profile_pb = test.af_cloud_sign_up().await;
let workspaces = test.get_all_workspaces().await;
let workspace_id = workspaces.items[0].workspace_id.as_str();
let new_workspace_name = "new_workspace_name".to_string();
let new_icon = "🚀".to_string();
test
.rename_workspace(workspace_id, "new_workspace_name")
.rename_workspace(workspace_id, &new_workspace_name)
.await
.expect("failed to rename workspace");
test
.change_workspace_icon(workspace_id, &new_icon)
.await
.expect("failed to change workspace icon");
let workspaces = get_synced_workspaces(&test, user_profile_pb.id).await;
assert_eq!(workspaces[0].name, "new_workspace_name".to_string());
assert_eq!(workspaces[0].name, new_workspace_name);
assert_eq!(workspaces[0].icon, new_icon);
let local_workspaces = test.get_all_workspaces().await;
assert_eq!(local_workspaces.items[0].name, new_workspace_name);
assert_eq!(local_workspaces.items[0].icon, new_icon);
}
#[tokio::test]