diff --git a/cypress/e2e/workspace.spec.js b/cypress/e2e/workspace.spec.js index 56c53c1ee28..c8fc6b0d177 100644 --- a/cypress/e2e/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js @@ -259,6 +259,14 @@ describe('Workspace', function() { .should('contain', 'Hello world') }) + it('creates description with localized name properly rendered', function() { + cy.modifyUser(user, 'language', 'es') + cy.visitTestFolder() + cy.createDescription('Añadir descripción a carpeta') + cy.getFile('Léeme.md') + cy.get('#rich-workspace .editor__content').should('be.visible') + }) + it('ignores localized file name in other language', function() { cy.modifyUser(user, 'language', 'fr') cy.uploadFile('test.md', 'text/markdown', `${this.testFolder}/Anleitung.md`) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 0e3a3edafce..e0d9a37fb34 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -542,14 +542,14 @@ Cypress.Commands.add('showHiddenFiles', (value = true) => { }) }) -Cypress.Commands.add('createDescription', () => { +Cypress.Commands.add('createDescription', (buttonLabel = 'Add folder description') => { const url = '**/remote.php/dav/files/**' cy.intercept({ method: 'PUT', url }) .as('addDescription') cy.get('[data-cy-files-list] tr[data-cy-files-list-row-name="Readme.md"]').should('not.exist') cy.get('[data-cy-upload-picker] button.action-item__menutoggle').click() - cy.get('li.upload-picker__menu-entry button').contains('Add folder description').click() + cy.get('li.upload-picker__menu-entry button').contains(buttonLabel).click() cy.wait('@addDescription') }) diff --git a/src/helpers/files.js b/src/helpers/files.js index ea1474d9f7f..ca4c8dda48a 100644 --- a/src/helpers/files.js +++ b/src/helpers/files.js @@ -160,7 +160,7 @@ export const addMenuRichWorkspace = () => { }) const fileid = parseInt(response.headers['oc-fileid']) const file = new File({ - source: context.source + '/' + encodeURIComponent(descriptionFile), + source: context.source + '/' + descriptionFile, id: fileid, mtime: new Date(), mime: 'text/markdown',