From 11cf6ff065fab835cd63c422a9022d6a9a768d9a Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 28 Sep 2021 16:51:04 +0800 Subject: [PATCH] fix test file bug --- global/load_test.go | 26 ++++++++++++++++++++++++++ table/table_test.go | 32 -------------------------------- 2 files changed, 26 insertions(+), 32 deletions(-) delete mode 100644 table/table_test.go diff --git a/global/load_test.go b/global/load_test.go index d49e5f60..25901c0c 100644 --- a/global/load_test.go +++ b/global/load_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/yaoapp/xiang/table" ) func TestLoad(t *testing.T) { @@ -44,3 +45,28 @@ func TestLoadAppFS(t *testing.T) { }) }) } + +func TestTableLoad(t *testing.T) { + + table, has := table.Tables["service"] + assert.Equal(t, table.Table, "service") + assert.True(t, has) + + _, has = table.Columns["id"] + assert.True(t, has) + + price, has := table.Columns["计费方式"] + assert.True(t, has) + if has { + assert.True(t, price.Edit.Props["multiple"].(bool)) + } + + _, has = table.Filters["id"] + assert.True(t, has) + + keywords, has := table.Filters["关键词"] + assert.True(t, has) + if has { + assert.True(t, keywords.Bind == "where.name.like") + } +} diff --git a/table/table_test.go b/table/table_test.go deleted file mode 100644 index a17065fc..00000000 --- a/table/table_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package table - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestLoad(t *testing.T) { - - table, has := Tables["service"] - assert.Equal(t, table.Table, "service") - assert.True(t, has) - - _, has = table.Columns["id"] - assert.True(t, has) - - price, has := table.Columns["计费方式"] - assert.True(t, has) - if has { - assert.True(t, price.Edit.Props["multiple"].(bool)) - } - - _, has = table.Filters["id"] - assert.True(t, has) - - keywords, has := table.Filters["关键词"] - assert.True(t, has) - if has { - assert.True(t, keywords.Bind == "where.name.like") - } -}