Skip to content

Commit aae8259

Browse files
authored
test: grid switch from date to text test (#1616)
* test: grid switch from date to text test * test: change back the DateTime format to US
1 parent 52c8f32 commit aae8259

File tree

1 file changed

+23
-1
lines changed
  • frontend/rust-lib/flowy-grid/tests/grid/field_test

1 file changed

+23
-1
lines changed

frontend/rust-lib/flowy-grid/tests/grid/field_test/test.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,29 @@ async fn grid_switch_from_text_to_checkbox_test() {}
270270
// input:
271271
// 1647251762 -> Mar 14,2022 (This string will be different base on current data setting)
272272
#[tokio::test]
273-
async fn grid_switch_from_date_to_text_test() {}
273+
async fn grid_switch_from_date_to_text_test() {
274+
let mut test = GridFieldTest::new().await;
275+
let field_rev = test.get_first_field_rev(FieldType::DateTime).clone();
276+
let scripts = vec![
277+
SwitchToField {
278+
field_id: field_rev.id.clone(),
279+
new_field_type: FieldType::RichText,
280+
},
281+
AssertCellContent {
282+
field_id: field_rev.id.clone(),
283+
row_index: 2,
284+
from_field_type: FieldType::DateTime,
285+
expected_content: "2022/03/14".to_string(),
286+
},
287+
AssertCellContent {
288+
field_id: field_rev.id.clone(),
289+
row_index: 3,
290+
from_field_type: FieldType::DateTime,
291+
expected_content: "2022/11/17".to_string(),
292+
},
293+
];
294+
test.run_scripts(scripts).await;
295+
}
274296

275297
// Test when switching the current field from Number to Text test
276298
// input:

0 commit comments

Comments
 (0)