Skip to content

Commit 1fbaa88

Browse files
juliusknorrbackportbot[bot]
authored andcommitted
test: Add test for resharing a federated share as link
Signed-off-by: Julius Knorr <jus@bitgrid.net>
1 parent 34a36a3 commit 1fbaa88

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

cypress/e2e/share-federated.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ describe('Federated sharing of office documents', function() {
1616
cy.createUser(shareOwner)
1717

1818
cy.uploadFile(shareOwner, 'document.odt', 'application/vnd.oasis.opendocument.text', '/document.odt')
19+
cy.uploadFile(shareOwner, 'document.odt', 'application/vnd.oasis.opendocument.text', '/document-reshare.odt')
1920
})
2021

2122
it('Open a remotely shared file', function() {
@@ -37,4 +38,23 @@ describe('Federated sharing of office documents', function() {
3738
cy.get('#viewer', { timeout: 5000 }).should('not.exist')
3839
})
3940
})
41+
42+
it('Open a remotely shared file as a link', function() {
43+
cy.login(shareOwner)
44+
cy.shareFileToRemoteUser(shareOwner, '/document-reshare.odt', shareRecipient)
45+
46+
cy.login(shareRecipient)
47+
cy.visit('/apps/files')
48+
49+
cy.shareLink(shareRecipient, '/document-reshare.odt', { permissions: 1 }).then((token) => {
50+
cy.logout()
51+
cy.visit(`/s/${token}`, {
52+
onBeforeLoad(win) {
53+
cy.spy(win, 'postMessage').as('postMessage')
54+
},
55+
})
56+
cy.waitForViewer()
57+
cy.waitForCollabora(true, true)
58+
})
59+
})
4060
})

cypress/support/commands.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Cypress.Commands.add('shareFileToRemoteUser', (user, path, targetUser, shareData
133133
body: {
134134
path,
135135
shareType: 6,
136+
permission: 31,
136137
shareWith: federatedId,
137138
...shareData,
138139
},

0 commit comments

Comments
 (0)