aboutsummaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-01-19 20:19:59 +0100
committerEduardo Morales <emoral435@gmail.com>2024-01-20 12:42:45 -0600
commit84e2165aef54cfb2cd93a1428c6b74a8a39b9016 (patch)
tree1fda7fb44a11ef0b3f56368eae5b48dafc5e936a /cypress
parent20331e4349dc687796c612bf99913c765cbf3054 (diff)
downloadnextcloud-server-84e2165aef54cfb2cd93a1428c6b74a8a39b9016.tar.gz
nextcloud-server-84e2165aef54cfb2cd93a1428c6b74a8a39b9016.zip
fix(files): Allow to copy or move file to folder with similar name
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/files/files_copy-move.cy.ts31
1 files changed, 31 insertions, 0 deletions
diff --git a/cypress/e2e/files/files_copy-move.cy.ts b/cypress/e2e/files/files_copy-move.cy.ts
index 235c5bc00c5..7fd1b66e350 100644
--- a/cypress/e2e/files/files_copy-move.cy.ts
+++ b/cypress/e2e/files/files_copy-move.cy.ts
@@ -87,6 +87,37 @@ describe('Files: Move or copy files', { testIsolation: true }, () => {
getRowForFile('new-folder').should('not.exist')
})
+ // This was a bug previously
+ it('Can move a file to folder with similar name', () => {
+ cy.uploadContent(currentUser, new Blob(), 'text/plain', '/original')
+ .mkdir(currentUser, '/original folder')
+ cy.login(currentUser)
+ cy.visit('/apps/files')
+
+ // intercept the copy so we can wait for it
+ cy.intercept('MOVE', /\/remote.php\/dav\/files\//).as('moveFile')
+
+ getRowForFile('original').should('be.visible')
+ triggerActionForFile('original', 'move-copy')
+
+ // select new folder
+ cy.get('.file-picker [data-filename="original folder"]').should('be.visible').click()
+ // click copy
+ cy.get('.file-picker').contains('button', 'Move to original folder').should('be.visible').click()
+
+ cy.wait('@moveFile')
+ // wait until visible again
+ getRowForFile('original folder').should('be.visible')
+
+ // original should be moved -> not exist anymore
+ getRowForFile('original').should('not.exist')
+ getRowForFile('original folder').should('be.visible').find('[data-cy-files-list-row-name-link]').click()
+
+ cy.url().should('contain', 'dir=/original%20folder')
+ getRowForFile('original').should('be.visible')
+ getRowForFile('original folder').should('not.exist')
+ })
+
it('Can move a file to its parent folder', () => {
cy.mkdir(currentUser, '/new-folder')
cy.uploadContent(currentUser, new Blob(), 'text/plain', '/new-folder/original.txt')