diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-08-16 20:11:31 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-08-19 15:08:39 +0200 |
commit | cb5c1725d17aafbaf5686d86052538a281c6f222 (patch) | |
tree | 8beb7d2d4e2185844b0309c0c575eed701e59ce8 /cypress | |
parent | cb894ebede0360807bf801c19abca112779a6c80 (diff) | |
download | nextcloud-server-cb5c1725d17aafbaf5686d86052538a281c6f222.tar.gz nextcloud-server-cb5c1725d17aafbaf5686d86052538a281c6f222.zip |
fix(files): Fix legacy files list sorting
The sorting was not saved since files2vue changes in Nextcloud 27, as a new API endpoint
was introduced and the old one was dropped without adjusting the legacy file list to use it.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/files.cy.ts | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/cypress/e2e/files.cy.ts b/cypress/e2e/files.cy.ts index ab2c22a8776..381d83912b8 100644 --- a/cypress/e2e/files.cy.ts +++ b/cypress/e2e/files.cy.ts @@ -30,18 +30,12 @@ const startCopyMove = (file: string) => { } describe('Login with a new user and open the files app', function() { - let currentUser: User - beforeEach(function() { + before(function() { cy.createRandomUser().then((user) => { - currentUser = user cy.login(user) }) }) - afterEach(function() { - cy.deleteUser(currentUser) - }) - Cypress.on('uncaught:exception', (err) => { // This can happen because of blink engine & skeleton animation, its not a bug just engine related. if (err.message.includes('ResizeObserver loop limit exceeded')) { @@ -54,6 +48,40 @@ describe('Login with a new user and open the files app', function() { cy.get('.files-fileList tr').should('contain', 'welcome.txt') }) + it('See the file list sorting order is saved', function() { + cy.intercept('PUT', /api\/v1\/views\/files\/sorting_direction$/).as('sorting_direction') + + cy.visit('/apps/files') + // default to sorting by name + cy.get('.files-filestable th.column-name .sort-indicator').should('be.visible') + // change to size + cy.get('.files-filestable th').contains('Size').click() + // size sorting should be active + cy.get('.files-filestable th.column-name .sort-indicator').should('not.be.visible') + cy.get('.files-filestable th.column-size .sort-indicator').should('be.visible') + cy.wait('@sorting_direction') + + // Re-visit + cy.visit('/apps/files') + // now sorting by name should be disabled and sorting by size should be enabled + cy.get('.files-filestable th.column-name .sort-indicator').should('not.be.visible') + cy.get('.files-filestable th.column-size .sort-indicator').should('be.visible') + }) +}) + +describe('Testing the copy move action (FilePicker)', () => { + let currentUser: User + beforeEach(function() { + cy.createRandomUser().then((user) => { + currentUser = user + cy.login(user) + }) + }) + + afterEach(function() { + cy.deleteUser(currentUser) + }) + it('Copy a file in its same folder', () => { cy.visit('/apps/files') // When I start the move or copy operation for "welcome.txt" |