test: grid switch from multi select to text test (#1608)

This commit is contained in:
Kelvin 2022-12-27 20:08:32 +08:00 committed by GitHub
parent 70689d3239
commit faf8f73206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -202,7 +202,32 @@ async fn grid_switch_from_checkbox_to_select_option_test() {
// input:
// option1, option2 -> "option1.name, option2.name"
#[tokio::test]
async fn grid_switch_from_multi_select_to_text_test() {}
async fn grid_switch_from_multi_select_to_text_test() {
let mut test = GridFieldTest::new().await;
let field_rev = test.get_first_field_rev(FieldType::MultiSelect).clone();
let mut multi_select_type_option = test.get_multi_select_type_option(&field_rev.id);
let script_switchfield = vec![SwitchToField {
field_id: field_rev.id.clone(),
new_field_type: FieldType::RichText,
}];
test.run_scripts(script_switchfield).await;
let script_assertfield = vec![AssertCellContent {
field_id: field_rev.id.clone(),
row_index: 0,
from_field_type: FieldType::MultiSelect,
expected_content: format!(
"{},{}",
multi_select_type_option.get_mut(0).unwrap().id.to_string(),
multi_select_type_option.get_mut(1).unwrap().id.to_string()
),
}];
test.run_scripts(script_assertfield).await;
}
// Test when switching the current field from Checkbox to Text test
// input: