mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: type option transform for checklists (#4779)
This commit is contained in:
parent
2d6856a23d
commit
01f2b15f70
@ -73,6 +73,7 @@ impl TypeOptionTransform for RichTextTypeOption {
|
||||
|| transformed_field_type.is_multi_select()
|
||||
|| transformed_field_type.is_number()
|
||||
|| transformed_field_type.is_url()
|
||||
|| transformed_field_type.is_checklist()
|
||||
{
|
||||
Some(StrCellData::from(stringify_cell_data(
|
||||
cell,
|
||||
|
@ -206,7 +206,7 @@ async fn grid_switch_from_multi_select_to_text_test() {
|
||||
// Test when switching the current field from Checkbox to Text test
|
||||
// input:
|
||||
// check -> "Yes"
|
||||
// unchecked -> ""
|
||||
// unchecked -> "No"
|
||||
#[tokio::test]
|
||||
async fn grid_switch_from_checkbox_to_text_test() {
|
||||
let mut test = DatabaseFieldTest::new().await;
|
||||
@ -290,3 +290,24 @@ async fn grid_switch_from_number_to_text_test() {
|
||||
|
||||
test.run_scripts(scripts).await;
|
||||
}
|
||||
|
||||
/// Test when switching the current field from Checklist to Text test
|
||||
#[tokio::test]
|
||||
async fn grid_switch_from_checklist_to_text_test() {
|
||||
let mut test = DatabaseFieldTest::new().await;
|
||||
let field_rev = test.get_first_field(FieldType::Checklist);
|
||||
|
||||
let scripts = vec![
|
||||
SwitchToField {
|
||||
field_id: field_rev.id.clone(),
|
||||
new_field_type: FieldType::RichText,
|
||||
},
|
||||
AssertCellContent {
|
||||
field_id: field_rev.id.clone(),
|
||||
row_index: 0,
|
||||
from_field_type: FieldType::Checklist,
|
||||
expected_content: "First thing".to_string(),
|
||||
},
|
||||
];
|
||||
test.run_scripts(scripts).await;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user