Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Co-authored-by: Blue F <blue@cypress.io>
  • Loading branch information
flotwig and Blue F committed Feb 1, 2022
1 parent d63aeac commit e1a2d00
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { expect } = require('chai')

const { _, $ } = Cypress

// Reading and decoding files from an input element would, in the real world,
Expand Down Expand Up @@ -185,6 +187,18 @@ describe('src/cy/commands/actions/selectFile', () => {
})
})

it('uses the AUT\'s File constructor', () => {
cy.window().then(($autWindow) => {
cy.get('#basic').selectFile('@foo', { action: 'select' }).then((input) => {
expect(input[0].files[0]).to.be.instanceOf($autWindow.File)
})

cy.get('#basic').selectFile('@foo', { action: 'drag-drop' }).then((input) => {
expect(input[0].files[0]).to.be.instanceOf($autWindow.File)
})
})
})

describe('shorthands', () => {
const validJsonString = `{
"foo": 1,
Expand Down

0 comments on commit e1a2d00

Please sign in to comment.