dashboard-ui.spec.ts 758 B

123456789101112131415161718192021
  1. describe('dashboard-ui', () => {
  2. beforeEach(() => {
  3. cy.visit('/dashboard-ui')
  4. cy.get('.uppy-Dashboard-input:first').as('file-input')
  5. })
  6. it('should not throw when calling uppy.close()', () => {
  7. cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
  8. cy.window().then(({ uppy }) => {
  9. expect(uppy.close()).to.not.throw
  10. })
  11. })
  12. it('should render thumbnails', () => {
  13. cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
  14. cy.get('.uppy-Dashboard-Item-previewImg')
  15. .should('have.length', 2)
  16. .each((element) => expect(element).attr('src').to.include('blob:'))
  17. })
  18. })