diff --git a/e2e/cypress/fixtures/images/cat-symbolic-link b/e2e/cypress/fixtures/images/cat-symbolic-link new file mode 120000 index 0000000000..d9dd9f2118 --- /dev/null +++ b/e2e/cypress/fixtures/images/cat-symbolic-link @@ -0,0 +1 @@ +./cat.jpg \ No newline at end of file diff --git a/e2e/cypress/fixtures/images/cat-symbolic-link.jpg b/e2e/cypress/fixtures/images/cat-symbolic-link.jpg new file mode 120000 index 0000000000..d9dd9f2118 --- /dev/null +++ b/e2e/cypress/fixtures/images/cat-symbolic-link.jpg @@ -0,0 +1 @@ +./cat.jpg \ No newline at end of file diff --git a/e2e/cypress/integration/dashboard-ui.spec.ts b/e2e/cypress/integration/dashboard-ui.spec.ts index f68ec8b156..f322ead87f 100644 --- a/e2e/cypress/integration/dashboard-ui.spec.ts +++ b/e2e/cypress/integration/dashboard-ui.spec.ts @@ -2,6 +2,7 @@ describe('dashboard-ui', () => { beforeEach(() => { cy.visit('/dashboard-ui') cy.get('.uppy-Dashboard-input:first').as('file-input') + cy.get('.uppy-Dashboard-AddFiles').as('drop-target') }) it('should not throw when calling uppy.close()', () => { @@ -18,4 +19,19 @@ describe('dashboard-ui', () => { .should('have.length', 2) .each((element) => expect(element).attr('src').to.include('blob:')) }) + + it('should support drag&drop', () => { + cy.get('@drop-target').selectFile([ + 'cypress/fixtures/images/cat.jpg', + 'cypress/fixtures/images/cat-symbolic-link', + 'cypress/fixtures/images/cat-symbolic-link.jpg', + 'cypress/fixtures/images/traffic.jpg', + ], { action: 'drag-drop' }) + + cy.get('.uppy-Dashboard-Item') + .should('have.length', 4) + cy.get('.uppy-Dashboard-Item-previewImg') + .should('have.length', 3) + .each((element) => expect(element).attr('src').to.include('blob:')) + }) })