Skip to content

Commit

Permalink
Tests for focusCleanup option
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Jul 14, 2010
1 parent 044a627 commit c466947
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,26 @@ test("option: (un)highlight, custom2", function() {
ok( !l.is(".invalid") );
});

test("option: focusCleanup default false", function() {
var form = $("#userForm")
form.validate();
form.valid();
ok( form.is(":has(label.error[for=username]:visible)"));
$("#username").focus();
ok( form.is(":has(label.error[for=username]:visible)"));
});

test("option: focusCleanup true", function() {
var form = $("#userForm")
form.validate({
focusCleanup: true
});
form.valid();
ok( form.is(":has(label.error[for=username]):visible"));
$("#username").focus();
ok( !form.is(":has(label.error[for=username]:visible)"));
});

test("elements() order", function() {
var container = $("#orderContainer");
var v = $("#elementsOrder").validate({
Expand Down

0 comments on commit c466947

Please sign in to comment.