diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-12 14:38:52 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-20 15:41:53 +0100 |
commit | eaad30c3461a662f68bd87bb76463847e4969f7f (patch) | |
tree | 07a72585b0ad295a13cdcd10bccb22aed28eb9fa /cypress | |
parent | fd73d3a991befde4d5f45cdcaac192da2a932a2e (diff) | |
download | nextcloud-server-eaad30c3461a662f68bd87bb76463847e4969f7f.tar.gz nextcloud-server-eaad30c3461a662f68bd87bb76463847e4969f7f.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 81108e456a3..49be392bc93 100644 --- a/cypress/e2e/files/files_copy-move.cy.ts +++ b/cypress/e2e/files/files_copy-move.cy.ts @@ -131,4 +131,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') + }) }) |