2022-03-12 13:06:15 +00:00
|
|
|
use crate::grid::script::EditorScript::*;
|
|
|
|
use crate::grid::script::*;
|
2022-03-16 02:02:37 +00:00
|
|
|
use chrono::NaiveDateTime;
|
2022-03-14 15:16:25 +00:00
|
|
|
use flowy_grid::services::cell::*;
|
2022-03-15 03:07:18 +00:00
|
|
|
use flowy_grid::services::row::{deserialize_cell_data, serialize_cell_data, CellDataSerde, CreateRowContextBuilder};
|
2022-03-16 02:02:37 +00:00
|
|
|
use flowy_grid_data_model::entities::{
|
|
|
|
CellMetaChangeset, FieldChangeset, FieldType, GridBlock, GridBlockChangeset, RowMetaChangeset,
|
|
|
|
};
|
2022-03-12 13:06:15 +00:00
|
|
|
|
2022-03-12 14:52:24 +00:00
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_create_field() {
|
2022-03-15 11:00:28 +00:00
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-12 14:52:24 +00:00
|
|
|
let text_field = create_text_field();
|
|
|
|
let single_select_field = create_single_select_field();
|
2022-03-15 11:00:28 +00:00
|
|
|
|
2022-03-12 13:06:15 +00:00
|
|
|
let scripts = vec![
|
|
|
|
CreateField {
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: text_field.clone(),
|
2022-03-12 14:52:24 +00:00
|
|
|
},
|
|
|
|
AssertFieldEqual {
|
2022-03-15 11:00:28 +00:00
|
|
|
field_index: test.field_count,
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: text_field,
|
2022-03-12 14:52:24 +00:00
|
|
|
},
|
2022-03-15 11:00:28 +00:00
|
|
|
];
|
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
|
|
|
|
let scripts = vec![
|
2022-03-12 14:52:24 +00:00
|
|
|
CreateField {
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: single_select_field.clone(),
|
2022-03-12 14:52:24 +00:00
|
|
|
},
|
|
|
|
AssertFieldEqual {
|
2022-03-15 11:00:28 +00:00
|
|
|
field_index: test.field_count,
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: single_select_field,
|
2022-03-12 13:06:15 +00:00
|
|
|
},
|
2022-03-12 14:52:24 +00:00
|
|
|
];
|
2022-03-15 11:00:28 +00:00
|
|
|
test.run_scripts(scripts).await;
|
2022-03-12 14:52:24 +00:00
|
|
|
}
|
|
|
|
|
2022-03-13 03:06:28 +00:00
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_create_duplicate_field() {
|
2022-03-15 11:00:28 +00:00
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-13 03:06:28 +00:00
|
|
|
let text_field = create_text_field();
|
2022-03-15 11:00:28 +00:00
|
|
|
let field_count = test.field_count;
|
|
|
|
let expected_field_count = field_count + 1;
|
2022-03-13 03:06:28 +00:00
|
|
|
let scripts = vec![
|
|
|
|
CreateField {
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: text_field.clone(),
|
2022-03-13 03:06:28 +00:00
|
|
|
},
|
|
|
|
CreateField {
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: text_field.clone(),
|
2022-03-13 03:06:28 +00:00
|
|
|
},
|
2022-03-15 11:00:28 +00:00
|
|
|
AssertFieldCount(expected_field_count),
|
2022-03-13 03:06:28 +00:00
|
|
|
];
|
2022-03-15 11:00:28 +00:00
|
|
|
test.run_scripts(scripts).await;
|
2022-03-13 03:06:28 +00:00
|
|
|
}
|
|
|
|
|
2022-03-12 14:52:24 +00:00
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_update_field_with_empty_change() {
|
2022-03-15 11:00:28 +00:00
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-12 14:52:24 +00:00
|
|
|
let single_select_field = create_single_select_field();
|
2022-03-14 09:24:25 +00:00
|
|
|
let changeset = FieldChangeset {
|
2022-03-12 14:52:24 +00:00
|
|
|
field_id: single_select_field.id.clone(),
|
|
|
|
name: None,
|
|
|
|
desc: None,
|
|
|
|
field_type: None,
|
|
|
|
frozen: None,
|
|
|
|
visibility: None,
|
|
|
|
width: None,
|
|
|
|
type_options: None,
|
|
|
|
};
|
|
|
|
|
|
|
|
let scripts = vec![
|
2022-03-12 13:06:15 +00:00
|
|
|
CreateField {
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: single_select_field.clone(),
|
2022-03-12 14:52:24 +00:00
|
|
|
},
|
2022-03-14 09:24:25 +00:00
|
|
|
UpdateField { changeset },
|
2022-03-12 14:52:24 +00:00
|
|
|
AssertFieldEqual {
|
2022-03-15 11:00:28 +00:00
|
|
|
field_index: test.field_count,
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: single_select_field,
|
2022-03-12 14:52:24 +00:00
|
|
|
},
|
|
|
|
];
|
2022-03-15 11:00:28 +00:00
|
|
|
test.run_scripts(scripts).await;
|
2022-03-12 14:52:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_update_field() {
|
2022-03-15 11:00:28 +00:00
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-12 14:52:24 +00:00
|
|
|
let single_select_field = create_single_select_field();
|
|
|
|
let mut cloned_field = single_select_field.clone();
|
|
|
|
|
|
|
|
let mut single_select_type_options = SingleSelectDescription::from(&single_select_field);
|
|
|
|
single_select_type_options.options.push(SelectOption::new("Unknown"));
|
2022-03-14 09:24:25 +00:00
|
|
|
let changeset = FieldChangeset {
|
2022-03-12 14:52:24 +00:00
|
|
|
field_id: single_select_field.id.clone(),
|
|
|
|
name: None,
|
|
|
|
desc: None,
|
|
|
|
field_type: None,
|
|
|
|
frozen: Some(true),
|
|
|
|
visibility: None,
|
|
|
|
width: Some(1000),
|
|
|
|
type_options: Some(single_select_type_options.clone().into()),
|
|
|
|
};
|
|
|
|
|
|
|
|
cloned_field.frozen = true;
|
|
|
|
cloned_field.width = 1000;
|
|
|
|
cloned_field.type_options = single_select_type_options.into();
|
|
|
|
|
|
|
|
let scripts = vec![
|
|
|
|
CreateField {
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: single_select_field.clone(),
|
2022-03-12 14:52:24 +00:00
|
|
|
},
|
2022-03-14 09:24:25 +00:00
|
|
|
UpdateField { changeset },
|
2022-03-12 14:52:24 +00:00
|
|
|
AssertFieldEqual {
|
2022-03-15 11:00:28 +00:00
|
|
|
field_index: test.field_count,
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: cloned_field,
|
2022-03-12 13:06:15 +00:00
|
|
|
},
|
|
|
|
];
|
2022-03-15 11:00:28 +00:00
|
|
|
test.run_scripts(scripts).await;
|
2022-03-12 13:06:15 +00:00
|
|
|
}
|
2022-03-13 03:06:28 +00:00
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_delete_field() {
|
2022-03-15 11:00:28 +00:00
|
|
|
let mut test = GridEditorTest::new().await;
|
|
|
|
let expected_field_count = test.field_count;
|
2022-03-13 03:06:28 +00:00
|
|
|
let text_field = create_text_field();
|
|
|
|
let scripts = vec![
|
|
|
|
CreateField {
|
2022-03-15 03:07:18 +00:00
|
|
|
field_meta: text_field.clone(),
|
2022-03-13 03:06:28 +00:00
|
|
|
},
|
2022-03-15 03:07:18 +00:00
|
|
|
DeleteField { field_meta: text_field },
|
2022-03-15 11:00:28 +00:00
|
|
|
AssertFieldCount(expected_field_count),
|
2022-03-13 03:06:28 +00:00
|
|
|
];
|
2022-03-15 11:00:28 +00:00
|
|
|
test.run_scripts(scripts).await;
|
2022-03-13 03:06:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_create_block() {
|
|
|
|
let grid_block = GridBlock::new();
|
|
|
|
let scripts = vec![
|
|
|
|
AssertBlockCount(1),
|
|
|
|
CreateBlock { block: grid_block },
|
|
|
|
AssertBlockCount(2),
|
|
|
|
];
|
|
|
|
GridEditorTest::new().await.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_update_block() {
|
|
|
|
let grid_block = GridBlock::new();
|
|
|
|
let mut cloned_grid_block = grid_block.clone();
|
2022-03-14 09:24:25 +00:00
|
|
|
let changeset = GridBlockChangeset {
|
2022-03-13 03:06:28 +00:00
|
|
|
block_id: grid_block.id.clone(),
|
|
|
|
start_row_index: Some(2),
|
|
|
|
row_count: Some(10),
|
|
|
|
};
|
|
|
|
|
|
|
|
cloned_grid_block.start_row_index = 2;
|
|
|
|
cloned_grid_block.row_count = 10;
|
|
|
|
|
|
|
|
let scripts = vec![
|
|
|
|
AssertBlockCount(1),
|
|
|
|
CreateBlock { block: grid_block },
|
2022-03-14 09:24:25 +00:00
|
|
|
UpdateBlock { changeset },
|
2022-03-13 03:06:28 +00:00
|
|
|
AssertBlockCount(2),
|
|
|
|
AssertBlockEqual {
|
|
|
|
block_index: 1,
|
|
|
|
block: cloned_grid_block,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
GridEditorTest::new().await.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_create_row() {
|
2022-03-14 09:24:25 +00:00
|
|
|
let scripts = vec![AssertRowCount(3), CreateEmptyRow, CreateEmptyRow, AssertRowCount(5)];
|
2022-03-13 03:06:28 +00:00
|
|
|
GridEditorTest::new().await.run_scripts(scripts).await;
|
|
|
|
}
|
2022-03-14 09:24:25 +00:00
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_create_row2() {
|
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-15 03:07:18 +00:00
|
|
|
let create_row_context = CreateRowContextBuilder::new(&test.field_metas).build();
|
2022-03-14 09:24:25 +00:00
|
|
|
let scripts = vec![
|
|
|
|
AssertRowCount(3),
|
|
|
|
CreateRow {
|
|
|
|
context: create_row_context,
|
|
|
|
},
|
|
|
|
AssertRowCount(4),
|
|
|
|
];
|
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_update_row() {
|
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-15 03:07:18 +00:00
|
|
|
let context = CreateRowContextBuilder::new(&test.field_metas).build();
|
2022-03-14 09:24:25 +00:00
|
|
|
let changeset = RowMetaChangeset {
|
|
|
|
row_id: context.row_id.clone(),
|
|
|
|
height: None,
|
|
|
|
visibility: None,
|
|
|
|
cell_by_field_id: Default::default(),
|
|
|
|
};
|
|
|
|
|
|
|
|
let scripts = vec![
|
|
|
|
AssertRowCount(3),
|
|
|
|
CreateRow { context },
|
|
|
|
UpdateRow {
|
|
|
|
changeset: changeset.clone(),
|
|
|
|
},
|
|
|
|
AssertRow { changeset },
|
|
|
|
AssertRowCount(4),
|
|
|
|
];
|
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_delete_row() {
|
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-15 03:07:18 +00:00
|
|
|
let context_1 = CreateRowContextBuilder::new(&test.field_metas).build();
|
|
|
|
let context_2 = CreateRowContextBuilder::new(&test.field_metas).build();
|
2022-03-14 09:24:25 +00:00
|
|
|
let row_ids = vec![context_1.row_id.clone(), context_2.row_id.clone()];
|
|
|
|
let scripts = vec![
|
|
|
|
AssertRowCount(3),
|
|
|
|
CreateRow { context: context_1 },
|
|
|
|
CreateRow { context: context_2 },
|
|
|
|
AssertBlockCount(1),
|
|
|
|
AssertBlock {
|
|
|
|
block_index: 0,
|
|
|
|
row_count: 5,
|
|
|
|
start_row_index: 0,
|
|
|
|
},
|
|
|
|
DeleteRow { row_ids },
|
|
|
|
AssertBlock {
|
|
|
|
block_index: 0,
|
|
|
|
row_count: 3,
|
|
|
|
start_row_index: 0,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
2022-03-16 02:02:37 +00:00
|
|
|
async fn grid_row_add_cells_test() {
|
2022-03-14 09:24:25 +00:00
|
|
|
let mut test = GridEditorTest::new().await;
|
2022-03-15 03:07:18 +00:00
|
|
|
let mut builder = CreateRowContextBuilder::new(&test.field_metas);
|
|
|
|
for field in &test.field_metas {
|
2022-03-14 09:24:25 +00:00
|
|
|
match field.field_type {
|
|
|
|
FieldType::RichText => {
|
2022-03-15 03:07:18 +00:00
|
|
|
let data = serialize_cell_data("hello world", field).unwrap();
|
2022-03-16 02:02:37 +00:00
|
|
|
builder.add_cell(&field.id, data).unwrap();
|
2022-03-14 09:24:25 +00:00
|
|
|
}
|
|
|
|
FieldType::Number => {
|
2022-03-15 03:07:18 +00:00
|
|
|
let data = serialize_cell_data("¥18,443", field).unwrap();
|
2022-03-16 02:02:37 +00:00
|
|
|
builder.add_cell(&field.id, data).unwrap();
|
2022-03-14 09:24:25 +00:00
|
|
|
}
|
|
|
|
FieldType::DateTime => {
|
2022-03-15 03:07:18 +00:00
|
|
|
let data = serialize_cell_data("1647251762", field).unwrap();
|
2022-03-16 02:02:37 +00:00
|
|
|
builder.add_cell(&field.id, data).unwrap();
|
2022-03-14 15:16:25 +00:00
|
|
|
}
|
|
|
|
FieldType::SingleSelect => {
|
|
|
|
let description = SingleSelectDescription::from(field);
|
|
|
|
let options = description.options.first().unwrap();
|
2022-03-15 03:07:18 +00:00
|
|
|
let data = description.serialize_cell_data(&options.id).unwrap();
|
2022-03-16 02:02:37 +00:00
|
|
|
builder.add_cell(&field.id, data).unwrap();
|
2022-03-14 15:16:25 +00:00
|
|
|
}
|
|
|
|
FieldType::MultiSelect => {
|
|
|
|
let description = MultiSelectDescription::from(field);
|
|
|
|
let options = description
|
|
|
|
.options
|
|
|
|
.iter()
|
|
|
|
.map(|option| option.id.clone())
|
|
|
|
.collect::<Vec<_>>()
|
2022-03-16 02:02:37 +00:00
|
|
|
.join(SELECTION_IDS_SEPARATOR);
|
2022-03-15 03:07:18 +00:00
|
|
|
let data = description.serialize_cell_data(&options).unwrap();
|
2022-03-16 02:02:37 +00:00
|
|
|
builder.add_cell(&field.id, data).unwrap();
|
2022-03-14 09:24:25 +00:00
|
|
|
}
|
|
|
|
FieldType::Checkbox => {
|
2022-03-15 03:07:18 +00:00
|
|
|
let data = serialize_cell_data("false", field).unwrap();
|
2022-03-16 02:02:37 +00:00
|
|
|
builder.add_cell(&field.id, data).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let context = builder.build();
|
|
|
|
let scripts = vec![CreateRow { context }, AssertGridMetaPad];
|
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_row_add_selection_cell_test() {
|
|
|
|
let mut test = GridEditorTest::new().await;
|
|
|
|
let mut builder = CreateRowContextBuilder::new(&test.field_metas);
|
|
|
|
let uuid = uuid::Uuid::new_v4().to_string();
|
|
|
|
let mut single_select_field_id = "".to_string();
|
|
|
|
let mut multi_select_field_id = "".to_string();
|
|
|
|
for field in &test.field_metas {
|
|
|
|
match field.field_type {
|
|
|
|
FieldType::SingleSelect => {
|
|
|
|
single_select_field_id = field.id.clone();
|
|
|
|
// The element must be parsed as uuid
|
|
|
|
assert!(builder.add_cell(&field.id, "data".to_owned()).is_err());
|
|
|
|
// // The data should not be empty
|
|
|
|
assert!(builder.add_cell(&field.id, "".to_owned()).is_err());
|
|
|
|
// The element must be parsed as uuid
|
|
|
|
assert!(builder.add_cell(&field.id, "1,2,3".to_owned()).is_err(),);
|
|
|
|
// The separator must be comma
|
|
|
|
assert!(builder.add_cell(&field.id, format!("{}. {}", &uuid, &uuid),).is_err());
|
|
|
|
//
|
|
|
|
|
|
|
|
assert!(builder.add_cell(&field.id, uuid.clone()).is_ok());
|
|
|
|
assert!(builder.add_cell(&field.id, format!("{}, {}", &uuid, &uuid)).is_ok());
|
|
|
|
}
|
|
|
|
FieldType::MultiSelect => {
|
|
|
|
multi_select_field_id = field.id.clone();
|
|
|
|
assert!(builder.add_cell(&field.id, format!("{}, {}", &uuid, &uuid)).is_ok());
|
2022-03-14 09:24:25 +00:00
|
|
|
}
|
2022-03-16 02:02:37 +00:00
|
|
|
_ => {}
|
2022-03-14 09:24:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
let context = builder.build();
|
2022-03-16 02:02:37 +00:00
|
|
|
assert_eq!(
|
|
|
|
&context
|
|
|
|
.cell_by_field_id
|
|
|
|
.get(&single_select_field_id)
|
|
|
|
.as_ref()
|
|
|
|
.unwrap()
|
|
|
|
.data,
|
|
|
|
&uuid
|
|
|
|
);
|
|
|
|
assert_eq!(
|
|
|
|
context
|
|
|
|
.cell_by_field_id
|
|
|
|
.get(&multi_select_field_id)
|
|
|
|
.as_ref()
|
|
|
|
.unwrap()
|
|
|
|
.data,
|
|
|
|
format!("{},{}", &uuid, &uuid)
|
|
|
|
);
|
|
|
|
|
|
|
|
let scripts = vec![CreateRow { context }];
|
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_row_add_date_cell_test() {
|
|
|
|
let mut test = GridEditorTest::new().await;
|
|
|
|
let mut builder = CreateRowContextBuilder::new(&test.field_metas);
|
|
|
|
let mut date_field = None;
|
|
|
|
let timestamp = 1647390674;
|
|
|
|
for field in &test.field_metas {
|
|
|
|
if field.field_type == FieldType::DateTime {
|
|
|
|
date_field = Some(field.clone());
|
|
|
|
NaiveDateTime::from_timestamp(123, 0);
|
|
|
|
// The data should not be empty
|
|
|
|
assert!(builder.add_cell(&field.id, "".to_owned()).is_err());
|
|
|
|
|
|
|
|
assert!(builder.add_cell(&field.id, "123".to_owned()).is_ok());
|
|
|
|
assert!(builder.add_cell(&field.id, format!("{}", timestamp)).is_ok());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let context = builder.build();
|
|
|
|
let date_field = date_field.unwrap();
|
|
|
|
let cell_data = context.cell_by_field_id.get(&date_field.id).unwrap().clone();
|
|
|
|
assert_eq!(
|
|
|
|
deserialize_cell_data(cell_data.data.clone(), &date_field).unwrap(),
|
|
|
|
"2022/03/16 08:31",
|
|
|
|
);
|
|
|
|
let scripts = vec![CreateRow { context }];
|
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn grid_cell_update() {
|
|
|
|
let mut test = GridEditorTest::new().await;
|
|
|
|
let field_metas = &test.field_metas;
|
|
|
|
let row_metas = &test.row_metas;
|
|
|
|
assert_eq!(row_metas.len(), 3);
|
|
|
|
|
|
|
|
let mut scripts = vec![];
|
|
|
|
for (index, row_meta) in row_metas.iter().enumerate() {
|
|
|
|
for field_meta in field_metas {
|
|
|
|
if index == 0 {
|
|
|
|
let data = match field_meta.field_type {
|
|
|
|
FieldType::RichText => "".to_string(),
|
|
|
|
FieldType::Number => "123".to_string(),
|
|
|
|
FieldType::DateTime => "123".to_string(),
|
|
|
|
FieldType::SingleSelect => {
|
|
|
|
let description = SingleSelectDescription::from(field_meta);
|
|
|
|
description.options.first().unwrap().id.clone()
|
|
|
|
}
|
|
|
|
FieldType::MultiSelect => {
|
|
|
|
let description = MultiSelectDescription::from(field_meta);
|
|
|
|
description.options.first().unwrap().id.clone()
|
|
|
|
}
|
|
|
|
FieldType::Checkbox => "1".to_string(),
|
|
|
|
};
|
|
|
|
|
|
|
|
scripts.push(UpdateCell {
|
|
|
|
changeset: CellMetaChangeset {
|
|
|
|
row_id: row_meta.id.clone(),
|
|
|
|
field_id: field_meta.id.clone(),
|
|
|
|
data: Some(data),
|
|
|
|
},
|
|
|
|
is_err: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if index == 1 {
|
|
|
|
let (data, is_err) = match field_meta.field_type {
|
|
|
|
FieldType::RichText => ("1".to_string().repeat(10001), true),
|
|
|
|
FieldType::Number => ("abc".to_string(), true),
|
|
|
|
FieldType::DateTime => ("abc".to_string(), true),
|
|
|
|
FieldType::SingleSelect => ("abc".to_string(), true),
|
|
|
|
FieldType::MultiSelect => ("abc".to_string(), true),
|
|
|
|
FieldType::Checkbox => ("2".to_string(), false),
|
|
|
|
};
|
|
|
|
|
|
|
|
scripts.push(UpdateCell {
|
|
|
|
changeset: CellMetaChangeset {
|
|
|
|
row_id: row_meta.id.clone(),
|
|
|
|
field_id: field_meta.id.clone(),
|
|
|
|
data: Some(data),
|
|
|
|
},
|
|
|
|
is_err,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-14 09:24:25 +00:00
|
|
|
test.run_scripts(scripts).await;
|
|
|
|
}
|