fix test file bug

This commit is contained in:
Max 2021-09-28 16:51:04 +08:00
parent d3073bee82
commit 11cf6ff065
2 changed files with 26 additions and 32 deletions

View file

@ -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")
}
}

View file

@ -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")
}
}