Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Further phone and date RegEx corrections. (TRAVIS: passed) (LINT: passed) #514

Closed
wants to merge 16 commits into from

4 participants

@g1smd

Updated and refactored GB phone RegEx pattern.
Fix holes in date validations.
Standardise comment format.
Updated reference URL.
Fix travis/lint errors.

@g1smd

Some overlap with 505 and 510.

@Synchro

I'm not sure what's going on here - you're reposting some changes from my fork in #510 in this pull request! If you backed out 3cc98ea and 3cc98ea, your changes would stand alone with no overlap.

While I'm here, how about some test cases for your phone number changes?

@g1smd

I thought I had your stuff in a separate branch. I'll also take a look at the tests.

@Synchro

No problem - I just noticed that GitHub doesn't let you fork a repo if you already have a fork of its parent.

@Synchro

I'm not sure why you're saying it's tested - I don't see any new tests for your changes, i.e. to prevent regression to the previous cases that passed when they should not have. I don't see why you backed out the changes in 032e9e8.
Also this is still treading all over my pull request which you copied.

@g1smd

Add escaping. Fixes errors highlighted by Travis.

@g1smd

Merged. Updated. Tested (TRAVIS: passed; LINT: passed). Ready to Commit.

@Synchro

I can't see your fork in Travis-ci, and the 'details' link above doesn't point at anything useful. Have I missed something?

@g1smd

Have I missed something?

Yes, look at the red and green dots over to the right side of the box, but only on recent commits.

If you merge your repo with the master, you'll get your first personalised Travis report this way too.

@g1smd

Merged. Updated. Tested (TRAVIS: passed; LINT: passed). Ready to Commit.

@jzaefferer
Owner

Does this still overlap with #510? Would be good to merge that separately. Also an interactive rebase to squash most of the fixup commits would help. Btw. what are all the whitespace changes in test files about?

@g1smd

It does overlap with 510 as they are proposing something slightly different (and I guess 510 will throw errors in Travis).

The whitespace didn't seem consistent, tried to make it more so. Code alignment also helps readability.

@jzaefferer
Owner

Travis just runs grunt, so let's refer to that. Can you do the rebase and squashing?

@g1smd

Last time I tried rebase, it completely messed up. I'm a bit wary of it now.

@jzaefferer
Owner

Try git rebase master -i and follow the instructions in the editor. When done, check the log to see if it all looks good, before you force-push back to GitHub.

@g1smd

I'm not using Linux.

@jzaefferer
Owner

Its the same command on every system, its just git. If you're using a GUI tool on Windows, install msysgit.

@g1smd

I don't think it will help matters:

One of the vast uses of git rebase -i is reordering commits.Do NOT rebase commits that have been pushed publicly. If you’re working with other developers, that will make the merge non fast-forwardable and creates headaches for all involved. Yes, the command allows one to rewrite history, but only do so when the commits are still on your local machine.

@Synchro

Really, your repo is really a private one that happens to be publicly visible - nobody has made any forks from it, so don't worry about it, go ahead and do the rebase.

@jzaefferer
Owner

Yep, I wouldn't have asked for a rebase otherwise. That warning very much applies to commits pushed to this repo's master branch. But not to other branches or even forks.

@g1smd

-> "Nothing needs rebase; master equal remote/origin/master".

@Synchro

You're missing the point - rebasing will convert the 16 commits in this pull request into 1, making for a much tidier merge upstream. The result is the same, it's just less messy.

@nschonni
Collaborator

I think @jzaefferer was talking about this kind of rebase http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html not just playing back your commits onto of the remote master.

@jzaefferer jzaefferer closed this pull request from a commit
@g1smd g1smd Updated and corrected GB RegEx pattern. Minor refactor of RegEx patte…
…rn. Minor RegEx refactor for efficiency. Fix holes in date validations. Closes gh-514
45154af
@jzaefferer
Owner

Rebased onto master, squashing into a single commit and fixing a few lint issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 16, 2012
  1. @g1smd
  2. @g1smd

    Minor refactor of RegEx pattern.

    g1smd authored
  3. @g1smd
  4. @g1smd

    Fix holes in date validations.

    g1smd authored
  5. @g1smd
  6. @g1smd

    Minor edit to comment.

    g1smd authored
