瀏覽代碼

test: grid switch from checkbox to text test (#1612)

Kelvin 2 年之前
父節點
當前提交
e5717b834d
共有 1 個文件被更改,包括 24 次插入1 次删除
  1. 24 1
      frontend/rust-lib/flowy-grid/tests/grid/field_test/test.rs

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

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