chore: fix database test (#4893)

* chore: fix database test

* chore: clippy

* chore: fmt
This commit is contained in:
Nathan.fooo
2024-03-13 19:39:56 +08:00
committed by GitHub
parent bf70be1841
commit fd81d64a32
11 changed files with 113 additions and 141 deletions

View File

@ -2,8 +2,6 @@ use flowy_database2::entities::FieldType;
use flowy_database2::services::cell::stringify_cell_data;
use flowy_database2::services::field::CHECK;
use flowy_database2::services::share::csv::CSVFormat;
use std::time::Duration;
use tokio::time::sleep;
use crate::database::database_editor::DatabaseEditorTest;
@ -50,9 +48,6 @@ async fn export_and_then_import_meta_csv_test() {
let csv_1 = database.export_csv(format).await.unwrap();
let result = test.import(csv_1.clone(), format).await;
// TODO(nathan): remove this sleep
// workaround for the rows that are created asynchronously
sleep(Duration::from_secs(2)).await;
let database = test.get_database(&result.database_id).await.unwrap();
let fields = database.get_fields(&result.view_id, None);
@ -129,9 +124,6 @@ async fn history_database_import_test() {
"{""data"":""AE"",""field_type"":0}","{""data"":""5"",""field_type"":1}","{""data"":""1671938394"",""field_type"":2}","{""data"":""wQpG"",""field_type"":3}","{""data"":"""",""field_type"":4}","{""data"":""Yes"",""field_type"":5}","{""data"":"""",""field_type"":6}","{""data"":"""",""field_type"":7}"
"#;
let result = test.import(csv.to_string(), format).await;
// TODO(nathan): remove this sleep
// workaround for the rows that are created asynchronously
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
let database = test.get_database(&result.database_id).await.unwrap();
let fields = database.get_fields(&result.view_id, None);