mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-06-27 02:50:15 +00:00
chore: create rust test
This commit is contained in:
parent
56bbe29058
commit
14f656be75
@ -1,30 +1,33 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::database::database_editor::DatabaseEditorTest;
|
use crate::database::database_editor::{DatabaseEditorTest, FilterRowChanged};
|
||||||
use collab_database::fields::Field;
|
use collab_database::fields::Field;
|
||||||
use flowy_database2::entities::{CalculationType, FieldType, UpdateCalculationChangesetPB};
|
use flowy_database2::entities::{
|
||||||
|
CalculationType, FieldType, NumberFilterConditionPB, NumberFilterPB, UpdateCalculationChangesetPB,
|
||||||
|
};
|
||||||
use lib_infra::box_any::BoxAny;
|
use lib_infra::box_any::BoxAny;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn calculate_with_filter_test() {
|
async fn calculate_with_filter_test() {
|
||||||
let mut test = DatabaseEditorTest::new_grid().await;
|
let mut test = DatabaseEditorTest::new_grid().await;
|
||||||
|
let row_count = test.rows.len();
|
||||||
|
let expected = 1;
|
||||||
// let sub = test.sdk.notification_sender.subscribe().await.unwrap();
|
// let sub = test.sdk.notification_sender.subscribe().await.unwrap();
|
||||||
|
|
||||||
// Create Number "Equal" filter
|
test
|
||||||
// test
|
.create_data_filter(
|
||||||
// .create_data_filter(
|
None,
|
||||||
// None,
|
FieldType::Number,
|
||||||
// FieldType::Number,
|
BoxAny::new(NumberFilterPB {
|
||||||
// BoxAny::new(NumberFilterPB {
|
condition: NumberFilterConditionPB::Equal,
|
||||||
// condition: NumberFilterConditionPB::Equal,
|
content: "1".to_string(),
|
||||||
// content: "1".to_string(),
|
}),
|
||||||
// }),
|
Some(FilterRowChanged {
|
||||||
// Some(FilterRowChanged {
|
showing_num_of_rows: 0,
|
||||||
// showing_num_of_rows: 0,
|
hiding_num_of_rows: row_count - expected,
|
||||||
// hiding_num_of_rows: row_count - expected,
|
}),
|
||||||
// }),
|
)
|
||||||
// )
|
.await;
|
||||||
// .await;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user