summaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/files/files_copy-move.cy.ts39
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')
+ })
})