AppFlowy/shared-lib/flowy-grid-data-model/tests/serde_test.rs

14 lines
352 B
Rust
Raw Normal View History

use flowy_grid_data_model::revision::*;
2022-03-04 10:11:12 +00:00
#[test]
fn grid_default_serde_test() {
let grid_id = "1".to_owned();
2022-06-15 09:24:46 +00:00
let grid = GridRevision::new(&grid_id);
2022-03-04 10:11:12 +00:00
let json = serde_json::to_string(&grid).unwrap();
2022-07-20 10:47:05 +00:00
assert_eq!(
json,
2022-08-11 13:18:27 +00:00
r#"{"grid_id":"1","fields":[],"blocks":[],"setting":{"layout":0,"filters":[],"groups":[]}}"#
2022-07-20 10:47:05 +00:00
)
2022-03-04 10:11:12 +00:00
}