Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests to remove collaborator
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Sep 20, 2022
commit d51b070d38cf30509ee41c8b5ac26d039405fb21
5 changes: 3 additions & 2 deletions cypress/e2e/shared_albums.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ describe('Manage shared albums', () => {
cy.removeSharedAlbums()
})

xit('Remove collaborator from an album', () => {
cy.get('[data-test="media"]').should('have.length', 4)
it('Remove collaborator from an album', () => {
cy.get('ul.collections__list li').should('have.length', 4)

cy.logout()
cy.login(randUser, 'password')
cy.visit(`${Cypress.env('baseUrl')}/index.php/apps/photos`)
cy.goToAlbum('shared_album_test4')
cy.removeCollaborators([randUser2])
cy.logout()
Expand Down
9 changes: 7 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,13 @@ Cypress.Commands.add('addCollaborators', collaborators => {
Cypress.Commands.add('removeCollaborators', collaborators => {
cy.get('[aria-label="Manage collaborators for this album"]').click()
collaborators.forEach((collaborator) => {
cy.get('[aria-label="Search for collaborators"').type(collaborator)
cy.contains(collaborator).click()
cy.get('.manage-collaborators')
.within(() => {
cy.contains(collaborator)
.parentsUntil('ul')
.get(`[aria-label="Remove ${collaborator} from the collaborators list"]`)
.click()
})
})
cy.contains('Save').click()
})
Expand Down
3 changes: 1 addition & 2 deletions src/components/Albums/CollaboratorsSelectionForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
class="manage-collaborators__selection__item">
<NcListItemIcon :id="availableCollaborators[collaboratorKey].id"
:title="availableCollaborators[collaboratorKey].id"
:display-name="availableCollaborators[collaboratorKey].label"
:aria-label="t('photos', 'Remove {collaboratorLabel} from the collaborators list', {collaboratorLabel: availableCollaborators[collaboratorKey].label})">
:display-name="availableCollaborators[collaboratorKey].label">
<NcButton type="tertiary"
:aria-label="t('photos', 'Remove {collaboratorLabel} from the collaborators list', {collaboratorLabel: availableCollaborators[collaboratorKey].label})"
@click="unselectEntity(collaboratorKey)">
Expand Down