-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(e2e): teamAdmin
permission tests
#2230
Conversation
Removed vultr server and associated DNS entries |
🤖 Hasura Change Summary compared a subset of table metadata including permissions: Updated Tables (1)
|
65422b3
to
cae9bcd
Compare
f456bcb
to
794d305
Compare
- Update planx-core - Move shared helpers - Scope test lifecycle hooks - Add JWT helper methods
- Will look into why husky wasn't picking these up in another PR
- Resolves CVE-2023-26144 - e2e/ui still to do in a follow on PR
f4e0330
to
2df8311
Compare
b6d2314
to
6a562fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for figuring this one out!
Left a few minor questions, but no blockers.
|
||
error?: Error = undefined; | ||
activeUser!: TestUser; | ||
result: any[] | Record<"returning", any[]> | null = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, would love to turn off the type warnings for unexpected any
to make PRs a bit less noisy - I think we can trust each other to catch actually-unnecessary ones in code reviews ?
slug: "team-1-flow", | ||
}); | ||
|
||
const user2Id = await createUser({ email: "[email protected]" }); | ||
const teamId2 = await createTeam({ name: "E2E Team 2", slug: "e2e-team2" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double checking i understand this: in overall setup, we create two users who are by default not a platform admin and they also do not have roles on either teamId1
or teamId2
? then later in individual test suites, you're creating & cleaning up team memberships and toggling permissions?
i'm wondering a bit if it'd be clearer to setup more explicitly with something like e2e-platform-admin@..
etc rather than vague user-1
, user-2
etc? definitely not a showstopper though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I appreciate this is an unclear point - team1 and team2 are quite vague/meaningless names but I needed something to differentiate (I was also considering red/blue or something to make it slightly more distinct).
The intention is that there are -
- Two teams
- One TeamEditor of each team
- We test that teamEditor1 can access team1 resources
- We test that teamEditor2 cannot access team1 resources
I'll add comments to explicitly explain the setup here 👍
@@ -24,26 +28,27 @@ export const cleanup = async () => { | |||
}; | |||
|
|||
export const setup = async () => { | |||
const user1Id = await createUser({ email: "[email protected]" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think helen & mel previously reported an annoying issue where e2e test emails using the @opensystemslab.io domain were causing bounced errors in the enquiries inbox? can we use a harmless @example.com or something instead?
planx-core
planx-core
here for teardown instead of the more manualgraphql-request
approach✅ Regression test run against this branch - https://github.com/theopensystemslab/planx-new/actions/runs/6338450886