diff --git a/cypress/e2e/share-federated.spec.js b/cypress/e2e/share-federated.spec.js index 9bdfa146f..b0fec93cc 100644 --- a/cypress/e2e/share-federated.spec.js +++ b/cypress/e2e/share-federated.spec.js @@ -57,4 +57,33 @@ describe('Federated sharing of office documents', function() { cy.waitForCollabora(true, true) }) }) + + describe('Open files with symbols in their names', () => { + const symbols = ['%', '&'] + + symbols.forEach((symbol) => { + const filename = `next ${symbol} cloud.odt` + + it(`${symbol} in file name`, () => { + cy.uploadFile(shareOwner, filename, 'application/vnd.oasis.opendocument.text', `/${filename}`) + + cy.login(shareOwner) + cy.shareFileToRemoteUser(shareOwner, filename, shareRecipient) + + cy.login(shareRecipient) + cy.visit('/apps/files', { + onBeforeLoad(win) { + cy.spy(win, 'postMessage').as('postMessage') + }, + }) + + cy.openFile(filename) + cy.waitForViewer() + cy.waitForCollabora(true, true).within(() => { + cy.get('#closebutton').click() + cy.waitForViewerClose() + }) + }) + }) + }) }) diff --git a/cypress/fixtures/next % cloud.odt b/cypress/fixtures/next % cloud.odt new file mode 100644 index 000000000..ca295b6da Binary files /dev/null and b/cypress/fixtures/next % cloud.odt differ diff --git a/cypress/fixtures/next & cloud.odt b/cypress/fixtures/next & cloud.odt new file mode 100644 index 000000000..ddc23d670 Binary files /dev/null and b/cypress/fixtures/next & cloud.odt differ