Skip to content

Commit

Permalink
Input with no type is a text input
Browse files Browse the repository at this point in the history
  • Loading branch information
artemave committed May 31, 2021
1 parent 66ae3bd commit 81b751d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/inputSelectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const selectors = (...sels) => {
}

const input = 'input'
const text = 'input[type=text]'
const text = 'input[type=text],input:not([type])'
const hidden = 'input[type=hidden]'
const email = 'input[type=email]'
const password = 'input[type=password]'
Expand Down
12 changes: 12 additions & 0 deletions test/setSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ describe('set', function () {
expect(assembly.find('.address').value).to.equal('7 Lola St')
})

it('can set text fields without explicit type', async () => {
assembly.insertHtml(`
<input class="address"/>
`)

await browser.set({
'.address': '7 Lola St',
})

expect(assembly.find('.address').value).to.equal('7 Lola St')
})

it('can set select fields', async () => {
assembly.insertHtml(`
<select>
Expand Down

0 comments on commit 81b751d

Please sign in to comment.