diff --git a/cypress/e2e/direct.spec.js b/cypress/e2e/direct.spec.js index 66bf0c6ba7..87541e845e 100644 --- a/cypress/e2e/direct.spec.js +++ b/cypress/e2e/direct.spec.js @@ -161,4 +161,41 @@ describe('Direct editing (legacy)', function() { }) }) + it('Save as', function() { + createDirectEditingLink(randUser, fileId) + .then((token) => { + cy.nextcloudTestingAppConfigSet('richdocuments', 'uiDefaults-UIMode', 'tabbed') + cy.logout() + cy.visit(token) + cy.waitForCollabora(false) + + cy.get('@loleafletframe').within(() => { + cy.get('.notebookbar-tabs-container', { timeout: 30_000 }) + .should('be.visible') + + cy.get('button[aria-label="File"]').click() + cy.get('button[aria-label="Save As"]').click() + + cy.get('#saveas-entries #saveas-entry-1').click() + }) + + cy.get('.saveas-dialog') + .should('be.visible') + cy.get('.saveas-dialog input[type=text]') + .should('be.visible') + .should('have.value', 'document.odt') + + cy.get('.saveas-dialog input[type=text]') + .clear() + cy.get('.saveas-dialog input[type=text]') + .type('/document.rtf') + + cy.get('.saveas-dialog button.button-vue--vue-primary').click() + + cy.get('@loleafletframe').within(() => { + cy.verifyOpen('document.rtf') + }) + }) + }) + }) diff --git a/src/document.js b/src/document.js index 9d971ba8a9..17f0c0cb4c 100644 --- a/src/document.js +++ b/src/document.js @@ -473,10 +473,10 @@ const documentsMain = { spawnDialog( SaveAs, { - path: documentsMain.filename, + path: documentsMain.fileName, format: args.Format, }, - (value) => value && this.sendPostMessage('Action_SaveAs', { Filename: value, Notify: true }), + (value) => value && PostMessages.sendWOPIPostMessage('loolframe', 'Action_SaveAs', { Filename: value, Notify: true }), ) } else if (msgId === 'Action_Save_Resp') { if (args.success && args.fileName) {