Merge branch '21077-background-refresh' refs #21077
[arvados-workbench2.git] / cypress / integration / group-manage.spec.js
index b6fba4f1f16f9f4ed6beec6c9eee2d875542209d..c4731bb3c6bf01bdde33ccdb62cc57579c4531bc 100644 (file)
@@ -70,7 +70,14 @@ describe('Group manage tests', function() {
                 cy.get('[data-cy=invite-people-field] input').type("other");
             });
         cy.get('[role=tooltip]').click();
-        cy.get('.sharing-dialog').contains('Save').click();
+        // Add admin to the group
+        cy.get('.sharing-dialog')
+            .should('contain', 'Sharing settings')
+            .within(() => {
+                cy.get('[data-cy=invite-people-field] input').type("admin");
+            });
+        cy.get('[role=tooltip]').click();
+        cy.get('.sharing-dialog').get('[data-cy=add-invited-people]').click();
         cy.get('.sharing-dialog').contains('Close').click();
 
         // Check that both users are present with appropriate permissions
@@ -109,6 +116,27 @@ describe('Group manage tests', function() {
             .within(() => {
                 cy.contains('Write');
             });
+
+        // Change admin to manage
+        cy.get('[data-cy=group-members-data-explorer]')
+            .contains(adminUser.user.full_name)
+            .parents('tr')
+            .within(() => {
+                cy.contains('Read')
+                    .parents('td')
+                    .within(() => {
+                        cy.get('button').click();
+                    });
+            });
+        cy.get('[data-cy=context-menu]')
+            .contains('Manage')
+            .click();
+        cy.get('[data-cy=group-members-data-explorer]')
+            .contains(adminUser.user.full_name)
+            .parents('tr')
+            .within(() => {
+                cy.contains('Manage');
+            });
     });
 
     it('can unhide and re-hide users', function() {
@@ -212,6 +240,7 @@ describe('Group manage tests', function() {
     });
 
     it('renames the group', function() {
+        cy.loginAs(adminUser);
         // Navigate to Groups
         cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
 
@@ -254,7 +283,7 @@ describe('Group manage tests', function() {
             .should('not.contain', groupName + ' (renamed)');
     });
 
-    it.only('disables group-related controls for built-in groups', function() {
+    it('disables group-related controls for built-in groups', function() {
         cy.loginAs(adminUser);
 
         ['All users', 'Anonymous users', 'System group'].forEach((builtInGroup) => {
@@ -262,20 +291,20 @@ describe('Group manage tests', function() {
             cy.get('[data-cy=groups-panel-data-explorer]').contains(builtInGroup).click();
 
             // Check group member actions
-            // cy.get('[data-cy=group-members-data-explorer]')
-            //     .within(() => {
+            cy.get('[data-cy=group-members-data-explorer]')
+                .within(() => {
                     cy.get('[data-cy=group-member-add]').should('not.exist');
                     cy.get('[data-cy=user-visible-checkbox] input').should('be.disabled');
                     cy.get('[data-cy=resource-delete-button]').should('be.disabled');
-                    // cy.get('[data-cy=edit-permission-button]').should('not.exist');
+                    cy.get('[data-cy=edit-permission-button]').should('not.exist');
                 });
 
             // Check permissions actions
             cy.get('[data-cy=group-details-permissions-tab]').click();
-            // cy.get('[data-cy=group-permissions-data-explorer]').within(() => {
+            cy.get('[data-cy=group-permissions-data-explorer]').within(() => {
                 cy.get('[data-cy=resource-delete-button]').should('be.disabled');
                 cy.get('[data-cy=edit-permission-button]').should('not.exist');
-            // });
+            });
         });
     });