test: Add test for resharing a federated share as link

Signed-off-by: Julius Knorr <jus@bitgrid.net>
This commit is contained in:
Julius Knorr 2024-11-28 15:15:06 +01:00
parent bd19220b7b
commit b1edddd12d
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
2 changed files with 21 additions and 0 deletions

View file

@ -16,6 +16,7 @@ describe('Federated sharing of office documents', function() {
cy.createUser(shareOwner)
cy.uploadFile(shareOwner, 'document.odt', 'application/vnd.oasis.opendocument.text', '/document.odt')
cy.uploadFile(shareOwner, 'document.odt', 'application/vnd.oasis.opendocument.text', '/document-reshare.odt')
})
it('Open a remotely shared file', function() {
@ -37,4 +38,23 @@ describe('Federated sharing of office documents', function() {
cy.get('#viewer', { timeout: 5000 }).should('not.exist')
})
})
it('Open a remotely shared file as a link', function() {
cy.login(shareOwner)
cy.shareFileToRemoteUser(shareOwner, '/document-reshare.odt', shareRecipient)
cy.login(shareRecipient)
cy.visit('/apps/files')
cy.shareLink(shareRecipient, '/document-reshare.odt', { permissions: 1 }).then((token) => {
cy.logout()
cy.visit(`/s/${token}`, {
onBeforeLoad(win) {
cy.spy(win, 'postMessage').as('postMessage')
},
})
cy.waitForViewer()
cy.waitForCollabora(true, true)
})
})
})

View file

@ -118,6 +118,7 @@ Cypress.Commands.add('shareFileToRemoteUser', (user, path, targetUser, shareData
body: {
path,
shareType: 6,
permission: 31,
shareWith: federatedId,
...shareData,
},