From 15dfb03a3acb7ab81a7ca2ebdff2460ae9e39ae4 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 25 Jul 2024 01:23:59 +0200 Subject: [PATCH] fix: Ensure displayname is a string Signed-off-by: Ferdinand Thiessen [skip ci] --- cypress/e2e/files/files_sorting.cy.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cypress/e2e/files/files_sorting.cy.ts b/cypress/e2e/files/files_sorting.cy.ts index 3e46d868c1ed9..9cb6fe3fe2f3c 100644 --- a/cypress/e2e/files/files_sorting.cy.ts +++ b/cypress/e2e/files/files_sorting.cy.ts @@ -58,6 +58,31 @@ describe('Files: Sorting the file list', { testIsolation: true }, () => { }) }) + /** + * Regression test of https://github.com/nextcloud/server/issues/45829 + */ + it('Filesnames with numbers are sorted by name ascending by default', () => { + cy.uploadContent(currentUser, new Blob(), 'text/plain', '/name.txt') + .uploadContent(currentUser, new Blob(), 'text/plain', '/name_03.txt') + .uploadContent(currentUser, new Blob(), 'text/plain', '/name_02.txt') + .uploadContent(currentUser, new Blob(), 'text/plain', '/name_01.txt') + cy.login(currentUser) + cy.visit('/apps/files') + + cy.get('[data-cy-files-list-row]').each(($row, index) => { + switch (index) { + case 0: expect($row.attr('data-cy-files-list-row-name')).to.eq('name.txt') + break + case 1: expect($row.attr('data-cy-files-list-row-name')).to.eq('name_01.txt') + break + case 2: expect($row.attr('data-cy-files-list-row-name')).to.eq('name_02.txt') + break + case 3: expect($row.attr('data-cy-files-list-row-name')).to.eq('name_03.txt') + break + } + }) + }) + it('Can sort by size', () => { cy.uploadContent(currentUser, new Blob(), 'text/plain', '/1 tiny.txt') .uploadContent(currentUser, new Blob(['a'.repeat(1024)]), 'text/plain', '/z big.txt')