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
This commit is contained in:
Kelvin 2022-12-30 10:47:32 +08:00 committed by GitHub
parent 52c8f32c82
commit aae8259f63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,7 +270,29 @@ async fn grid_switch_from_text_to_checkbox_test() {}
// input:
// 1647251762 -> Mar 14,2022 (This string will be different base on current data setting)
#[tokio::test]
async fn grid_switch_from_date_to_text_test() {}
async fn grid_switch_from_date_to_text_test() {
let mut test = GridFieldTest::new().await;
let field_rev = test.get_first_field_rev(FieldType::DateTime).clone();
let scripts = vec![
SwitchToField {
field_id: field_rev.id.clone(),
new_field_type: FieldType::RichText,
},
AssertCellContent {
field_id: field_rev.id.clone(),
row_index: 2,
from_field_type: FieldType::DateTime,
expected_content: "2022/03/14".to_string(),
},
AssertCellContent {
field_id: field_rev.id.clone(),
row_index: 3,
from_field_type: FieldType::DateTime,
expected_content: "2022/11/17".to_string(),
},
];
test.run_scripts(scripts).await;
}
// Test when switching the current field from Number to Text test
// input: