Skip to content
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

test: Add permissions and roles e2e tests #4172

Draft
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

novakzaballa
Copy link
Contributor

@novakzaballa novakzaballa commented Jun 17, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Add e2e test for permissions and roles.

Closes #3854

How did you test this code?

We needed the branch test: seed data for permission and roles e2e tests to test it

Copy link

vercel bot commented Jun 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 6:21pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 6:21pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Dec 10, 2024 6:21pm

@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard testing labels Jun 17, 2024
Copy link
Contributor

github-actions bot commented Jun 17, 2024

Uffizzi Ephemeral Environment deployment-58755

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/4172

📄 View Application Logs etc.

What is Uffizzi? Learn more!

@novakzaballa novakzaballa changed the title test: add permissions and roles e2e tests test: Add permissions and roles e2e tests Jun 18, 2024
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.39%. Comparing base (05ab7cf) to head (00f935b).
Report is 20 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #4172    +/-   ##
========================================
  Coverage   97.38%   97.39%            
========================================
  Files        1189     1190     +1     
  Lines       41420    41527   +107     
========================================
+ Hits        40338    40445   +107     
  Misses       1082     1082            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@novakzaballa novakzaballa requested a review from a team as a code owner August 12, 2024 15:56
@novakzaballa novakzaballa requested review from kyle-ssg and removed request for a team August 12, 2024 15:56
@github-actions github-actions bot added testing and removed testing labels Aug 12, 2024
Copy link
Contributor

@zachaysan zachaysan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a lot of code to review, @kyle-ssg. Overall things look good. I've included some comments but I'll leave the final call on them to your discretion. Also, it looks like CI is currently failing, but I'll leave that up to you to fix.

docs/docs/system-administration/rbac.md Outdated Show resolved Hide resolved
Comment on lines 88 to 91
// test('Segment-part-1', async () => {
// await testSegment1()
// await logout()
// })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below, many tests are commented out. Why?

Copy link
Member

@kyle-ssg kyle-ssg Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this is an old pr that I'm still reviving, should have been marked as draft

Comment on lines 141 to 145
//
// test('Environment-permission', async () => {
// await environmentPermissionTest()
// await logout()
// })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another commented out test.

Comment on lines 3 to 4
click, createEnvironment,
log,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't createEnvironment be on its own line?

} from '../helpers.cafe';
import {
PASSWORD,
E2E_NON_ADMIN_USER_WITH_PROJECT_PERMISSIONS, E2E_NON_ADMIN_USER_WITH_ENV_PERMISSIONS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Shouldn't E2E_NON_ADMIN_USER_WITH_ENV_PERMISSIONS be on its own line?

frontend/web/components/UserGroupList.tsx Outdated Show resolved Hide resolved
frontend/web/components/modals/CreateFlag.js Outdated Show resolved Hide resolved
})
}}
}
ds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume ds is a custom prop? If so, a more descriptive name would be good.

frontend/web/components/pages/EnvironmentSettingsPage.js Outdated Show resolved Hide resolved
<div>
<IdentifierString
value={
(identity && identity.identity.identifier) || id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling identity.identity looks weird / wrong.

@github-actions github-actions bot added testing and removed testing labels Dec 10, 2024
@kyle-ssg kyle-ssg marked this pull request as draft December 10, 2024 10:25
@github-actions github-actions bot added testing and removed testing labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end Issue related to the React Front End Dashboard testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add e2e tests for permissions and roles
4 participants