Skip to content

Commit

Permalink
Merge pull request #2224 from nextcloud/backport/2222/stable27
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Mar 10, 2024
2 parents 514f4bc + 3af637d commit f24a648
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cypress/e2e/sharing/download-share-disabled.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ describe(`Download ${fileName} in viewer`, function() {
cy.get('.sharing-link-list > .sharing-entry button[aria-label*="Actions for "]').click()
cy.get('.action-button:contains(\'Customize link\')').click()
cy.get('.checkbox-radio-switch-checkbox').contains('Hide download').as('hideDownloadBtn')

cy.intercept('PUT', '**/apps/files_sharing/api/v1/shares/*').as('saveShareAPIRequest')

// click the label
cy.get('@hideDownloadBtn').get('span').contains('Hide download').click()
cy.get('@hideDownloadBtn').get('input[type=checkbox]').should('be.checked')
cy.wait('@saveShareAPIRequest', { timeout: 10000 })

// Log out and access link share
cy.logout()
cy.visit(`/s/${token}`)
Expand All @@ -90,9 +95,10 @@ describe(`Download ${fileName} in viewer`, function() {
.and('not.have.class', 'icon-loading')
})

it('See the title on the viewer header but not the Download button', function() {
it('See the title on the viewer header but not the Download nor the menu button', function() {
cy.get('body > .viewer .modal-title').should('contain', 'image1.jpg')
cy.get('body > .viewer .modal-header a.action-item .download-icon').should('not.exist')
cy.get('body a[download="image1.jpg"]').should('not.exist')
cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('not.exist')
cy.get('body > .viewer .modal-header button.header-close').should('be.visible')
})

Expand Down

0 comments on commit f24a648

Please sign in to comment.