-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: refresh user token on local * chore: add test
- Loading branch information
Showing
6 changed files
with
126 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
frontend/rust-lib/event-integration/tests/user/local_test/import_af_data_local_test.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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; | ||
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_history_user_db("./tests/asset", &import_container_name).unwrap(); | ||
let (imported_af_folder_cleaner, imported_af_data_path) = | ||
unzip_history_user_db("./tests/asset", &import_container_name).unwrap(); | ||
|
||
user_localhost_af_cloud().await; | ||
let test = | ||
EventIntegrationTest::new_with_user_data_path(user_db_path.clone(), DEFAULT_NAME.to_string()) | ||
.await; | ||
// In the 040_local, the structure is: | ||
// workspace: | ||
// view: Document1 | ||
// view: Document2 | ||
// view: Grid1 | ||
// view: Grid2 | ||
// Sleep for 2 seconds to wait for the initial workspace to be created | ||
tokio::time::sleep(Duration::from_secs(5)).await; | ||
|
||
test | ||
.import_appflowy_data( | ||
imported_af_data_path.to_str().unwrap().to_string(), | ||
Some(import_container_name.clone()), | ||
) | ||
.await | ||
.unwrap(); | ||
|
||
// after import, the structure is: | ||
// workspace: | ||
// view: Getting Started | ||
// view: 040_local | ||
// view: Document1 | ||
// view: Document2 | ||
// view: Grid1 | ||
// view: Grid2 | ||
let views = test.get_all_workspace_views().await; | ||
assert_eq!(views.len(), 2); | ||
assert_eq!(views[1].name, import_container_name); | ||
|
||
drop(cleaner); | ||
drop(imported_af_folder_cleaner); | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/rust-lib/event-integration/tests/user/local_test/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
mod auth_test; | ||
mod helper; | ||
mod import_af_data_local_test; | ||
mod user_awareness_test; | ||
mod user_profile_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters