fix: order workbench modules
This commit is contained in:
@@ -2552,7 +2552,7 @@ func TestServeIMWorkbench(t *testing.T) {
|
||||
oldWorkbench := store.Workbench
|
||||
oldTenants := store.Tenants
|
||||
store.Workbench = &testWorkbenchStore{version: 3, modules: []types.WorkbenchModule{
|
||||
{Code: "organization", Name: "组织架构", Route: "/organization", Enabled: true, Permission: "enabled"},
|
||||
{Code: "organization", Name: "部门框架", Route: "/organization", SortOrder: 40, Enabled: true, Permission: "enabled"},
|
||||
{Code: "external", Name: "外部链接", Route: "https://example.com", Enabled: true, Permission: "enabled"},
|
||||
}}
|
||||
store.Tenants = testTenantStore{tenant: &types.Tenant{ID: 7, Code: "acme", State: types.TenantStateActive}}
|
||||
@@ -2579,7 +2579,7 @@ func TestServeIMWorkbench(t *testing.T) {
|
||||
t.Fatalf("expected external route to be filtered, got %#v", items)
|
||||
}
|
||||
item := items[0].(map[string]any)
|
||||
if item["code"] != "organization" || item["route"] != "/organization" {
|
||||
if item["code"] != "organization" || item["route"] != "/organization" || item["sort_order"].(float64) != 40 {
|
||||
t.Fatalf("unexpected module: %#v", item)
|
||||
}
|
||||
enterprise := data["enterprise"].(map[string]any)
|
||||
|
||||
Reference in New Issue
Block a user