Skip to content

Commit ddc99d6

Browse files
0xkelvinappflowy
andauthored
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 <[email protected]>
1 parent b8f9da6 commit ddc99d6

File tree

1 file changed

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

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,24 @@ async fn grid_switch_from_checkbox_to_text_test() {
264264
// "Yes" -> check
265265
// "" -> unchecked
266266
#[tokio::test]
267-
async fn grid_switch_from_text_to_checkbox_test() {}
267+
async fn grid_switch_from_text_to_checkbox_test() {
268+
let mut test = GridFieldTest::new().await;
269+
let field_rev = test.get_first_field_rev(FieldType::RichText).clone();
270+
271+
let scripts = vec![
272+
SwitchToField {
273+
field_id: field_rev.id.clone(),
274+
new_field_type: FieldType::Checkbox,
275+
},
276+
AssertCellContent {
277+
field_id: field_rev.id.clone(),
278+
row_index: 0,
279+
from_field_type: FieldType::RichText,
280+
expected_content: "".to_string(),
281+
},
282+
];
283+
test.run_scripts(scripts).await;
284+
}
268285

269286
// Test when switching the current field from Date to Text test
270287
// input:

0 commit comments

Comments
 (0)