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

e2e test for organization users page #1467

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/components/organization-invitation-list/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
<AkTable data-test-invitation-list as |t|>
<t.head data-test-invitation-list-thead @columns={{this.columns}} />
<t.body @rows={{pgc.currentPageResults}} as |b|>
<b.row data-test-invitation-list-row as |r|>
<b.row
data-test-cy='invite-list-row'
data-test-invitation-list-row
as |r|
>
<r.cell data-test-invitation-list-cell as |value|>
{{#if r.columnValue.component}}
{{#let (component r.columnValue.component) as |Component|}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{! @glint-nocheck: perform }}
<AkIconButton
data-test-invitation-delete-btn
data-test-cy='invite-delete-btn'
title='{{t "deleteInvitation"}}'
aria-label='{{t "deleteInvitation"}}'
{{on 'click' this.openDeleteInvitationConfirmBox}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{{#if this.isAddingTeamMember}}
<AkLoader @size={{16}} class="my-1 mr-2" />
<AkLoader @size={{16}} class='my-1 mr-2' />
{{else}}
<AkIconButton
data-test-addToTeam-btn
class="mr-1"
data-test-cy='add-to-team-btn'
class='mr-1'
title='{{t "addToTeams"}}'
{{on 'click' (perform this.addTeamMember)}}
>
Expand Down
11 changes: 9 additions & 2 deletions app/components/organization-member/list/add-to-team/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
>
<AkButton
data-test-addToTeam-titleBtn
data-test-cy='add-to-team-back-btn'
@variant='text'
@typographyVariant='h5'
@underline='none'
Expand All @@ -20,7 +21,7 @@
<AkTypography @color='textPrimary' @fontWeight='medium'>
{{@member.member.username}}
</AkTypography>
<AkTypography @color='textPrimary' class="ml-1">
<AkTypography @color='textPrimary' class='ml-1'>
({{@member.member.email}})
</AkTypography>
</AkStack>
Expand Down Expand Up @@ -79,7 +80,13 @@

{{else}}
<div>
<AkTable @dense={{true}} class='px-3' data-test-teamList-table as |t|>
<AkTable
@dense={{true}}
class='px-3'
data-test-cy='teamList-table'
data-test-teamList-table
as |t|
>
<t.head data-test-teamList-thead @columns={{this.columns}} />
<t.body @rows={{pgc.currentPageResults}} as |b|>
<b.row data-test-teamList-row as |r|>
Expand Down
10 changes: 8 additions & 2 deletions app/components/organization-member/list/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div local-class='search-input'>
<AkTextField
data-test-user-search-input
@placeholder='Search user'
@placeholder={{t 'searchUser'}}
@value={{@queryParams.user_query}}
{{on 'keyup' this.searchUserForQuery}}
>
Expand Down Expand Up @@ -74,11 +74,17 @@
</AkStack>

{{else}}
<AkTable @hoverable={{true}} data-test-org-user-table as |t|>
<AkTable
data-test-cy='org-user-table'
data-test-org-user-table
@hoverable={{true}}
as |t|
>
<t.head data-test-org-user-thead @columns={{this.columns}} />
<t.body @rows={{pgc.currentPageResults}} as |b|>
<b.row
data-test-org-user-row
data-test-cy='org-user-row'
class={{unless b.rowValue.member.isActive 'user-disabled'}}
{{style cursor='pointer'}}
@onClick={{this.handleShowUserDetails}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@

{{else}}
<div>
<AkTable @dense={{true}} class='px-3' data-test-teamList-table as |t|>
<AkTable
data-test-cy='teamList-table'
@dense={{true}}
class='px-3'
data-test-teamList-table
as |t|
>
<t.head data-test-teamList-thead @columns={{this.columns}} />
<t.body @rows={{pgc.currentPageResults}} as |b|>
<b.row data-test-teamList-row as |r|>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<AkIconButton
data-test-remove-user
data-test-cy='remove-user'
title='{{t "removeFromTeam"}}'
class="mr-1"
class='mr-1'
{{on 'click' this.openRemoveMemberPrompt}}
>
<AkIcon @iconName='person-remove' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<AkIconButton
data-test-member-drawer-close-btn
data-test-cy='member-drawer-close-btn'
{{on 'click' dr.closeHandler}}
class={{ab.classes.defaultIconBtn}}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{#if this.me.org.is_owner}}
<AkStack @justifyContent='center' data-test-member-role-dropdown>
<AkSelect
data-test-cy='user-role-select'
@triggerClass='user-role-select-trigger'
@disabled={{this.userDisabled}}
@selected={{this.selectedRole}}
Expand Down
28 changes: 28 additions & 0 deletions cypress/support/api.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,32 @@ export const API_ROUTES = {
route: '/api/service_accounts/*',
alias: 'serviceAccount',
},
editUserInfo: {
route: '/api/organizations/*/users/*',
alias: 'editUser',
},
membersList: {
route: '/api/organizations/*/members*',
alias: 'membersList',
},
member: {
route: '/api/organizations/*/members/*',
alias: 'member',
},
teamExcludesUser: {
route: '/api/organizations/*/teams?exclude_user=*',
alias: 'teamExcludesUser',
},
teamIncludesUser: {
route: '/api/organizations/*/teams?include_user=*',
alias: 'teamIncludesUser',
},
teamMembers: {
route: '/api/organizations/*/teams/*/members/*',
alias: 'teamMembers',
},
inviteUser: {
route: '/api/organizations/*/invitations',
alias: 'inviteUser',
},
} as const;
2 changes: 2 additions & 0 deletions cypress/support/application.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export const APPLICATION_ROUTES = {
sbom: '/dashboard/sbom/apps',
serviceAccount: '/dashboard/organization/settings/service-account',
register: '/register',
organizationUsers: '/dashboard/organization/users',
organizationTeams: '/dashboard/organization/teams',
} as const;
Loading
Loading