test: switching_from_text_to_checkbox (#1632)

* feat: switching from text type to checkbox type

* feat: change to use Err(_)

* test: switch from text to checkbox (still need to cover more cases)

Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
Kelvin 2023-01-04 10:19:07 +08:00 committed by GitHub
parent b8f9da6bc7
commit ddc99d646c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,7 +264,24 @@ async fn grid_switch_from_checkbox_to_text_test() {
// "Yes" -> check // "Yes" -> check
// "" -> unchecked // "" -> unchecked
#[tokio::test] #[tokio::test]
async fn grid_switch_from_text_to_checkbox_test() {} async fn grid_switch_from_text_to_checkbox_test() {
let mut test = GridFieldTest::new().await;
let field_rev = test.get_first_field_rev(FieldType::RichText).clone();
let scripts = vec![
SwitchToField {
field_id: field_rev.id.clone(),
new_field_type: FieldType::Checkbox,
},
AssertCellContent {
field_id: field_rev.id.clone(),
row_index: 0,
from_field_type: FieldType::RichText,
expected_content: "".to_string(),
},
];
test.run_scripts(scripts).await;
}
// Test when switching the current field from Date to Text test // Test when switching the current field from Date to Text test
// input: // input: