+ 空值单元测试

This commit is contained in:
Max 2021-11-06 15:23:34 +08:00
parent 42262ce799
commit 6d6b807e5a
2 changed files with 19 additions and 0 deletions

View file

@ -26,6 +26,14 @@ func TestColumn(t *testing.T) {
assert.Equal(t, ":logo", column.View.Props["value"])
}
func TestColumnInIsNil(t *testing.T) {
content := `{ "@": "column.创建时间" }`
column := Column{}
jsoniter.Unmarshal([]byte(content), &column)
assert.Equal(t, ":created_at", column.View.Props["value"])
assert.Equal(t, "创建时间", column.Label)
}
func TestFilter(t *testing.T) {
content := `{ "@": "filter.关键词", "in": ["where.name.match"] }`
filter := Filter{}

View file

@ -28,5 +28,16 @@
"maxCount": 1
}
}
},
"创建时间": {
"__comment": "column.创建时间",
"label": "创建时间",
"view": {
"name": "label",
"props": {
"value": ":created_at",
"format": "YYYY年MM月DD日 @hh:mm:ss"
}
}
}
}