Skip to content

Commit e5717b8

Browse files
authored
test: grid switch from checkbox to text test (#1612)
1 parent faf8f73 commit e5717b8

File tree

1 file changed

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

1 file changed

+24
-1
lines changed

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,30 @@ async fn grid_switch_from_multi_select_to_text_test() {
234234
// check -> "Yes"
235235
// unchecked -> ""
236236
#[tokio::test]
237-
async fn grid_switch_from_checkbox_to_text_test() {}
237+
async fn grid_switch_from_checkbox_to_text_test() {
238+
let mut test = GridFieldTest::new().await;
239+
let field_rev = test.get_first_field_rev(FieldType::Checkbox);
240+
241+
let scripts = vec![
242+
SwitchToField {
243+
field_id: field_rev.id.clone(),
244+
new_field_type: FieldType::RichText,
245+
},
246+
AssertCellContent {
247+
field_id: field_rev.id.clone(),
248+
row_index: 1,
249+
from_field_type: FieldType::Checkbox,
250+
expected_content: "Yes".to_string(),
251+
},
252+
AssertCellContent {
253+
field_id: field_rev.id.clone(),
254+
row_index: 2,
255+
from_field_type: FieldType::Checkbox,
256+
expected_content: "No".to_string(),
257+
},
258+
];
259+
test.run_scripts(scripts).await;
260+
}
238261

239262
// Test when switching the current field from Checkbox to Text test
240263
// input:

0 commit comments

Comments
 (0)