Skip to content

Commit bc412a7

Browse files
committed
unit tests for isValid()
1 parent f848b23 commit bc412a7

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

form-validator/qunit.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,32 @@
248248
});
249249
});
250250

251+
test('isValid()', function() {
252+
253+
$form.empty();
254+
$form.append(input('4000000000000002', {'allowing':'visa', '':'creditcard'}));
255+
$form.append(input('', {'optional':'true', '':'alphanumeric'}));
256+
$form.append(input('', 'alphanumeric'));
257+
$form.append(input('4000000000000002', 'alphanumeric'));
258+
259+
equal(
260+
$form.isValid(false, false, false),
261+
false
262+
);
263+
264+
$form.empty();
265+
$form.append(input('4000000000000002', {'allowing':'visa', '':'creditcard'}));
266+
$form.append(input('', {'optional':'true', '':'alphanumeric'}));
267+
$form.append(input('fff', 'alphanumeric'));
268+
$form.append(input('4000000000000002', 'alphanumeric'));
269+
270+
equal(
271+
$form.isValid(false, false, false),
272+
true
273+
);
274+
275+
});
276+
251277
/*
252278
* CVV VALIDATION
253279
*/

0 commit comments

Comments
 (0)