From 6d6b807e5a4439af7f21298010f29773a4392dc2 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 6 Nov 2021 15:23:34 +0800 Subject: [PATCH] =?UTF-8?q?+=20=E7=A9=BA=E5=80=BC=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- share/importable_test.go | 8 ++++++++ tests/libs/column.json | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/share/importable_test.go b/share/importable_test.go index ad8543bc..5ab658b0 100644 --- a/share/importable_test.go +++ b/share/importable_test.go @@ -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{} diff --git a/tests/libs/column.json b/tests/libs/column.json index 69426bbb..8e7d8b1b 100644 --- a/tests/libs/column.json +++ b/tests/libs/column.json @@ -28,5 +28,16 @@ "maxCount": 1 } } + }, + "创建时间": { + "__comment": "column.创建时间", + "label": "创建时间", + "view": { + "name": "label", + "props": { + "value": ":created_at", + "format": "YYYY年MM月DD日 @hh:mm:ss" + } + } } }