@@ -2,10 +2,11 @@ import { expect, test } from "@playwright/test";
2
2
import {
3
3
createGroup ,
4
4
createOrganization ,
5
+ createOrganizationMember ,
5
6
createUser ,
6
7
setupApiCalls ,
7
8
} from "../api" ;
8
- import { defaultOrganizationName } from "../constants" ;
9
+ import { defaultOrganizationId , defaultOrganizationName } from "../constants" ;
9
10
import { expectUrl } from "../expectUrl" ;
10
11
import { login , randomName , requiresLicense } from "../helpers" ;
11
12
import { beforeCoderTest } from "../hooks" ;
@@ -32,6 +33,11 @@ test("create group", async ({ page }) => {
32
33
33
34
// Create a new organization
34
35
const org = await createOrganization ( ) ;
36
+ const orgUserAdmin = await createOrganizationMember ( {
37
+ [ org . id ] : [ "organization-user-admin" ] ,
38
+ } ) ;
39
+
40
+ await login ( page , orgUserAdmin ) ;
35
41
await page . goto ( `/organizations/${ org . name } ` ) ;
36
42
37
43
// Navigate to groups page
@@ -64,8 +70,7 @@ test("create group", async ({ page }) => {
64
70
await expect ( addedRow ) . toBeVisible ( ) ;
65
71
66
72
// Ensure we can't add a user who isn't in the org
67
- const otherOrg = await createOrganization ( ) ;
68
- const personToReject = await createUser ( otherOrg . id ) ;
73
+ const personToReject = await createUser ( defaultOrganizationId ) ;
69
74
await page
70
75
. getByPlaceholder ( "User email or username" )
71
76
. fill ( personToReject . email ) ;
@@ -93,8 +98,12 @@ test("change quota settings", async ({ page }) => {
93
98
// Create a new organization and group
94
99
const org = await createOrganization ( ) ;
95
100
const group = await createGroup ( org . id ) ;
101
+ const orgUserAdmin = await createOrganizationMember ( {
102
+ [ org . id ] : [ "organization-user-admin" ] ,
103
+ } ) ;
96
104
97
105
// Go to settings
106
+ await login ( page , orgUserAdmin ) ;
98
107
await page . goto ( `/organizations/${ org . name } /groups/${ group . name } ` ) ;
99
108
await page . getByRole ( "button" , { name : "Settings" , exact : true } ) . click ( ) ;
100
109
expectUrl ( page ) . toHavePathName (
0 commit comments