fix: rust unit test

This commit is contained in:
appflowy 2022-06-02 20:24:25 +08:00
parent cad5e5d718
commit 481fd9df51
3 changed files with 4 additions and 3 deletions

View File

@ -219,6 +219,7 @@ class _GridCellContext<T, D> extends Equatable {
}
void dispose() {
_cellListener.stop();
_loadDataOperation?.cancel();
_saveDataOperation?.cancel();

View File

@ -358,7 +358,7 @@ impl std::convert::From<DateCellContentChangeset> for CellContentChangeset {
mod tests {
use crate::services::field::FieldBuilder;
use crate::services::field::{DateCellContentChangeset, DateCellData, DateFormat, DateTypeOption, TimeFormat};
use crate::services::row::{CellDataOperation, EncodedCellData};
use crate::services::row::CellDataOperation;
use flowy_grid_data_model::entities::{FieldMeta, FieldType, TypeOptionDataEntry};
use strum::IntoEnumIterator;

View File

@ -80,10 +80,10 @@ mod tests {
// date
let field_type = FieldType::DateTime;
let date_time_field_meta = FieldBuilder::from_field_type(&field_type).build();
let json = serde_json::to_string(&DateCellDataSerde::new(1647251762, None)).unwrap();
assert_eq!(
type_option
.decode_cell_data(json, &field_type, &date_time_field_meta)
.decode_cell_data(1647251762.to_string(), &field_type, &date_time_field_meta)
.unwrap()
.parse::<DateCellData>()
.unwrap()