refactor platform menus and entity statuses
This commit is contained in:
@@ -3,6 +3,8 @@ package seed
|
||||
import (
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
"git.apinb.com/heqiapp/platforms/backend/api/internal/logic/common"
|
||||
)
|
||||
|
||||
func TestMockEntityIdentitiesAreStableAndUnique(t *testing.T) {
|
||||
@@ -11,7 +13,7 @@ func TestMockEntityIdentitiesAreStableAndUnique(t *testing.T) {
|
||||
)
|
||||
seen := make(map[string]struct{}, 46)
|
||||
for sequence := 1; sequence <= 46; sequence++ {
|
||||
record := entity(sequence, "enabled")
|
||||
record := entity(sequence, common.StatusEnable)
|
||||
if !identityPattern.MatchString(record.Identity) {
|
||||
t.Fatalf("entity(%d) identity = %q", sequence, record.Identity)
|
||||
}
|
||||
@@ -19,7 +21,7 @@ func TestMockEntityIdentitiesAreStableAndUnique(t *testing.T) {
|
||||
t.Fatalf("duplicate identity %q", record.Identity)
|
||||
}
|
||||
seen[record.Identity] = struct{}{}
|
||||
if record.Status != "enabled" || record.Version != 1 {
|
||||
if record.Status != common.StatusEnable || record.Version != 1 {
|
||||
t.Fatalf("entity(%d) has unexpected defaults: %#v", sequence, record)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user