Commits on Sep 17, 2012
  1. @g1smd

    Minor RegEx changes.

    g1smd authored
  2. @g1smd

    Standardise comment format.

    g1smd authored
  3. @g1smd

    Adjust character group.

    g1smd authored
Commits on Nov 6, 2012
  1. @g1smd

    Updated URL.

    g1smd authored
  2. @g1smd

    Merge branch 'master' of https://github.com/jzaefferer/jquery-validation

    g1smd authored
    
    
    Conflicts:
    	additional-methods.js
  3. @g1smd

    Fix travis/lint errors.

    g1smd authored
  4. @g1smd

    Revert 2 lines.

    g1smd authored
  5. @g1smd

    12-hour am/pm

    g1smd authored
  6. @g1smd

    Optional space.

    g1smd authored
Commits on Nov 11, 2012
  1. @g1smd
This page is out of date. Refresh to see the latest.
Showing with 95 additions and 94 deletions.
  1. +12 −11 additional-methods.js
  2. +82 −82 test/methods.js
  3. +1 −1  test/test.js
View
23 additional-methods.js
@@ -156,15 +156,15 @@ jQuery.validator.addMethod("dateITA", function(value, element) {
}, "Please enter a correct date");
jQuery.validator.addMethod("dateNL", function(value, element) {
- return this.optional(element) || /^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test(value);
+ return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value);
}, "Vul hier een geldige datum in.");
jQuery.validator.addMethod("time", function(value, element) {
- return this.optional(element) || /^([0-1]\d|2[0-3]):([0-5]\d)$/.test(value);
+ return this.optional(element) || /^([01]\d|2[0-3])(:[0-5]\d){1,2}$/.test(value);
}, "Please enter a valid time, between 00:00 and 23:59");
jQuery.validator.addMethod("time12h", function(value, element) {
- return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$/i.test(value);
-}, "Please enter a valid time, between 00:00 am and 12:00 pm");
+ return this.optional(element) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(value);
+}, "Please enter a valid time in 12-hour am/pm format");
/**
* matches US phone number format
@@ -191,27 +191,28 @@ jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
phone_number = phone_number.replace(/\(|\)|\s+|-/g,'');
return this.optional(element) || phone_number.length > 9 &&
- phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:(?:\d{5}\)?\s?\d{4,5})|(?:\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3}))|(?:\d{3}\)?\s?\d{3}\s?\d{3,4})|(?:\d{2}\)?\s?\d{4}\s?\d{4}))$/);
+ phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/);
}, 'Please specify a valid phone number');
jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
- phone_number = phone_number.replace(/\s+|-/g,'');
+ phone_number = phone_number.replace(/\(|\)|\s+|-/g,'');
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[45789]\d{2}|624)\s?\d{3}\s?\d{3})$/);
}, 'Please specify a valid mobile number');
//Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers
jQuery.validator.addMethod('phonesUK', function(phone_number, element) {
- phone_number = phone_number.replace(/\s+|-/g,'');
+ phone_number = phone_number.replace(/\(|\)|\s+|-/g,'');
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[45789]\d{8}|624\d{6})))$/);
}, 'Please specify a valid uk phone number');
// On the above three UK functions, do the following server side processing:
-// Compare with ^((?:00\s?|\+)(44)\s?)?\(?0?(?:\)\s?)?([1-9]\d{1,4}\)?[\d\s]+)
-// Extract $2 and set $prefix to '+44<space>' if $2 is '44' otherwise set $prefix to '0'
-// Extract $3 and remove spaces and parentheses. Phone number is combined $2 and $3.
+// Compare original input with this RegEx pattern:
+// ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$
+// Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0'
+// Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2.
// A number of very detailed GB telephone number RegEx patterns can also be found at:
-// http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_UK_Telephone_Numbers
+// http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers
//Matches UK postcode. based on http://snipplr.com/view/3152/postcode-validation/
jQuery.validator.addMethod('postcodeUK', function(postcode, element) {
View
164 test/methods.js
@@ -232,18 +232,18 @@ test("required with dependencies", function() {
var v = jQuery("#form").validate(),
method = $.validator.methods.required,
e = $('#hidden2, #select1, #area2, #radio1, #check2');
- ok( method.call( v, e[0].value, e[0], "asffsaa"), "Valid text input due to depencie not met" );
- ok(!method.call( v, e[0].value, e[0], "input"), "Invalid text input" );
+ ok( method.call( v, e[0].value, e[0], "asffsaa" ), "Valid text input due to depencie not met" );
+ ok(!method.call( v, e[0].value, e[0], "input" ), "Invalid text input" );
ok( method.call( v, e[0].value, e[0], function() { return false; }), "Valid text input due to depencie not met" );
ok(!method.call( v, e[0].value, e[0], function() { return true; }), "Invalid text input" );
- ok( method.call( v, e[1].value, e[1], "asfsfa"), "Valid select due to dependency not met" );
- ok(!method.call( v, e[1].value, e[1], "input"), "Invalid select" );
- ok( method.call( v, e[2].value, e[2], "asfsafsfa"), "Valid textarea due to dependency not met" );
- ok(!method.call( v, e[2].value, e[2], "input"), "Invalid textarea" );
- ok( method.call( v, e[3].value, e[3], "asfsafsfa"), "Valid radio due to dependency not met" );
- ok(!method.call( v, e[3].value, e[3], "input"), "Invalid radio" );
- ok( method.call( v, e[4].value, e[4], "asfsafsfa"), "Valid checkbox due to dependency not met" );
- ok(!method.call( v, e[4].value, e[4], "input"), "Invalid checkbox" );
+ ok( method.call( v, e[1].value, e[1], "asfsfa" ), "Valid select due to dependency not met" );
+ ok(!method.call( v, e[1].value, e[1], "input" ), "Invalid select" );
+ ok( method.call( v, e[2].value, e[2], "asfsafsfa" ), "Valid textarea due to dependency not met" );
+ ok(!method.call( v, e[2].value, e[2], "input" ), "Invalid textarea" );
+ ok( method.call( v, e[3].value, e[3], "asfsafsfa" ), "Valid radio due to dependency not met" );
+ ok(!method.call( v, e[3].value, e[3], "input" ), "Invalid radio" );
+ ok( method.call( v, e[4].value, e[4], "asfsafsfa" ), "Valid checkbox due to dependency not met" );
+ ok(!method.call( v, e[4].value, e[4], "input" ), "Invalid checkbox" );
});
test("minlength", function() {
@@ -334,15 +334,15 @@ test("equalTo", function() {
var v = jQuery("#form").validate();
var method = $.validator.methods.equalTo,
e = $('#text1, #text2');
- ok( method.call( v, "Test", e[0], "#text1"), "Text input" );
- ok( method.call( v, "T", e[1], "#text2"), "Another one" );
+ ok( method.call( v, "Test", e[0], "#text1" ), "Text input" );
+ ok( method.call( v, "T", e[1], "#text2" ), "Another one" );
});
test("creditcard", function() {
var method = methodTest("creditcard");
ok( method( "446-667-651" ), "Valid creditcard number" );
ok( method( "446 667 651" ), "Valid creditcard number" );
- ok( !method( "asdf" ), "Invalid creditcard number" );
+ ok(!method( "asdf" ), "Invalid creditcard number" );
});
test("extension", function() {
@@ -351,21 +351,21 @@ test("extension", function() {
ok( method( "picture.jpg" ), "Valid default accept type" );
ok( method( "picture.jpeg" ), "Valid default accept type" );
ok( method( "picture.png" ), "Valid default accept type" );
- ok( !method( "picture.pgn" ), "Invalid default accept type" );
+ ok(!method( "picture.pgn" ), "Invalid default accept type" );
var v = jQuery("#form").validate(),
method = function(value, param) {
return $.validator.methods.extension.call(v, value, $('#text1')[0], param);
};
- ok( method( "picture.doc", "doc"), "Valid custom accept type" );
- ok( method( "picture.pdf", "doc|pdf"), "Valid custom accept type" );
- ok( method( "picture.pdf", "pdf|doc"), "Valid custom accept type" );
- ok( !method( "picture.pdf", "doc"), "Invalid custom accept type" );
- ok( !method( "picture.doc", "pdf"), "Invalid custom accept type" );
+ ok( method( "picture.doc", "doc" ), "Valid custom accept type" );
+ ok( method( "picture.pdf", "doc|pdf" ), "Valid custom accept type" );
+ ok( method( "picture.pdf", "pdf|doc" ), "Valid custom accept type" );
+ ok(!method( "picture.pdf", "doc" ), "Invalid custom accept type" );
+ ok(!method( "picture.doc", "pdf" ), "Invalid custom accept type" );
- ok( method( "picture.pdf", "doc,pdf"), "Valid custom accept type, comma seperated" );
- ok( method( "picture.pdf", "pdf,doc"), "Valid custom accept type, comma seperated" );
- ok( !method( "picture.pdf", "gop,top"), "Invalid custom accept type, comma seperated" );
+ ok( method( "picture.pdf", "doc,pdf" ), "Valid custom accept type, comma seperated" );
+ ok( method( "picture.pdf", "pdf,doc" ), "Valid custom accept type, comma seperated" );
+ ok(!method( "picture.pdf", "gop,top" ), "Invalid custom accept type, comma seperated" );
});
test("remote", function() {
@@ -556,15 +556,15 @@ test("mobileUK", function() {
var method = methodTest("mobileUK");
ok( method( "07734234323" ), "Valid UK Mobile Number" );
ok( method( "+447734234323" ), "Valid UK Mobile Number" );
- ok( !method( "07034234323" ), "Invalid UK Mobile Number" );
- ok( !method( "0753423432" ), "Invalid UK Mobile Number" );
- ok( !method( "07604234323" ), "Invalid UK Mobile Number" );
- ok( !method( "077342343234" ), "Invalid UK Mobile Number" );
- ok( !method( "044342343234" ), "Invalid UK Mobile Number" );
- ok( !method( "+44753423432" ), "Invalid UK Mobile Number" );
- ok( !method( "+447604234323" ), "Invalid UK Mobile Number" );
- ok( !method( "+4477342343234" ), "Invalid UK Mobile Number" );
- ok( !method( "+4444342343234" ), "Invalid UK Mobile Number" );
+ ok(!method( "07034234323" ), "Invalid UK Mobile Number" );
+ ok(!method( "0753423432" ), "Invalid UK Mobile Number" );
+ ok(!method( "07604234323" ), "Invalid UK Mobile Number" );
+ ok(!method( "077342343234" ), "Invalid UK Mobile Number" );
+ ok(!method( "044342343234" ), "Invalid UK Mobile Number" );
+ ok(!method( "+44753423432" ), "Invalid UK Mobile Number" );
+ ok(!method( "+447604234323" ), "Invalid UK Mobile Number" );
+ ok(!method( "+4477342343234" ), "Invalid UK Mobile Number" );
+ ok(!method( "+4444342343234" ), "Invalid UK Mobile Number" );
});
test("dateITA", function() {
@@ -576,63 +576,63 @@ test("dateITA", function() {
test("time", function() {
var method = methodTest("time");
- ok( method("00:00"), "Valid time, lower bound" );
- ok( method("23:59"), "Valid time, upper bound" );
- ok( !method("12"), "Invalid time" );
- ok( !method("00:60"), "Invalid time" );
- ok( !method("24:60"), "Invalid time" );
- ok( !method("24:00"), "Invalid time" );
- ok( !method("29:59"), "Invalid time" );
- ok( !method("30:00"), "Invalid time" );
+ ok( method( "00:00" ), "Valid time, lower bound" );
+ ok( method( "23:59" ), "Valid time, upper bound" );
+ ok(!method( "12" ), "Invalid time" );
+ ok(!method( "00:60" ), "Invalid time" );
+ ok(!method( "24:60" ), "Invalid time" );
+ ok(!method( "24:00" ), "Invalid time" );
+ ok(!method( "29:59" ), "Invalid time" );
+ ok(!method( "30:00" ), "Invalid time" );
});
test("time12h", function() {
var method = methodTest("time12h");
- ok( method("12:00 AM"), "Valid time, lower bound, am" );
- ok( method("11:59 AM"), "Valid time, upper bound, am" );
- ok( method("12:00 PM"), "Valid time, lower bound, pm" );
- ok( method("11:59 PM"), "Valid time, upper bound, pm" );
- ok( method("11:59 am"), "Valid time, also accept lowercase" );
- ok( method("11:59 pm"), "Valid time, also accept lowercase" );
- ok( !method("12:00"), "Invalid time" );
- ok( !method("12:61 am"), "Invalid time" );
- ok( !method("13:00 am"), "Invalid time" );
+ ok( method( "12:00 AM" ), "Valid time, lower bound, am" );
+ ok( method( "11:59 AM" ), "Valid time, upper bound, am" );
+ ok( method( "12:00 PM" ), "Valid time, lower bound, pm" );
+ ok( method( "11:59 PM" ), "Valid time, upper bound, pm" );
+ ok( method( "11:59 am" ), "Valid time, also accept lowercase" );
+ ok( method( "11:59 pm" ), "Valid time, also accept lowercase" );
+ ok(!method( "12:00" ), "Invalid time" );
+ ok(!method( "12:61 am" ), "Invalid time" );
+ ok(!method( "13:00 am" ), "Invalid time" );
});
test("minWords", function() {
var method = methodTest("minWords");
- ok( method("hello worlds", 2), "plain text, valid" );
- ok( method("<b>hello</b> world", 2), "html, valid" );
- ok( !method("hello", 2), "plain text, invalid" );
- ok( !method("<b>world</b>", 2), "html, invalid" );
- ok( !method("world <br/>", 2), "html, invalid" );
+ ok( method( "hello worlds", 2 ), "plain text, valid" );
+ ok( method( "<b>hello</b> world", 2 ), "html, valid" );
+ ok(!method( "hello", 2 ), "plain text, invalid" );
+ ok(!method( "<b>world</b>", 2 ), "html, invalid" );
+ ok(!method( "world <br/>", 2 ), "html, invalid" );
});
test("maxWords", function() {
var method = methodTest("maxWords");
- ok( method("hello", 2), "plain text, valid" );
- ok( method("<b>world</b>", 2), "html, valid" );
- ok( method("world <br/>", 2), "html, valid" );
- ok( method("hello worlds", 2), "plain text, valid" );
- ok( method("<b>hello</b> world", 2), "html, valid" );
- ok( !method("hello 123 world", 2), "plain text, invalid" );
- ok( !method("<b>hello</b> 123 world", 2), "html, invalid" );
+ ok( method( "hello", 2 ), "plain text, valid" );
+ ok( method( "<b>world</b>", 2 ), "html, valid" );
+ ok( method( "world <br/>", 2 ), "html, valid" );
+ ok( method( "hello worlds", 2 ), "plain text, valid" );
+ ok( method( "<b>hello</b> world", 2 ), "html, valid" );
+ ok(!method( "hello 123 world", 2 ), "plain text, invalid" );
+ ok(!method( "<b>hello</b> 123 world", 2 ), "html, invalid" );
});
test("rangeWords", function() {
var method = methodTest("rangeWords");
- ok( method("hello", [0, 2]), "plain text, valid" );
- ok( method("hello worlds", [0, 2]), "plain text, valid" );
- ok( method("<b>hello</b> world", [0, 2]), "html, valid" );
- ok( !method("hello worlds what is up", [0, 2]), "plain text, invalid" );
- ok( !method("<b>Hello</b> <b>world</b> <b>hello</b>", [0, 2]), "html, invalid" );
+ ok( method( "hello", [0, 2] ), "plain text, valid" );
+ ok( method( "hello worlds", [0, 2] ), "plain text, valid" );
+ ok( method( "<b>hello</b> world", [0, 2] ), "html, valid" );
+ ok(!method( "hello worlds what is up", [0, 2] ), "plain text, invalid" );
+ ok(!method( "<b>Hello</b> <b>world</b> <b>hello</b>", [0, 2] ), "html, invalid" );
});
test("pattern", function() {
var method = methodTest("pattern");
ok( method( "AR1004", "AR\\d{4}" ), "Correct format for the given RegExp" );
ok( method( "AR1004", /^AR\d{4}$/ ), "Correct format for the given RegExp" );
- ok( !method( "BR1004", /^AR\d{4}$/ ), "Invalid format for the given RegExp" );
+ ok(!method( "BR1004", /^AR\d{4}$/ ), "Invalid format for the given RegExp" );
});
function testCardTypeByNumber(number, cardname, expected) {
@@ -653,15 +653,15 @@ test('creditcardtypes, all', function() {
}
});
- testCardTypeByNumber("4111-1111-1111-1111", "VISA", true)
- testCardTypeByNumber("5111-1111-1111-1118", "MasterCard", true)
- testCardTypeByNumber("6111-1111-1111-1116", "Discover", true)
- testCardTypeByNumber("3400-0000-0000-009", "AMEX", true);
+ testCardTypeByNumber( "4111-1111-1111-1111", "VISA", true )
+ testCardTypeByNumber( "5111-1111-1111-1118", "MasterCard", true )
+ testCardTypeByNumber( "6111-1111-1111-1116", "Discover", true )
+ testCardTypeByNumber( "3400-0000-0000-009", "AMEX", true );
- testCardTypeByNumber("4111-1111-1111-1110", "VISA", false)
- testCardTypeByNumber("5432-1111-1111-1111", "MasterCard", false)
- testCardTypeByNumber("6611-6611-6611-6611", "Discover", false)
- testCardTypeByNumber("3777-7777-7777-7777", "AMEX", false)
+ testCardTypeByNumber( "4111-1111-1111-1110", "VISA", false )
+ testCardTypeByNumber( "5432-1111-1111-1111", "MasterCard", false )
+ testCardTypeByNumber( "6611-6611-6611-6611", "Discover", false )
+ testCardTypeByNumber( "3777-7777-7777-7777", "AMEX", false )
});
@@ -677,10 +677,10 @@ test('creditcardtypes, visa', function() {
}
});
- testCardTypeByNumber("4111-1111-1111-1111", "VISA", true)
- testCardTypeByNumber("5111-1111-1111-1118", "MasterCard", false)
- testCardTypeByNumber("6111-1111-1111-1116", "Discover", false)
- testCardTypeByNumber("3400-0000-0000-009", "AMEX", false);
+ testCardTypeByNumber( "4111-1111-1111-1111", "VISA", true )
+ testCardTypeByNumber( "5111-1111-1111-1118", "MasterCard", false )
+ testCardTypeByNumber( "6111-1111-1111-1116", "Discover", false )
+ testCardTypeByNumber( "3400-0000-0000-009", "AMEX", false );
});
test('creditcardtypes, mastercard', function() {
@@ -695,10 +695,10 @@ test('creditcardtypes, mastercard', function() {
}
});
- testCardTypeByNumber("5111-1111-1111-1118", "MasterCard", true)
- testCardTypeByNumber("6111-1111-1111-1116", "Discover", false)
- testCardTypeByNumber("3400-0000-0000-009", "AMEX", false);
- testCardTypeByNumber("4111-1111-1111-1111", "VISA", false);
+ testCardTypeByNumber( "5111-1111-1111-1118", "MasterCard", true )
+ testCardTypeByNumber( "6111-1111-1111-1116", "Discover", false )
+ testCardTypeByNumber( "3400-0000-0000-009", "AMEX", false );
+ testCardTypeByNumber( "4111-1111-1111-1111", "VISA", false );
});
function fillFormWithValuesAndExpect(formSelector, inputValues, expected) {
View
2  test/test.js
@@ -40,7 +40,7 @@ test("Constructor", function() {
});
test("validate() without elements, with non-form elements", 0, function() {
- $("#doesn'texist").validate();
+ $("#doesntexist").validate();
});
test("valid() plugin method", function() {
Something went wrong with that request. Please try again.