File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
frontend/rust-lib/flowy-grid/tests/grid/field_test Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,32 @@ async fn grid_switch_from_checkbox_to_select_option_test() {
202202// input:
203203// option1, option2 -> "option1.name, option2.name"
204204#[ tokio:: test]
205- async fn grid_switch_from_multi_select_to_text_test ( ) { }
205+ async fn grid_switch_from_multi_select_to_text_test ( ) {
206+ let mut test = GridFieldTest :: new ( ) . await ;
207+ let field_rev = test. get_first_field_rev ( FieldType :: MultiSelect ) . clone ( ) ;
208+
209+ let mut multi_select_type_option = test. get_multi_select_type_option ( & field_rev. id ) ;
210+
211+ let script_switchfield = vec ! [ SwitchToField {
212+ field_id: field_rev. id. clone( ) ,
213+ new_field_type: FieldType :: RichText ,
214+ } ] ;
215+
216+ test. run_scripts ( script_switchfield) . await ;
217+
218+ let script_assertfield = vec ! [ AssertCellContent {
219+ field_id: field_rev. id. clone( ) ,
220+ row_index: 0 ,
221+ from_field_type: FieldType :: MultiSelect ,
222+ expected_content: format!(
223+ "{},{}" ,
224+ multi_select_type_option. get_mut( 0 ) . unwrap( ) . id. to_string( ) ,
225+ multi_select_type_option. get_mut( 1 ) . unwrap( ) . id. to_string( )
226+ ) ,
227+ } ] ;
228+
229+ test. run_scripts ( script_assertfield) . await ;
230+ }
206231
207232// Test when switching the current field from Checkbox to Text test
208233// input:
You can’t perform that action at this time.
0 commit comments