@@ -414,24 +414,41 @@ test( "testValidateGroupedQty", function() {
414
414
} ) ;
415
415
416
416
test ( "testValidateCCTypeSelect" , function ( ) {
417
- expect ( 6 ) ;
417
+ expect ( 14 ) ;
418
418
var visaValid = $ ( '<input id="visa-valid" type="text" value="4916808263499650"/>' ) ;
419
419
var visaInvalid = $ ( '<input id="visa-invalid" type="text" value="1234567890123456"/>' ) ;
420
420
var mcValid = $ ( '<input id="mc-valid" type="text" value="5203731841177490"/>' ) ;
421
421
var mcInvalid = $ ( '<input id="mc-invalid" type="text" value="1111222233334444"/>' ) ;
422
422
var aeValid = $ ( '<input id="ae-valid" type="text" value="376244899619217"/>' ) ;
423
423
var aeInvalid = $ ( '<input id="ae-invalid" type="text" value="123451234512345"/>' ) ;
424
424
425
+ var diValid = $ ( '<input id="di-valid" type="text" value="6011050000000009"/>' ) ;
426
+ var diInvalid = $ ( '<input id="di-invalid" type="text" value="6011199900000005"/>' ) ;
427
+ var dnValid = $ ( '<input id="dn-valid" type="text" value="3095434000000001"/>' ) ;
428
+ var dnInvalid = $ ( '<input id="dn-invalid" type="text" value="3799999900000003"/>' ) ;
429
+ var jcbValid = $ ( '<input id="jcb-valid" type="text" value="3528000000000007"/>' ) ;
430
+ var jcbInvalid = $ ( '<input id="jcb-invalid" type="text" value="359000001111118"/>' ) ;
431
+ var upValid = $ ( '<input id="up-valid" type="text" value="6221260000000000"/>' ) ;
432
+ var upInvalid = $ ( '<input id="up-invalid" type="text" value="6229260000000002"/>' ) ;
433
+
425
434
ok ( $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'VI' , null , visaValid ) ) ;
426
435
ok ( ! $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'VI' , null , visaInvalid ) ) ;
427
436
ok ( $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'MC' , null , mcValid ) ) ;
428
437
ok ( ! $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'MC' , null , mcInvalid ) ) ;
429
438
ok ( $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'AE' , null , aeValid ) ) ;
430
439
ok ( ! $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'AE' , null , aeInvalid ) ) ;
440
+ ok ( $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'DI' , null , diValid ) ) ;
441
+ ok ( ! $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'DI' , null , diInvalid ) ) ;
442
+ ok ( $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'DN' , null , dnValid ) ) ;
443
+ ok ( ! $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'DN' , null , dnInvalid ) ) ;
444
+ ok ( $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'JCB' , null , jcbValid ) ) ;
445
+ ok ( ! $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'JCB' , null , jcbInvalid ) ) ;
446
+ ok ( $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'UP' , null , upValid ) ) ;
447
+ ok ( ! $ . validator . methods [ 'validate-cc-type-select' ] . call ( this , 'UP' , null , upInvalid ) ) ;
431
448
} ) ;
432
449
433
450
test ( "testValidateCCNumber" , function ( ) {
434
- expect ( 8 ) ;
451
+ expect ( 37 ) ;
435
452
ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '4916835098995909' , null , null ) ) ;
436
453
ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '5265071363284878' , null , null ) ) ;
437
454
ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6011120623356953' , null , null ) ) ;
@@ -440,16 +457,48 @@ test( "testValidateCCNumber", function() {
440
457
ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '5265071363284870' , null , null ) ) ;
441
458
ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6011120623356951' , null , null ) ) ;
442
459
ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '371293266574619' , null , null ) ) ;
460
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '2221220000000003' , null , null ) ) ;
461
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '2721220000000008' , null , null ) ) ;
462
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '601109020000000003' , null , null ) ) ;
463
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6011111144444444' , null , null ) ) ;
464
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6011222233334444' , null , null ) ) ;
465
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6011522233334447' , null , null ) ) ;
466
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '601174455555553' , null , null ) ) ;
467
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6011745555555550' , null , null ) ) ;
468
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '601177455555556' , null , null ) ) ;
469
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '601182455555556' , null , null ) ) ;
470
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '601187999555558' , null , null ) ) ;
471
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '601287999555556' , null , null ) ) ;
472
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6444444444444443' , null , null ) ) ;
473
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6644444444444441' , null , null ) ) ;
474
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3044444444444444' , null , null ) ) ;
475
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3064444444444449' , null , null ) ) ;
476
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3095444444444442' , null , null ) ) ;
477
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3096444444444441' , null , null ) ) ;
478
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3696444444444445' , null , null ) ) ;
479
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3796444444444444' , null , null ) ) ;
480
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3896444444444443' , null , null ) ) ;
481
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3528444444444449' , null , null ) ) ;
482
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '3529444444444448' , null , null ) ) ;
483
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6221262244444440' , null , null ) ) ;
484
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6229981111111111' , null , null ) ) ;
485
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6249981111111117' , null , null ) ) ;
486
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6279981111111110' , null , null ) ) ;
487
+ ok ( $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6282981111111115' , null , null ) ) ;
488
+ ok ( ! $ . validator . methods [ 'validate-cc-number' ] . call ( this , '6289981111111118' , null , null ) ) ;
443
489
} ) ;
444
490
445
491
test ( "testValidateCCType" , function ( ) {
446
- expect ( 8 ) ;
492
+ expect ( 14 ) ;
447
493
var select = $ ( '<select id="cc-type">' +
448
494
'<option value="">' +
449
495
'</option><option value="VI">' +
450
496
'</option><option value="MC">' +
451
497
'</option><option value="AE">' +
452
498
'</option><option value="DI">' +
499
+ '</option><option value="DN">' +
500
+ '</option><option value="JCB">' +
501
+ '</option><option value="UP">' +
453
502
'</option>' +
454
503
'</select>' ) ;
455
504
@@ -463,8 +512,17 @@ test( "testValidateCCType", function() {
463
512
ok ( $ . validator . methods [ 'validate-cc-type' ] . call ( this , '371293266574617' , null , select ) ) ;
464
513
ok ( ! $ . validator . methods [ 'validate-cc-type' ] . call ( this , '5265071363284878' , null , select ) ) ;
465
514
select . val ( 'DI' ) ;
466
- ok ( $ . validator . methods [ 'validate-cc-type' ] . call ( this , '6011000990139424' , null , select ) ) ;
467
- ok ( ! $ . validator . methods [ 'validate-cc-type' ] . call ( this , '4916835098995909' , null , select ) ) ;
515
+ ok ( $ . validator . methods [ 'validate-cc-type' ] . call ( this , '6011050000000009' , null , select ) ) ;
516
+ ok ( ! $ . validator . methods [ 'validate-cc-type' ] . call ( this , '371293266574617' , null , select ) ) ;
517
+ select . val ( 'DN' ) ;
518
+ ok ( $ . validator . methods [ 'validate-cc-type' ] . call ( this , '3095434000000001' , null , select ) ) ;
519
+ ok ( ! $ . validator . methods [ 'validate-cc-type' ] . call ( this , '6011050000000009' , null , select ) ) ;
520
+ select . val ( 'JCB' ) ;
521
+ ok ( $ . validator . methods [ 'validate-cc-type' ] . call ( this , '3528000000000007' , null , select ) ) ;
522
+ ok ( ! $ . validator . methods [ 'validate-cc-type' ] . call ( this , '3095434000000001' , null , select ) ) ;
523
+ select . val ( 'UP' ) ;
524
+ ok ( $ . validator . methods [ 'validate-cc-type' ] . call ( this , '6221260000000000' , null , select ) ) ;
525
+ ok ( ! $ . validator . methods [ 'validate-cc-type' ] . call ( this , '3528000000000007' , null , select ) ) ;
468
526
} ) ;
469
527
470
528
test ( "testValidateCCExp" , function ( ) {
0 commit comments