Skip to content

Commit c3006dc

Browse files
committed
tests: added test for missing 'name'
1 parent 22ef762 commit c3006dc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/netteForms/spec/Nette.validateRuleSpec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,17 @@ describe('Nette.getValue & validateRule', function() {
320320
expect(Nette.validateRule(el, 'minLength', 2)).toBe(true);
321321
expect(Nette.validateRule(el, 'minLength', 3)).toBe(false);
322322
});
323+
324+
325+
it('missing name', function() {
326+
fixtures.set('<form><input></form>');
327+
328+
var doc = fixtures.window().document,
329+
form = doc.forms[0],
330+
el = form.elements[0];
331+
332+
expect(Nette.getValue(el)).toEqual('');
333+
el.value = ' hello ';
334+
expect(Nette.getValue(el)).toBe('hello');
335+
});
323336
});

0 commit comments

Comments
 (0)