fix test file bug
This commit is contained in:
parent
d3073bee82
commit
11cf6ff065
2 changed files with 26 additions and 32 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue