mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: retain last workspace when restart app
This commit is contained in:
parent
7ca3f215a3
commit
3ef7c4990b
@ -51,15 +51,22 @@ async fn af_cloud_workspace_change_name_and_icon() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn af_cloud_create_workspace_test() {
|
async fn af_cloud_create_workspace_test() {
|
||||||
|
let name = uuid::Uuid::new_v4().to_string();
|
||||||
|
let email;
|
||||||
|
let second_workspace_id;
|
||||||
|
|
||||||
|
{
|
||||||
user_localhost_af_cloud().await;
|
user_localhost_af_cloud().await;
|
||||||
let test = EventIntegrationTest::new().await;
|
let test = EventIntegrationTest::new_with_name(name.clone()).await;
|
||||||
let user_profile_pb = test.af_cloud_sign_up().await;
|
let user_profile_pb = test.af_cloud_sign_up().await;
|
||||||
|
email = user_profile_pb.email;
|
||||||
|
|
||||||
let workspaces = test.get_all_workspaces().await.items;
|
let workspaces = test.get_all_workspaces().await.items;
|
||||||
let first_workspace_id = workspaces[0].workspace_id.as_str();
|
let first_workspace_id = workspaces[0].workspace_id.as_str();
|
||||||
assert_eq!(workspaces.len(), 1);
|
assert_eq!(workspaces.len(), 1);
|
||||||
|
|
||||||
let created_workspace = test.create_workspace("my second workspace").await;
|
let created_workspace = test.create_workspace("my second workspace").await;
|
||||||
|
second_workspace_id = created_workspace.workspace_id.clone();
|
||||||
assert_eq!(created_workspace.name, "my second workspace");
|
assert_eq!(created_workspace.name, "my second workspace");
|
||||||
|
|
||||||
let workspaces = get_synced_workspaces(&test, user_profile_pb.id).await;
|
let workspaces = get_synced_workspaces(&test, user_profile_pb.id).await;
|
||||||
@ -89,6 +96,23 @@ async fn af_cloud_create_workspace_test() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Restart the app and read current workspace
|
||||||
|
user_localhost_af_cloud().await;
|
||||||
|
let test = EventIntegrationTest::new_with_name(name).await;
|
||||||
|
test.af_cloud_sign_in_with_email(&email).await.unwrap();
|
||||||
|
let user_profile_pb = test.get_user_profile().await.unwrap();
|
||||||
|
|
||||||
|
let workspaces = get_synced_workspaces(&test, user_profile_pb.id).await;
|
||||||
|
assert_eq!(workspaces.len(), 2);
|
||||||
|
|
||||||
|
{
|
||||||
|
let folder_ws = test.folder_read_current_workspace().await;
|
||||||
|
assert_eq!(folder_ws.id, second_workspace_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn af_cloud_open_workspace_test() {
|
async fn af_cloud_open_workspace_test() {
|
||||||
user_localhost_af_cloud().await;
|
user_localhost_af_cloud().await;
|
||||||
|
Loading…
Reference in New Issue
Block a user