hyperform
Version:
Capture form validation back from the browser
17 lines (14 loc) • 450 B
JavaScript
import test from 'ava';
import willValidate from '../../../src/polyfills/willValidate';
test('willValidate', t => {
var input = document.createElement('input');
input.setAttribute('name', 'foo');
input.type = 'hidden';
t.false(willValidate(input));
input.type = 'text';
t.true(willValidate(input));
var select = document.createElement('select');
select.setAttribute('name', 'foo');
t.true(willValidate(select));
});
;