mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: potential test timeout
This commit is contained in:
parent
9ba17e004e
commit
31458e817a
@ -1,6 +1,7 @@
|
||||
use crate::entities::FieldType;
|
||||
use crate::services::cell::{CellBytes, TypeCellData};
|
||||
use crate::services::field::*;
|
||||
use std::cmp::Ordering;
|
||||
use std::fmt::Debug;
|
||||
|
||||
use flowy_error::{ErrorCode, FlowyError, FlowyResult};
|
||||
@ -13,7 +14,7 @@ pub trait CellFilterable<T> {
|
||||
}
|
||||
|
||||
pub trait CellComparable {
|
||||
fn apply_cmp(&self, type_cell_data: &TypeCellData, other_type_cell_data: &TypeCellData) -> FlowyResult<bool>;
|
||||
fn apply_cmp(&self, type_cell_data: &TypeCellData, other_type_cell_data: &TypeCellData) -> FlowyResult<Ordering>;
|
||||
}
|
||||
|
||||
/// Serialize the cell data in Protobuf/String format.
|
||||
|
@ -224,12 +224,20 @@ impl GridFilterTest {
|
||||
assert_eq!(expected_setting, setting);
|
||||
}
|
||||
FilterScript::AssertFilterChanged { visible_row_len, hide_row_len} => {
|
||||
let mut receiver = self.editor.subscribe_view_changed(&self.grid_id).await.unwrap();
|
||||
let editor = self.editor.clone();
|
||||
let view_id = self.view_id();
|
||||
let mut receiver =
|
||||
tokio::spawn(async move {
|
||||
editor.subscribe_view_changed(&view_id).await.unwrap()
|
||||
}).await.unwrap();
|
||||
match tokio::time::timeout(Duration::from_secs(2), receiver.recv()).await {
|
||||
Ok(changed) => match changed.unwrap() { GridViewChanged::DidReceiveFilterResult(changed) => {
|
||||
assert_eq!(changed.visible_rows.len(), visible_row_len, "visible rows not match");
|
||||
assert_eq!(changed.invisible_rows.len(), hide_row_len, "invisible rows not match");
|
||||
} },
|
||||
Ok(changed) => {
|
||||
//
|
||||
match changed.unwrap() { GridViewChanged::DidReceiveFilterResult(changed) => {
|
||||
assert_eq!(changed.visible_rows.len(), visible_row_len, "visible rows not match");
|
||||
assert_eq!(changed.invisible_rows.len(), hide_row_len, "invisible rows not match");
|
||||
} }
|
||||
},
|
||||
Err(e) => {
|
||||
panic!("Process task timeout: {:?}", e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user