diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-12 14:38:52 +0100 |
---|---|---|
committer | Eduardo Morales <emoral435@gmail.com> | 2024-01-20 12:42:45 -0600 |
commit | d2446762b5ded4ece26c0ff2a4aca4510d9ee3ff (patch) | |
tree | bcef4a35580eb3c96d2cc5b50bb3c261bb13bdf7 /cypress | |
parent | ea2ba8b27ee8f880af589076b9343a17a04042f7 (diff) | |
download | nextcloud-server-d2446762b5ded4ece26c0ff2a4aca4510d9ee3ff.tar.gz nextcloud-server-d2446762b5ded4ece26c0ff2a4aca4510d9ee3ff.zip |
enh(files): Allow to copy files into same directory
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/files/files_copy-move.cy.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cypress/e2e/files/files_copy-move.cy.ts b/cypress/e2e/files/files_copy-move.cy.ts index a75f16339d4..235c5bc00c5 100644 --- a/cypress/e2e/files/files_copy-move.cy.ts +++ b/cypress/e2e/files/files_copy-move.cy.ts @@ -113,4 +113,43 @@ describe('Files: Move or copy files', { testIsolation: true }, () => { getRowForFile('new-folder').should('be.visible') getRowForFile('original.txt').should('be.visible') }) + + it('Can copy a file to same folder', () => { + cy.uploadContent(currentUser, new Blob(), 'text/plain', '/original.txt') + cy.login(currentUser) + cy.visit('/apps/files') + + // intercept the copy so we can wait for it + cy.intercept('COPY', /\/remote.php\/dav\/files\//).as('copyFile') + + getRowForFile('original.txt').should('be.visible') + triggerActionForFile('original.txt', 'move-copy') + + // click copy + cy.get('.file-picker').contains('button', 'Copy').should('be.visible').click() + + cy.wait('@copyFile') + getRowForFile('original.txt').should('be.visible') + getRowForFile('original (copy).txt').should('be.visible') + }) + + it('Can copy a file multiple times to same folder', () => { + cy.uploadContent(currentUser, new Blob(), 'text/plain', '/original.txt') + cy.uploadContent(currentUser, new Blob(), 'text/plain', '/original (copy).txt') + cy.login(currentUser) + cy.visit('/apps/files') + + // intercept the copy so we can wait for it + cy.intercept('COPY', /\/remote.php\/dav\/files\//).as('copyFile') + + getRowForFile('original.txt').should('be.visible') + triggerActionForFile('original.txt', 'move-copy') + + // click copy + cy.get('.file-picker').contains('button', 'Copy').should('be.visible').click() + + cy.wait('@copyFile') + getRowForFile('original.txt').should('be.visible') + getRowForFile('original (copy 2).txt').should('be.visible') + }) }) |