Chore: Ensure we save correct default admin user in integration test DB setup (#105752)
* fix helper + amend tests * fix import + remove unused var * remove more users * remove unused code * update test comment
This commit is contained in:
@@ -535,7 +535,7 @@ func (c *K8sTestHelper) LoadYAMLOrJSON(body string) *unstructured.Unstructured {
|
||||
func (c *K8sTestHelper) createTestUsers(orgName string) OrgUsers {
|
||||
c.t.Helper()
|
||||
users := OrgUsers{
|
||||
Admin: c.CreateUser("admin", orgName, org.RoleAdmin, nil),
|
||||
Admin: c.CreateUser("admin2", orgName, org.RoleAdmin, nil),
|
||||
Editor: c.CreateUser("editor", orgName, org.RoleEditor, nil),
|
||||
Viewer: c.CreateUser("viewer", orgName, org.RoleViewer, nil),
|
||||
}
|
||||
|
||||
@@ -83,10 +83,13 @@ func TestIntegrationIdentity(t *testing.T) {
|
||||
// Get just the specs (avoids values that change with each deployment)
|
||||
found = teamClient.SpecJSON(rsp)
|
||||
require.JSONEq(t, `[
|
||||
{},
|
||||
{
|
||||
"email": "admin-1",
|
||||
"login": "admin-1"
|
||||
"email": "admin@localhost",
|
||||
"login": "admin"
|
||||
},
|
||||
{
|
||||
"email": "admin2-1",
|
||||
"login": "admin2-1"
|
||||
},
|
||||
{
|
||||
"email": "editor-1",
|
||||
@@ -111,20 +114,20 @@ func TestIntegrationIdentity(t *testing.T) {
|
||||
found = teamClient.SpecJSON(rsp)
|
||||
require.JSONEq(t, `[
|
||||
{
|
||||
"email": "admin-1",
|
||||
"login": "admin-1"
|
||||
"email": "admin2-1",
|
||||
"login": "admin2-1"
|
||||
},
|
||||
{
|
||||
"email": "admin-3",
|
||||
"login": "admin-3"
|
||||
"email": "admin2-2",
|
||||
"login": "admin2-2"
|
||||
},
|
||||
{
|
||||
"email": "editor-3",
|
||||
"login": "editor-3"
|
||||
"email": "editor-2",
|
||||
"login": "editor-2"
|
||||
},
|
||||
{
|
||||
"email": "viewer-3",
|
||||
"login": "viewer-3"
|
||||
"email": "viewer-2",
|
||||
"login": "viewer-2"
|
||||
}
|
||||
]`, found)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user