mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
This reverts commit c1006c18c3
.
This commit is contained in:
@ -3,11 +3,11 @@ use event_integration::EventIntegrationTest;
|
||||
use flowy_core::DEFAULT_NAME;
|
||||
use flowy_user::entities::AuthenticatorPB;
|
||||
|
||||
use crate::util::unzip;
|
||||
use crate::util::unzip_history_user_db;
|
||||
|
||||
#[tokio::test]
|
||||
async fn reading_039_anon_user_data_test() {
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", "039_local").unwrap();
|
||||
let (cleaner, user_db_path) = unzip_history_user_db("./tests/asset", "039_local").unwrap();
|
||||
let test =
|
||||
EventIntegrationTest::new_with_user_data_path(user_db_path, DEFAULT_NAME.to_string()).await;
|
||||
let first_level_views = test.get_all_workspace_views().await;
|
||||
@ -42,7 +42,7 @@ async fn reading_039_anon_user_data_test() {
|
||||
|
||||
#[tokio::test]
|
||||
async fn migrate_anon_user_data_to_af_cloud_test() {
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", "040_local").unwrap();
|
||||
let (cleaner, user_db_path) = unzip_history_user_db("./tests/asset", "040_local").unwrap();
|
||||
// In the 040_local, the structure is:
|
||||
// workspace:
|
||||
// view: Document1
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::util::unzip;
|
||||
use crate::util::unzip_history_user_db;
|
||||
use assert_json_diff::assert_json_include;
|
||||
use collab_database::rows::database_row_document_id_from_row_id;
|
||||
use collab_entity::CollabType;
|
||||
@ -13,7 +13,8 @@ use std::env::temp_dir;
|
||||
async fn import_appflowy_data_need_migration_test() {
|
||||
// In 037, the workspace array will be migrated to view.
|
||||
let import_container_name = "037_local".to_string();
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", &import_container_name).unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap();
|
||||
// Getting started
|
||||
// Document1
|
||||
// Document2(fav)
|
||||
@ -52,7 +53,8 @@ async fn import_appflowy_data_need_migration_test() {
|
||||
#[tokio::test]
|
||||
async fn import_appflowy_data_folder_into_new_view_test() {
|
||||
let import_container_name = "040_local".to_string();
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", &import_container_name).unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap();
|
||||
// In the 040_local, the structure is:
|
||||
// workspace:
|
||||
// view: Document1
|
||||
@ -120,7 +122,8 @@ async fn import_appflowy_data_folder_into_new_view_test() {
|
||||
#[tokio::test]
|
||||
async fn import_appflowy_data_folder_into_current_workspace_test() {
|
||||
let import_container_name = "040_local".to_string();
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", &import_container_name).unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap();
|
||||
// In the 040_local, the structure is:
|
||||
// workspace:
|
||||
// view: Document1
|
||||
@ -167,7 +170,8 @@ async fn import_appflowy_data_folder_into_current_workspace_test() {
|
||||
#[tokio::test]
|
||||
async fn import_appflowy_data_folder_into_new_view_test2() {
|
||||
let import_container_name = "040_local_2".to_string();
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", &import_container_name).unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap();
|
||||
user_localhost_af_cloud().await;
|
||||
let test = EventIntegrationTest::new_with_name(DEFAULT_NAME).await;
|
||||
let _ = test.af_cloud_sign_up().await;
|
||||
@ -206,7 +210,8 @@ async fn import_empty_appflowy_data_folder_test() {
|
||||
#[tokio::test]
|
||||
async fn import_appflowy_data_folder_multiple_times_test() {
|
||||
let import_container_name = "040_local_2".to_string();
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", &import_container_name).unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap();
|
||||
// In the 040_local_2, the structure is:
|
||||
// Getting Started
|
||||
// Doc1
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::util::unzip;
|
||||
use crate::util::unzip_history_user_db;
|
||||
use event_integration::user_event::user_localhost_af_cloud;
|
||||
use event_integration::EventIntegrationTest;
|
||||
use flowy_core::DEFAULT_NAME;
|
||||
@ -7,9 +7,10 @@ use std::time::Duration;
|
||||
#[tokio::test]
|
||||
async fn import_appflowy_data_folder_into_new_view_test() {
|
||||
let import_container_name = "040_local".to_string();
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", &import_container_name).unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap();
|
||||
let (imported_af_folder_cleaner, imported_af_data_path) =
|
||||
unzip("./tests/asset", &import_container_name).unwrap();
|
||||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap();
|
||||
|
||||
user_localhost_af_cloud().await;
|
||||
let test =
|
||||
|
@ -8,7 +8,7 @@ use flowy_user::event_map::UserEvent::*;
|
||||
#[tokio::test]
|
||||
async fn user_update_with_reminder() {
|
||||
let sdk = EventIntegrationTest::new().await;
|
||||
let _ = sdk.sign_up_as_anon().await;
|
||||
let _ = sdk.sign_up_as_guest().await;
|
||||
let mut meta = HashMap::new();
|
||||
meta.insert("object_id".to_string(), "".to_string());
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
use event_integration::EventIntegrationTest;
|
||||
use flowy_core::DEFAULT_NAME;
|
||||
|
||||
use crate::util::unzip;
|
||||
use crate::util::unzip_history_user_db;
|
||||
|
||||
#[tokio::test]
|
||||
async fn collab_db_restore_test() {
|
||||
let (cleaner, user_db_path) = unzip(
|
||||
let (cleaner, user_db_path) = unzip_history_user_db(
|
||||
"./tests/user/migration_test/history_user_db",
|
||||
"038_collab_db_corrupt_restore",
|
||||
)
|
||||
|
@ -2,11 +2,11 @@ use event_integration::EventIntegrationTest;
|
||||
use flowy_core::DEFAULT_NAME;
|
||||
use flowy_folder::entities::ViewLayoutPB;
|
||||
|
||||
use crate::util::unzip;
|
||||
use crate::util::unzip_history_user_db;
|
||||
|
||||
#[tokio::test]
|
||||
async fn migrate_historical_empty_document_test() {
|
||||
let (cleaner, user_db_path) = unzip(
|
||||
let (cleaner, user_db_path) = unzip_history_user_db(
|
||||
"./tests/user/migration_test/history_user_db",
|
||||
"historical_empty_document",
|
||||
)
|
||||
|
@ -3,11 +3,11 @@ use flowy_core::DEFAULT_NAME;
|
||||
use flowy_folder::entities::ViewLayoutPB;
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::util::unzip;
|
||||
use crate::util::unzip_history_user_db;
|
||||
|
||||
#[tokio::test]
|
||||
async fn migrate_020_historical_empty_document_test() {
|
||||
let (cleaner, user_db_path) = unzip(
|
||||
let (cleaner, user_db_path) = unzip_history_user_db(
|
||||
"./tests/user/migration_test/history_user_db",
|
||||
"020_historical_user_data",
|
||||
)
|
||||
@ -43,7 +43,7 @@ async fn migrate_020_historical_empty_document_test() {
|
||||
#[tokio::test]
|
||||
async fn migrate_036_fav_v1_workspace_array_test() {
|
||||
// Used to test migration: FavoriteV1AndWorkspaceArrayMigration
|
||||
let (cleaner, user_db_path) = unzip(
|
||||
let (cleaner, user_db_path) = unzip_history_user_db(
|
||||
"./tests/user/migration_test/history_user_db",
|
||||
"036_fav_v1_workspace_array",
|
||||
)
|
||||
@ -65,7 +65,7 @@ async fn migrate_036_fav_v1_workspace_array_test() {
|
||||
#[tokio::test]
|
||||
async fn migrate_038_trash_test() {
|
||||
// Used to test migration: WorkspaceTrashMapToSectionMigration
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", "038_local").unwrap();
|
||||
let (cleaner, user_db_path) = unzip_history_user_db("./tests/asset", "038_local").unwrap();
|
||||
// Getting started
|
||||
// Document1
|
||||
// Document2(deleted)
|
||||
@ -102,7 +102,8 @@ async fn migrate_038_trash_test() {
|
||||
#[tokio::test]
|
||||
async fn migrate_038_trash_test2() {
|
||||
// Used to test migration: WorkspaceTrashMapToSectionMigration
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", "038_document_with_grid").unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", "038_document_with_grid").unwrap();
|
||||
// Getting started
|
||||
// document
|
||||
// grid
|
||||
@ -130,7 +131,7 @@ async fn migrate_038_trash_test2() {
|
||||
#[tokio::test]
|
||||
async fn collab_db_backup_test() {
|
||||
// Used to test migration: WorkspaceTrashMapToSectionMigration
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", "038_local").unwrap();
|
||||
let (cleaner, user_db_path) = unzip_history_user_db("./tests/asset", "038_local").unwrap();
|
||||
let test =
|
||||
EventIntegrationTest::new_with_user_data_path(user_db_path, DEFAULT_NAME.to_string()).await;
|
||||
|
||||
@ -148,7 +149,8 @@ async fn collab_db_backup_test() {
|
||||
#[tokio::test]
|
||||
async fn delete_outdated_collab_db_backup_test() {
|
||||
// Used to test migration: WorkspaceTrashMapToSectionMigration
|
||||
let (cleaner, user_db_path) = unzip("./tests/asset", "040_collab_backups").unwrap();
|
||||
let (cleaner, user_db_path) =
|
||||
unzip_history_user_db("./tests/asset", "040_collab_backups").unwrap();
|
||||
let test =
|
||||
EventIntegrationTest::new_with_user_data_path(user_db_path, DEFAULT_NAME.to_string()).await;
|
||||
|
||||
|
@ -120,7 +120,7 @@ async fn third_party_sign_up_with_duplicated_email() {
|
||||
#[tokio::test]
|
||||
async fn sign_up_as_guest_and_then_update_to_new_cloud_user_test() {
|
||||
if get_supabase_config().is_some() {
|
||||
let test = EventIntegrationTest::new_anon().await;
|
||||
let test = EventIntegrationTest::new_with_guest_user().await;
|
||||
let old_views = test
|
||||
.folder_manager
|
||||
.get_current_workspace_views()
|
||||
@ -151,7 +151,7 @@ async fn sign_up_as_guest_and_then_update_to_new_cloud_user_test() {
|
||||
#[tokio::test]
|
||||
async fn sign_up_as_guest_and_then_update_to_existing_cloud_user_test() {
|
||||
if get_supabase_config().is_some() {
|
||||
let test = EventIntegrationTest::new_anon().await;
|
||||
let test = EventIntegrationTest::new_with_guest_user().await;
|
||||
let uuid = uuid::Uuid::new_v4().to_string();
|
||||
|
||||
let email = format!("{}@appflowy.io", nanoid!(6));
|
||||
@ -172,7 +172,7 @@ async fn sign_up_as_guest_and_then_update_to_existing_cloud_user_test() {
|
||||
// sign out and then sign in as a guest
|
||||
test.sign_out().await;
|
||||
|
||||
let _sign_up_context = test.sign_up_as_anon().await;
|
||||
let _sign_up_context = test.sign_up_as_guest().await;
|
||||
let new_workspace = test.folder_manager.get_current_workspace().await.unwrap();
|
||||
test
|
||||
.create_view(&new_workspace.id, "new workspace child view".to_string())
|
||||
@ -253,7 +253,7 @@ async fn update_user_profile_with_existing_email_test() {
|
||||
async fn migrate_anon_document_on_cloud_signup() {
|
||||
if get_supabase_config().is_some() {
|
||||
let test = EventIntegrationTest::new().await;
|
||||
let user_profile = test.sign_up_as_anon().await.user_profile;
|
||||
let user_profile = test.sign_up_as_guest().await.user_profile;
|
||||
|
||||
let view = test
|
||||
.create_view(&user_profile.workspace_id, "My first view".to_string())
|
||||
@ -292,7 +292,7 @@ async fn migrate_anon_document_on_cloud_signup() {
|
||||
#[tokio::test]
|
||||
async fn migrate_anon_data_on_cloud_signup() {
|
||||
if get_supabase_config().is_some() {
|
||||
let (cleaner, user_db_path) = unzip(
|
||||
let (cleaner, user_db_path) = unzip_history_user_db(
|
||||
"./tests/user/supabase_test/history_user_db",
|
||||
"workspace_sync",
|
||||
)
|
||||
|
Reference in New Issue
Block a user