Skip to content

Commit

Permalink
Merge pull request #5719 from nextcloud/backport/5716/stable29
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored May 2, 2024
2 parents 090ab92 + c897dd9 commit d159fd6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d159fd6

Please sign in to comment.