diff --git a/e2e/clients/react/App.jsx b/e2e/clients/react/App.jsx index ba0aa45846..cfd68bcc5c 100644 --- a/e2e/clients/react/App.jsx +++ b/e2e/clients/react/App.jsx @@ -4,13 +4,18 @@ import Uppy from '@uppy/core' import React, { useState } from 'react' import { Dashboard, DashboardModal, DragDrop } from '@uppy/react' import ThumbnailGenerator from '@uppy/thumbnail-generator' +import RemoteSources from '@uppy/remote-sources' import '@uppy/core/dist/style.css' import '@uppy/dashboard/dist/style.css' import '@uppy/drag-drop/dist/style.css' export default function App () { - const uppyDashboard = new Uppy({ id: 'dashboard' }) + const RemoteSourcesOptions = { + companionUrl: 'http://companion.uppy.io', + sources: ['GoogleDrive', 'OneDrive', 'Unsplash', 'Zoom', 'Url'], + } + const uppyDashboard = new Uppy({ id: 'dashboard' }).use(RemoteSources, { ...RemoteSourcesOptions }) const uppyModal = new Uppy({ id: 'modal' }) const uppyDragDrop = new Uppy({ id: 'drag-drop' }).use(ThumbnailGenerator) const [open, setOpen] = useState(false) diff --git a/e2e/cypress/integration/react.spec.ts b/e2e/cypress/integration/react.spec.ts index b3120e7b57..f0f143c6ef 100644 --- a/e2e/cypress/integration/react.spec.ts +++ b/e2e/cypress/integration/react.spec.ts @@ -13,6 +13,16 @@ describe('@uppy/react', () => { .each((element) => expect(element).attr('src').to.include('blob:')) }) + it('should render Dashboard with Remote Sources plugin pack', () => { + const sources = ['My Device', 'Google Drive', 'OneDrive', 'Unsplash', 'Zoom', 'Link'] + cy.get('#dashboard .uppy-DashboardTab-name') + .each((item, index, list) => { + expect(list).to.have.length(6) + // Returns the current element from the loop + expect(Cypress.$(item).text()).to.eq(sources[index]) + }) + }) + it('should render Modal in React and show thumbnails', () => { cy.get('#open').click() cy.get('@modal-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })