Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
himdel committed Sep 26, 2023
1 parent 5236562 commit 13d3460
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/containers/namespace-detail/namespace-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -843,10 +843,13 @@ export class NamespaceDetail extends React.Component<RouteProps, IState> {
user: this.filterUser(this.state.params.user, namespace.users),
namespace: {
...namespace,
users: namespace.users.map(({ name, object_roles }) => ({
username: name,
object_roles,
})),
// transform to use username, don't break when missing
users: namespace.users
? namespace.users.map(({ name, object_roles }) => ({
username: name,
object_roles,
}))
: [],
},
showControls: !!myNamespace,
unfilteredCount,
Expand Down
6 changes: 3 additions & 3 deletions test/cypress/e2e/misc/rbac_access.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ function testAccessTab({
.parent('.pf-c-alert')
.find('button')
.click();
cy.get('tr[data-cy="AccessTab-row-access_group"]');
cy.get('tr[data-cy="AccessTab-row-group-access_group"]');

// group list view, try modal, open group
cy.get('button').contains('Select a group').click();
cy.get('.pf-c-wizard__footer-cancel').click();

cy.get('tr[data-cy="AccessTab-row-access_group"] a').click();
cy.get('tr[data-cy="AccessTab-row-group-access_group"] a').click();

// role list view, use modal
cy.get(`[data-cy="RoleListTable-ExpandableRow-row-${role}"]`);
Expand Down Expand Up @@ -179,7 +179,7 @@ function testAccessTab({

// list view, delete, see empty
cy.get(
'tr[data-cy="AccessTab-row-access_group"] [data-cy=kebab-toggle] button',
'tr[data-cy="AccessTab-row-group-access_group"] [data-cy=kebab-toggle] button',
).click();
cy.get('.pf-c-dropdown__menu-item').contains('Remove group').click();
cy.get('.pf-c-modal-box__body b').contains('access_group');
Expand Down

0 comments on commit 13d3460

Please sign in to comment.