|
|
@@ -59,27 +59,31 @@ describe('GroupMembers', function () {
|
|
|
})
|
|
|
|
|
|
it('renders the group members page', function () {
|
|
|
- cy.get('h1').contains('My Awesome Team')
|
|
|
- cy.get('small').contains('You have added 2 of 10 available members')
|
|
|
-
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.contains('john.doe@test.com')
|
|
|
- cy.contains('John Doe')
|
|
|
- cy.contains('15th Jan 2023')
|
|
|
- cy.findByTestId('badge-pending-invite').should(
|
|
|
- 'have.text',
|
|
|
- 'Pending invite'
|
|
|
- )
|
|
|
- })
|
|
|
+ cy.findByRole('heading', { name: /my awesome team/i, level: 1 })
|
|
|
+ cy.findByTestId('page-header-members-details').contains(
|
|
|
+ 'You have added 2 of 10 available members'
|
|
|
+ )
|
|
|
|
|
|
- cy.get('tr:nth-child(2)').within(() => {
|
|
|
- cy.contains('bobby.lapointe@test.com')
|
|
|
- cy.contains('Bobby Lapointe')
|
|
|
- cy.contains('2nd Jan 2023')
|
|
|
- cy.findByTestId('badge-pending-invite').should('not.exist')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.contains('john.doe@test.com')
|
|
|
+ cy.contains('John Doe')
|
|
|
+ cy.contains('15th Jan 2023')
|
|
|
+ cy.findByTestId('badge-pending-invite').should(
|
|
|
+ 'have.text',
|
|
|
+ 'Pending invite'
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
+ cy.get('tr:nth-child(2)').within(() => {
|
|
|
+ cy.contains('bobby.lapointe@test.com')
|
|
|
+ cy.contains('Bobby Lapointe')
|
|
|
+ cy.contains('2nd Jan 2023')
|
|
|
+ cy.findByTestId('badge-pending-invite').should('not.exist')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('sends an invite', function () {
|
|
|
@@ -96,16 +100,18 @@ describe('GroupMembers', function () {
|
|
|
cy.get('.form-control').type('someone.else@test.com')
|
|
|
cy.get('.add-more-members-form button').click()
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(3)').within(() => {
|
|
|
- cy.contains('someone.else@test.com')
|
|
|
- cy.contains('N/A')
|
|
|
- cy.findByTestId('badge-pending-invite').should(
|
|
|
- 'have.text',
|
|
|
- 'Pending invite'
|
|
|
- )
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(3)').within(() => {
|
|
|
+ cy.contains('someone.else@test.com')
|
|
|
+ cy.contains('N/A')
|
|
|
+ cy.findByTestId('badge-pending-invite').should(
|
|
|
+ 'have.text',
|
|
|
+ 'Pending invite'
|
|
|
+ )
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('tries to send an invite and displays the error', function () {
|
|
|
@@ -124,25 +130,29 @@ describe('GroupMembers', function () {
|
|
|
})
|
|
|
|
|
|
it('checks the select all checkbox', function () {
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').should('not.be.checked')
|
|
|
- })
|
|
|
- cy.get('tr:nth-child(2)').within(() => {
|
|
|
- cy.get('.select-item').should('not.be.checked')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').should('not.be.checked')
|
|
|
+ })
|
|
|
+ cy.get('tr:nth-child(2)').within(() => {
|
|
|
+ cy.get('.select-item').should('not.be.checked')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
|
|
|
cy.get('.select-all').click()
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').should('be.checked')
|
|
|
- })
|
|
|
- cy.get('tr:nth-child(2)').within(() => {
|
|
|
- cy.get('.select-item').should('be.checked')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').should('be.checked')
|
|
|
+ })
|
|
|
+ cy.get('tr:nth-child(2)').within(() => {
|
|
|
+ cy.get('.select-item').should('be.checked')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('remove a member', function () {
|
|
|
@@ -150,23 +160,27 @@ describe('GroupMembers', function () {
|
|
|
statusCode: 200,
|
|
|
})
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').check()
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').check()
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
|
|
|
cy.get('button').contains('Remove from group').click()
|
|
|
|
|
|
cy.get('small').contains('You have added 1 of 10 available members')
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.contains('bobby.lapointe@test.com')
|
|
|
- cy.contains('Bobby Lapointe')
|
|
|
- cy.contains('2nd Jan 2023')
|
|
|
- cy.contains('Pending invite').should('not.exist')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.contains('bobby.lapointe@test.com')
|
|
|
+ cy.contains('Bobby Lapointe')
|
|
|
+ cy.contains('2nd Jan 2023')
|
|
|
+ cy.contains('Pending invite').should('not.exist')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('tries to remove a user and displays the error', function () {
|
|
|
@@ -174,11 +188,13 @@ describe('GroupMembers', function () {
|
|
|
statusCode: 500,
|
|
|
})
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').check()
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').check()
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
cy.get('button').contains('Remove from group').click()
|
|
|
|
|
|
cy.get('.alert').contains('Sorry, something went wrong')
|
|
|
@@ -241,35 +257,37 @@ describe('GroupMembers', function () {
|
|
|
cy.get('h1').contains('My Awesome Team')
|
|
|
cy.get('small').contains('You have added 3 of 10 available members')
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.contains('john.doe@test.com')
|
|
|
- cy.contains('John Doe')
|
|
|
- cy.contains('15th Jan 2023')
|
|
|
- cy.get('.sr-only').contains('Pending invite')
|
|
|
- cy.findByTestId('badge-pending-invite').should(
|
|
|
- 'have.text',
|
|
|
- 'Pending invite'
|
|
|
- )
|
|
|
- cy.get(`.security-state-invite-pending`).should('exist')
|
|
|
- })
|
|
|
-
|
|
|
- cy.get('tr:nth-child(2)').within(() => {
|
|
|
- cy.contains('bobby.lapointe@test.com')
|
|
|
- cy.contains('Bobby Lapointe')
|
|
|
- cy.contains('2nd Jan 2023')
|
|
|
- cy.findByTestId('badge-pending-invite').should('not.exist')
|
|
|
- cy.get('.sr-only').contains('Not managed')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.contains('john.doe@test.com')
|
|
|
+ cy.contains('John Doe')
|
|
|
+ cy.contains('15th Jan 2023')
|
|
|
+ cy.get('.sr-only').contains('Pending invite')
|
|
|
+ cy.findByTestId('badge-pending-invite').should(
|
|
|
+ 'have.text',
|
|
|
+ 'Pending invite'
|
|
|
+ )
|
|
|
+ cy.get(`.security-state-invite-pending`).should('exist')
|
|
|
+ })
|
|
|
+
|
|
|
+ cy.get('tr:nth-child(2)').within(() => {
|
|
|
+ cy.contains('bobby.lapointe@test.com')
|
|
|
+ cy.contains('Bobby Lapointe')
|
|
|
+ cy.contains('2nd Jan 2023')
|
|
|
+ cy.findByTestId('badge-pending-invite').should('not.exist')
|
|
|
+ cy.get('.sr-only').contains('Not managed')
|
|
|
+ })
|
|
|
+
|
|
|
+ cy.get('tr:nth-child(3)').within(() => {
|
|
|
+ cy.contains('claire.jennings@test.com')
|
|
|
+ cy.contains('Claire Jennings')
|
|
|
+ cy.contains('3rd Jan 2023')
|
|
|
+ cy.findByTestId('badge-pending-invite').should('not.exist')
|
|
|
+ cy.get('.sr-only').contains('Managed')
|
|
|
+ })
|
|
|
})
|
|
|
-
|
|
|
- cy.get('tr:nth-child(3)').within(() => {
|
|
|
- cy.contains('claire.jennings@test.com')
|
|
|
- cy.contains('Claire Jennings')
|
|
|
- cy.contains('3rd Jan 2023')
|
|
|
- cy.findByTestId('badge-pending-invite').should('not.exist')
|
|
|
- cy.get('.sr-only').contains('Managed')
|
|
|
- })
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('sends an invite', function () {
|
|
|
@@ -286,18 +304,20 @@ describe('GroupMembers', function () {
|
|
|
cy.get('.form-control').type('someone.else@test.com')
|
|
|
cy.get('.add-more-members-form button').click()
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(4)').within(() => {
|
|
|
- cy.contains('someone.else@test.com')
|
|
|
- cy.contains('N/A')
|
|
|
- cy.get('.sr-only').contains('Pending invite')
|
|
|
- cy.findByTestId('badge-pending-invite').should(
|
|
|
- 'have.text',
|
|
|
- 'Pending invite'
|
|
|
- )
|
|
|
- cy.get(`.security-state-invite-pending`).should('exist')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(4)').within(() => {
|
|
|
+ cy.contains('someone.else@test.com')
|
|
|
+ cy.contains('N/A')
|
|
|
+ cy.get('.sr-only').contains('Pending invite')
|
|
|
+ cy.findByTestId('badge-pending-invite').should(
|
|
|
+ 'have.text',
|
|
|
+ 'Pending invite'
|
|
|
+ )
|
|
|
+ cy.get(`.security-state-invite-pending`).should('exist')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('tries to send an invite and displays the error', function () {
|
|
|
@@ -316,25 +336,29 @@ describe('GroupMembers', function () {
|
|
|
})
|
|
|
|
|
|
it('checks the select all checkbox', function () {
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').should('not.be.checked')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').should('not.be.checked')
|
|
|
+ })
|
|
|
+ cy.get('tr:nth-child(2)').within(() => {
|
|
|
+ cy.get('.select-item').should('not.be.checked')
|
|
|
+ })
|
|
|
})
|
|
|
- cy.get('tr:nth-child(2)').within(() => {
|
|
|
- cy.get('.select-item').should('not.be.checked')
|
|
|
- })
|
|
|
- })
|
|
|
|
|
|
cy.get('.select-all').click()
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').should('be.checked')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').should('be.checked')
|
|
|
+ })
|
|
|
+ cy.get('tr:nth-child(2)').within(() => {
|
|
|
+ cy.get('.select-item').should('be.checked')
|
|
|
+ })
|
|
|
})
|
|
|
- cy.get('tr:nth-child(2)').within(() => {
|
|
|
- cy.get('.select-item').should('be.checked')
|
|
|
- })
|
|
|
- })
|
|
|
|
|
|
cy.get('button').contains('Remove from group').click()
|
|
|
})
|
|
|
@@ -344,22 +368,26 @@ describe('GroupMembers', function () {
|
|
|
statusCode: 200,
|
|
|
})
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').check()
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').check()
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
|
|
|
cy.get('button').contains('Remove from group').click()
|
|
|
|
|
|
cy.get('small').contains('You have added 2 of 10 available members')
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.contains('bobby.lapointe@test.com')
|
|
|
- cy.contains('Bobby Lapointe')
|
|
|
- cy.contains('2nd Jan 2023')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.contains('bobby.lapointe@test.com')
|
|
|
+ cy.contains('Bobby Lapointe')
|
|
|
+ cy.contains('2nd Jan 2023')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('cannot remove a managed member', function () {
|
|
|
@@ -367,12 +395,14 @@ describe('GroupMembers', function () {
|
|
|
statusCode: 200,
|
|
|
})
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- // no checkbox should be shown for 'Claire Jennings', a managed user
|
|
|
- cy.get('tr:nth-child(3)').within(() => {
|
|
|
- cy.get('.select-item').should('not.exist')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ // no checkbox should be shown for 'Claire Jennings', a managed user
|
|
|
+ cy.get('tr:nth-child(3)').within(() => {
|
|
|
+ cy.get('.select-item').should('not.exist')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
it('tries to remove a user and displays the error', function () {
|
|
|
@@ -380,11 +410,13 @@ describe('GroupMembers', function () {
|
|
|
statusCode: 500,
|
|
|
})
|
|
|
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(1)').within(() => {
|
|
|
- cy.get('.select-item').check()
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(1)').within(() => {
|
|
|
+ cy.get('.select-item').check()
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
cy.get('.page-header').within(() => {
|
|
|
cy.get('button').contains('Remove from group').click()
|
|
|
})
|
|
|
@@ -448,17 +480,19 @@ describe('GroupMembers', function () {
|
|
|
})
|
|
|
|
|
|
it('should display the Security column', function () {
|
|
|
- cy.get('ul.managed-users-list table > tbody').within(() => {
|
|
|
- cy.get('tr:nth-child(2)').within(() => {
|
|
|
- cy.contains('bobby.lapointe@test.com')
|
|
|
- cy.get('.sr-only').contains('SSO not active')
|
|
|
+ cy.findByTestId('managed-users-table')
|
|
|
+ .find('tbody')
|
|
|
+ .within(() => {
|
|
|
+ cy.get('tr:nth-child(2)').within(() => {
|
|
|
+ cy.contains('bobby.lapointe@test.com')
|
|
|
+ cy.get('.sr-only').contains('SSO not active')
|
|
|
+ })
|
|
|
+
|
|
|
+ cy.get('tr:nth-child(3)').within(() => {
|
|
|
+ cy.contains('claire.jennings@test.com')
|
|
|
+ cy.get('.sr-only').contains('SSO active')
|
|
|
+ })
|
|
|
})
|
|
|
-
|
|
|
- cy.get('tr:nth-child(3)').within(() => {
|
|
|
- cy.contains('claire.jennings@test.com')
|
|
|
- cy.get('.sr-only').contains('SSO active')
|
|
|
- })
|
|
|
- })
|
|
|
})
|
|
|
})
|
|
|
|