+ it('can unhide and re-hide 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', otherUser.user.full_name)
+ cy.get('[data-cy=group-details-members-tab]').click();
+
+ // Test unhide
+ cy.get('[data-cy=group-members-data-explorer]')
+ .contains(otherUser.user.full_name)
+ .parents('tr')
+ .within(() => {
+ cy.get('[data-cy=user-visible-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(otherUser.user.full_name)
+ .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(otherUser.user.full_name)
+ .parents('tr')
+ .within(() => {
+ cy.get('[data-cy=user-visible-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', otherUser.user.full_name)
+ });
+
+ it('displays resources shared with the group', function() {
+ // Switch to activeUser
+ cy.loginAs(activeUser);
+ cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
+
+ // Get groupUuid and create shared project
+ cy.get('[data-cy=groups-panel-data-explorer]')
+ .contains(groupName)
+ .parents('tr')
+ .find('[data-cy=uuid]')
+ .invoke('text')
+ .as('groupUuid')
+ .then((groupUuid) => {
+ cy.createProject({
+ owningUser: activeUser,
+ projectName: 'test-project',
+ }).as('testProject').then((testProject) => {
+ cy.shareWith(activeUser.token, groupUuid, testProject.uuid, 'can_read');
+ });
+ });
+
+ // Check that the project is listed in permissions
+ cy.get('[data-cy=groups-panel-data-explorer]').contains(groupName).click();
+ cy.get('[data-cy=group-details-permissions-tab]').click();
+ cy.get('[data-cy=group-permissions-data-explorer]')
+ .contains('test-project')
+ .parents('tr')
+ .within(() => {
+ cy.contains('Read');
+ });
+ });
+