[ARVADOS-WORKBENCH2] updated: 2.3.0-45-g2c257e34
Git user
git at public.arvados.org
Wed Dec 1 18:41:29 UTC 2021
Summary of changes:
cypress/integration/group-manage.spec.js | 90 +++++++++++++++++++++-
src/views-components/data-explorer/renderers.tsx | 1 +
.../group-details-panel/group-details-panel.tsx | 5 +-
3 files changed, 93 insertions(+), 3 deletions(-)
via 2c257e34488b251e146631e12559732b3879d567 (commit)
from a3658215b1129e78e2dfd7496e1d5de8263b2351 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 2c257e34488b251e146631e12559732b3879d567
Author: Stephen Smith <stephen at curii.com>
Date: Wed Dec 1 13:40:59 2021 -0500
18123: Add tests for hide group member and rename/delete group.
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/cypress/integration/group-manage.spec.js b/cypress/integration/group-manage.spec.js
index 690102c0..b317ad3c 100644
--- a/cypress/integration/group-manage.spec.js
+++ b/cypress/integration/group-manage.spec.js
@@ -6,6 +6,7 @@ describe('Group manage tests', function() {
let activeUser;
let adminUser;
let otherUser;
+ const groupName = `Test group (${Math.floor(999999 * Math.random())})`;
before(function() {
// Only set up common users once. These aren't set up as aliases because
@@ -35,7 +36,6 @@ describe('Group manage tests', function() {
});
it('creates a new group', function() {
- const groupName = `Test group (${Math.floor(999999 * Math.random())})`;
cy.loginAs(activeUser);
// Navigate to Groups
@@ -104,7 +104,52 @@ describe('Group manage tests', function() {
});
});
+ it('unhides users', function() {
+ // Must use admin user to have manage permission on user
+ cy.loginAs(adminUser);
+ cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
+ cy.get('[data-cy=groups-panel-data-explorer]').contains(groupName).click();
+
+ // Check that other user is hidden
+ cy.get('[data-cy=group-details-permissions-tab]').click();
+ cy.get('[data-cy=group-permissions-data-explorer]')
+ .should('not.contain', 'Other User')
+ cy.get('[data-cy=group-details-members-tab]').click();
+
+ // Test unhide
+ cy.get('[data-cy=group-members-data-explorer]')
+ .contains('Other User')
+ .parents('tr')
+ .within(() => {
+ cy.get('[data-cy=user-hidden-checkbox]').click();
+ });
+ // Check that other user is visible
+ cy.get('[data-cy=group-details-permissions-tab]').click();
+ cy.get('[data-cy=group-permissions-data-explorer]')
+ .contains('Other User')
+ .parents('tr')
+ .within(() => {
+ cy.contains('Read');
+ });
+ // Test re-hide
+ cy.get('[data-cy=group-details-members-tab]').click();
+ cy.get('[data-cy=group-members-data-explorer]')
+ .contains('Other User')
+ .parents('tr')
+ .within(() => {
+ cy.get('[data-cy=user-hidden-checkbox]').click();
+ });
+ // Check that other user is hidden
+ cy.get('[data-cy=group-details-permissions-tab]').click();
+ cy.get('[data-cy=group-permissions-data-explorer]')
+ .should('not.contain', 'Other User')
+ });
+
it('removes users from the group', function() {
+ cy.loginAs(activeUser);
+ cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
+ cy.get('[data-cy=groups-panel-data-explorer]').contains(groupName).click();
+
// Remove other user
cy.get('[data-cy=group-members-data-explorer]')
.contains('Other User')
@@ -115,6 +160,49 @@ describe('Group manage tests', function() {
cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
cy.get('[data-cy=group-members-data-explorer]')
.should('not.contain', 'Other User');
+ });
+
+ it('renames the group', function() {
+ // Navigate to Groups
+ cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
+
+ // Open rename dialog
+ cy.get('[data-cy=groups-panel-data-explorer]')
+ .contains(groupName)
+ .rightclick();
+ cy.get('[data-cy=context-menu]')
+ .contains('Rename')
+ .click();
+ // Rename the group
+ cy.get('[data-cy=form-dialog]')
+ .should('contain', 'Edit Project')
+ .within(() => {
+ cy.get('input[name=name]').clear().type(groupName + ' (renamed)');
+ cy.get('button[type=submit]').click();
+ });
+
+ // Check that the group was renamed
+ cy.get('[data-cy=groups-panel-data-explorer]')
+ .contains(groupName + ' (renamed)');
});
+
+ it('deletes the group', function() {
+ // Navigate to Groups
+ cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
+
+ // Delete the group
+ cy.get('[data-cy=groups-panel-data-explorer]')
+ .contains(groupName + ' (renamed)')
+ .rightclick();
+ cy.get('[data-cy=context-menu]')
+ .contains('Remove')
+ .click();
+ cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
+
+ // Check that the group was deleted
+ cy.get('[data-cy=groups-panel-data-explorer]')
+ .should('not.contain', groupName + ' (renamed)');
+ });
+
});
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index 457de504..e87c9f33 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -218,6 +218,7 @@ export const ResourceLinkTailIsActive = connect(
const renderIsHidden = (props: { memberLinkUuid: string, permissionLinkUuid: string, hidden: boolean, setMemberIsHidden: (memberLinkUuid: string, permissionLinkUuid: string, hide: boolean) => void }) => {
if (props.memberLinkUuid) {
return <Checkbox
+ data-cy="user-hidden-checkbox"
color="primary"
checked={props.hidden}
onClick={() => props.setMemberIsHidden(props.memberLinkUuid, props.permissionLinkUuid, !props.hidden)} />;
diff --git a/src/views/group-details-panel/group-details-panel.tsx b/src/views/group-details-panel/group-details-panel.tsx
index a44304c4..932005a7 100644
--- a/src/views/group-details-panel/group-details-panel.tsx
+++ b/src/views/group-details-panel/group-details-panel.tsx
@@ -167,8 +167,8 @@ export const GroupDetailsPanel = connect(
return (
<Paper>
<Tabs value={value} onChange={this.handleChange} variant="fullWidth">
- <Tab label="MEMBERS" />
- <Tab label="PERMISSIONS" />
+ <Tab data-cy="group-details-members-tab" label="MEMBERS" />
+ <Tab data-cy="group-details-permissions-tab" label="PERMISSIONS" />
</Tabs>
{value === 0 &&
<DataExplorer
@@ -199,6 +199,7 @@ export const GroupDetailsPanel = connect(
{value === 1 &&
<DataExplorer
id={GROUP_DETAILS_PERMISSIONS_PANEL_ID}
+ data-cy="group-permissions-data-explorer"
onRowClick={noop}
onRowDoubleClick={noop}
onContextMenu={noop}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list