Subversion Repositories DevTools

Rev

Rev 5506 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5048 dpurdie 1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <meta charset="utf-8">
5
    <title>QUnit Tests</title>
6
    <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.12.0.css">
7
</head>
8
<body>
9
 
10
<div id="qunit"></div>
11
<div id="qunit-fixture"></div>
12
<form id="dummy-form" style="visibility: hidden"></form>
13
 
14
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
15
<script src="jquery.form-validator.js"></script>
16
<script src="//code.jquery.com/qunit/qunit-1.12.0.js"></script>
17
<script>
18
(function($) {
19
 
20
    var $form = $('#dummy-form'), $in=null;
21
    window.$form = $form;
22
    window.$in = $in;
23
 
24
    function input(val, dataValidationAttr, elAttr) {
25
        if(!elAttr)
26
            elAttr = {};
27
        if( typeof dataValidationAttr == 'string') {
28
            elAttr['data-validation'] = dataValidationAttr;
29
        } else if(dataValidationAttr) {
30
            $.each(dataValidationAttr, function(x, val) {
31
                if( x == '' ) {
32
                    elAttr['data-validation'] = val;
33
                } else {
34
                    elAttr['data-validation-'+x] = val;
35
                }
36
            });
37
        }
38
 
39
        elAttr['value'] = val;
40
        $in = $('<input />', elAttr);
41
        $in.appendTo($form);
42
        return $in;
43
    }
44
 
45
    function clearForm() {
46
        $form.children().remove();
47
    }
48
 
49
    function runTest(obj, validation) {
50
        var $el = typeof obj.val == 'string' ? input(obj.val, validation) : obj.val;
51
        var result = $.formUtils.validateInput($el, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
52
 
53
        var message;
54
        if( typeof obj.val == 'string' ) {
55
            message  = 'Check that "'+obj.val+'" is '+(obj.isValid ? 'valid':'invalid');
56
        } else {
57
            message = 'Check that input[value="'+obj.val.attr('value')+'"] is '+(obj.isValid ? 'valid':'invalid');
58
        }
59
 
60
        if( result === null && obj.isValid ) {
61
            equal(
62
                result,
63
                null,
64
                message
65
            );
66
        }
67
        else if( $el.attr('data-validation-optional') && !$el.val() ) {
68
            equal(
69
                result,
70
                null,
71
                message
72
            );
73
        } else {
74
            equal(
75
                typeof(result),
76
                obj.isValid ? 'boolean':'string', // returns true if valid, error message otherwise
77
                message
78
            );
79
        }
80
    }
81
 
82
    function runAllTests() {
83
 
84
        /*
85
         * Test error message
86
         */
87
        test('Error messages', function() {
88
            var $input = input('', {'':'required'}),
89
                mess = $.formUtils.validateInput($input, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
90
 
91
            equal('You have not answered all required fields', mess, 'Incorrect message');
92
 
93
            $input = input('--', {'':'required alphanumeric', 'error-msg-alphanumeric':'custom for alphanum'}),
94
            mess = $.formUtils.validateInput($input, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
95
            equal('custom for alphanum', mess, 'Incorrect message');
96
 
97
            $input = input('sam', {'':'required alphanumeric length', length:'min10', 'error-msg-alphanumeric':'custom for alphanum'}),
98
            mess = $.formUtils.validateInput($input, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
99
            equal('The input value is shorter than 10 characters', mess, 'Incorrect message');
100
 
101
        });
102
 
103
        /*
104
         * E-MAIL VALIDATION
105
         */
106
        test("E-mail validation", function() {
107
 
108
            clearForm();
109
 
110
            var values = [
111
                {val: 'sasas@sdssds.se', isValid : true},
112
                {val: 'sasás@sdssds.se', isValid : false},
113
                {val: 'sas+as@sdssds.se', isValid : true},
114
                {val: '', isValid : false},
115
                {val: 'asdsd@sdsds.se', isValid : true},
116
                {val: 'valid-domain@website.COM', isValid : true},
117
                {val: 'asdsdsd@sdsd.co.uk', isValid : true},
118
                {val: 'sasas@sdsd.xxx', isValid : true},
119
                {val: 'sasas@sdsd.xxz', isValid : true},
120
                {val: '@sdsd.xxz', isValid : false},
121
                {val: 'sasas@', isValid : false},
122
                {val: 'sasas.se', isValid : false},
123
                {val: 'sasas-sdsd.com', isValid : false}
124
            ];
125
 
126
            $.each(values, function(i, obj) {
127
                runTest(obj, 'email');
128
            });
129
        });
130
 
131
        /*
132
         * URL VALIDATION
133
         */
134
        test("URL validation", function() {
135
 
136
            clearForm();
137
 
138
            var links = [
139
                {val: 'klsdmfklsmdf', isValid: false},
140
                {val: 'http://google.se', isValid: true},
141
                {val: 'https://google.se/test/?arge=hej_&arg[]=123', isValid: true},
142
                {val: 'http://google.test.de', isValid: true},
143
                {val: 'http://test.xn--fiqz9s', isValid: true},
144
                {val: 'http://test.youtube', isValid: true},
145
                {val: 'http://google.test.co.uk/', isValid: true}
146
            ];
147
 
148
            $.each(links, function(i, obj) {
149
                runTest(obj, 'url');
150
            });
151
        });
152
 
153
 
154
        /*
155
         * DOMAIN VALIDATION
156
         */
157
        test("Domain validation", function() {
158
 
159
            clearForm();
160
 
161
            var links = [
162
                {val:'domain.xxx', isValid:true},
163
                {val:'domain.com', isValid:true},
164
                {val:'www.domain.com', isValid:true},
165
                {val:'test.xn--fiqz9s', isValid:true},
166
                {val:'test..xn--fiqz9s', isValid:false},
167
                {val:'q.com', isValid:true},
168
                {val:'amazone.website.tippit.de', isValid:true},
169
                {val:'amazone.website.co.uk', isValid:true},
170
                {val:'http://domain.se', isValid:false},
171
                {val:'http://www.domain.se', isValid:false},
172
                {val:'http://www.domain.se/', isValid:false},
173
                {val:'domain.com/', isValid:false},
174
                {val:'', isValid:false},
175
                {val:'asdfasdf', isValid:false}
176
            ];
177
 
178
            $.each(links, function(i, obj) {
179
                runTest(obj, 'domain');
180
            });
181
        });
182
 
183
        /*
184
         * REQUIRED VALIDATION
185
         */
186
        test("Require validation", function() {
187
 
188
            clearForm();
189
 
190
            var links = [
191
                {val:'a', isValid:true},
192
                {val:'asdf askldfmlksamdf', isValid:true},
193
                {val:'  ', isValid:false},
194
                {val:"\n", isValid:false},
195
                {val:'', isValid:false}
196
            ];
197
 
198
            $.each(links, function(i, obj) {
199
                runTest(obj, 'required');
200
            });
201
        });
202
 
203
        /*
204
         * ALPHANUMERIC VALIDATION
205
         */
206
        test("Alphanumeric validation", function() {
207
 
208
            clearForm();
209
 
210
            var links = [
211
                {val:'a', isValid:true},
212
                {val:'asdXAvs1', isValid:true},
213
                {val:'a  b', isValid:false},
214
                {val:'a-_ bäöåA', isValid:false},
215
                {val:'abbb', isValid:true},
216
                {val:'a,bbb', isValid:false},
217
                {val:input('a,bbb', {'allowing':',', '':'alphanumeric'}), isValid:true},
218
                {val:input('a b', {'allowing':' ', '':'alphanumeric'}), isValid:true},
219
                {val:input('', {'allowing':' ', length:'3-12', '':'length alphanumeric'}), isValid:false},
220
                {val:input('a-_ bäöåÖA', {'allowing':' -_öäåÄÖÅ', '':'alphanumeric'}), isValid:true}
221
            ];
222
 
223
            $.each(links, function(i, obj) {
224
                runTest(obj, 'alphanumeric');
225
            });
226
        });
227
 
228
        /*
229
         * CREDIT CARD VALIDATION
230
         */
231
        test("Credit card validation", function() {
232
 
233
            clearForm();
234
 
235
            var links = [
236
                {val:'4000000000000002', isValid:true},
237
                {val:input('4000000000000002', {'allowing':'visa', '':'creditcard'}), isValid:true},
238
                {val:input('4000000000000002', {'allowing':'mastercard, discover, visa', '':'creditcard'}), isValid:true},
239
                {val:input('501800000009', {'allowing':'maestro', '':'creditcard'}), isValid:true},
240
                {val:input('501800000009', {'allowing':'visa', '':'creditcard'}), isValid:false},
241
                {val:input('501800000009', {'allowing':'jadajada,maestro,mastercard', '':'creditcard'}), isValid:true},
242
                {val:input('5100000000000008', {'allowing':'mastercard', '':'creditcard'}), isValid:true},
243
                {val:input('6011000000000004', {'allowing':'discover', '':'creditcard'}), isValid:true},
244
                {val:input('6011000000000005', {'allowing':'discover', '':'creditcard'}), isValid:false}
245
            ];
246
 
247
            $.each(links, function(i, obj) {
248
                runTest(obj, 'creditcard');
249
            });
250
        });
251
 
252
        test('isValid()', function() {
253
 
254
            $form.empty();
255
            $form.append(input('4000000000000002', {'allowing':'visa', '':'creditcard'}));
256
            $form.append(input('', {'optional':'true', '':'alphanumeric'}));
257
            $form.append(input('', 'alphanumeric'));
258
            $form.append(input('4000000000000002', 'alphanumeric'));
259
 
260
            equal(
261
                $form.isValid(false, false, false),
262
                false
263
            );
264
 
265
            $form.empty();
266
            $form.append(input('4000000000000002', {'allowing':'visa', '':'creditcard'}));
267
            $form.append(input('', {'optional':'true', '':'alphanumeric'}));
268
            $form.append(input('fff', 'alphanumeric'));
269
            $form.append(input('4000000000000002', 'alphanumeric'));
270
 
271
            equal(
272
                $form.isValid(false, false, false),
273
                true
274
            );
275
 
276
        });
277
 
278
        /*
279
         * CVV VALIDATION
280
         */
281
        test("CVV validation", function() {
282
 
283
            clearForm();
284
 
285
            var links = [
286
                {val:'012', isValid:true},
287
                {val:'0124', isValid:false},
288
                {val:'000', isValid:true},
289
                {val:'01', isValid:false},
290
                {val:'a12', isValid:false}
291
            ];
292
 
293
            $.each(links, function(i, obj) {
294
                runTest(obj, 'cvv');
295
            });
296
 
297
            // check with amex only
298
            var $cCard = input('', {'allowing':'amex', '':'creditcard'}),
299
                $cvv = input('1234', 'cvv'),
300
                result;
301
 
302
            // let the validator know which type of card we're validating
303
            $.formUtils.validateInput($cCard, $.formUtils.LANG, $.formUtils.defaultConfig(), $form)
304
 
305
            result = $.formUtils.validateInput($cvv, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
306
            equal(
307
                true,
308
                result
309
            );
310
 
311
            $cvv.val('123');
312
            result = $.formUtils.validateInput($cvv, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
313
            equal(
314
                'string',
315
                typeof result
316
            );
317
 
318
        });
319
 
320
 
321
        /*
322
         * DISABLED VALIDATION
323
         */
324
        test("Do not validate disabled", function() {
325
            clearForm();
326
            var $input = input('a--b', {'allowing':'', '':'alphanumeric'});
327
            $input.attr('disabled', 'disabled');
328
            runTest({val:$input, isValid: true});
329
        });
330
 
331
        /*
332
         * NUMBER VALIDATION
333
         */
334
        test("Number validation", function() {
335
 
336
            clearForm();
337
 
338
            var links = [
339
                {val:'123', isValid:true},
340
                {val:'', isValid:false},
341
                {val:'asdfsd', isValid:false},
342
                {val:'-123', isValid:false},
343
                {val:input('-123', {'allowing':'negative', '':'number'}), isValid:true},
344
                {val:'1.032', isValid:false},
345
                {val:input('1.023', {'allowing':'float', '':'number'}), isValid:true},
346
                {val:'-1.032', isValid:false},
347
                {val:input('-1.023', {'allowing':'float,negative', '':'number'}), isValid:true},
348
                {val:input('1.0234', {'allowing':'float,negative', '':'number'}), isValid:true},
349
                {val:input('1.0235', {'allowing':'float,negative,number', '':'number'}), isValid:true},
350
                {val:input('1.0236', {'allowing':'float,negative,number', 'decimal-separator':',', '':'number'}), isValid:false},
351
                {val:input('1,023', {'allowing':'float,negative,number', 'decimal-separator':',', '':'number'}), isValid:true},
352
                {val:'123', isValid:true},
353
                {val:input('12', {'allowing':'range[1;10]', '':'number'}), isValid:false},
354
                {val:input('-1', {'allowing':'range[1;10]', '':'number'}), isValid:false},
355
                {val:input('1', {'allowing':'range[1;10]', '':'number'}), isValid:true},
356
                {val:input('10', {'allowing':'range[1;10]', '':'number'}), isValid:true},
357
                {val:input('5', {'allowing':'range[1;10]', '':'number'}), isValid:true},
358
                {val:input('-1', {'allowing':'range[-10;10],negative', '':'number'}), isValid:true},
359
                {val:input('0.0001', {'allowing':'range[0.05;0.9]', '':'number'}), isValid:false},
360
                {val:input('0.06', {'allowing':'range[0.05;0.9],float', '':'number'}), isValid:true}
361
            ];
362
 
363
            $.each(links, function(i, obj) {
364
                runTest(obj, 'number');
365
            });
366
        });
367
 
368
        /*
369
         * DATE VALIDATION
370
         */
371
        test("Date validation", function() {
372
 
373
            clearForm();
374
 
375
            var dates = [
376
                {val:'2000-01-01', isValid:true},
377
                {val:'2000-01-1', isValid:false},
378
                {val:'2000-01-32', isValid:false},
379
                {val:'2000-02-29', isValid:true}, // leap year
380
                {val:'2013-02-29', isValid:false},
381
                {val:'2000-04-31', isValid:false},
382
                {val:'2000-13-1', isValid:false},
383
                {val:'2000-1-1', isValid:false},
384
                {val:'-01-01', isValid:false},
385
                {val:input('01/01/2000', {'format':'dd/mm/yyyy', '':'date'}), isValid:true},
386
                {val:input('29/02/2000', {'format':'dd/mm/yyyy', '':'date'}), isValid:true},
387
                {val:input('02/2000', {'format':'mm/yyyy', '':'date'}), isValid:true},
388
                {val:input('29/02/2013', {'format':'dd/mm/yyyy', '':'date'}), isValid:false},
389
                {val:input('29/13/2013', {'format':'dd/mm/yyyy', '':'date'}), isValid:false},
390
                {val:input('29/00/2013', {'format':'dd/mm/yyyy', '':'date'}), isValid:false},
391
                {val:'', isValid:false},
392
                {val:input('', {'optional':'true', 'format':'dd/mm/yyyy', '':'date'}), isValid:true},
393
                {val:'2014-01-01', isValid:true},
394
                {val:'1880-01-01', isValid:true}
395
            ];
396
 
397
            $.each(dates, function(i, obj) {
398
                runTest(obj, 'date');
399
            });
400
        });
401
 
402
        /*
403
         * BIRTH DATE VALIDATION
404
         */
405
        test("Birth date validation", function() {
406
 
407
            clearForm();
408
 
409
            var dates = [
410
                {val:'2000-01-01', isValid:true},
411
                {val:'2000-01-1', isValid:false},
412
                {val:'2000-01-32', isValid:false},
413
                {val:'2000-02-29', isValid:true}, // leap year
414
                {val:'2013-02-29', isValid:false},
415
                {val:'2000-04-31', isValid:false},
416
                {val:'2000-13-1', isValid:false},
417
                {val:'2000-1-1', isValid:false},
418
                {val:'-01-01', isValid:false},
419
                {val:input('01/01/2000', {'format':'dd/mm/yyyy', '':'date'}), isValid:true},
420
                {val:input('29/02/2000', {'format':'dd/mm/yyyy', '':'date'}), isValid:true},
421
                {val:input('29/02/2013', {'format':'dd/mm/yyyy', '':'date'}), isValid:false},
422
                {val:input('29/13/2013', {'format':'dd/mm/yyyy', '':'date'}), isValid:false},
423
                {val:input('29/00/2013', {'format':'dd/mm/yyyy', '':'date'}), isValid:false},
424
                {val:'2030-01-01', isValid:false}, // no future date
425
                {val:'1880-01-01', isValid:false} // no date that is to old
426
            ];
427
 
428
            $.each(dates, function(i, obj) {
429
                runTest(obj, 'birthdate');
430
            });
431
        });
432
 
433
        /*
434
         * TIME VALIDATION
435
         */
436
        test("Time validation", function() {
437
 
438
            clearForm();
439
 
440
            var links = [
441
                {val:'00:00', isValid:true},
442
                {val:'00:01', isValid:true},
443
                {val:'09:59', isValid:true},
444
                {val:'19:59', isValid:true},
445
                {val:'19:60', isValid:false},
446
                {val:'19:61', isValid:false},
447
                {val:'24:01', isValid:false},
448
                {val:'24:00', isValid:false},
449
                {val:'2200', isValid:false},
450
                {val:'', isValid:false},
451
                {val:'23', isValid:false},
452
                {val:'23;00', isValid:false},
453
                {val:'23-00', isValid:false}
454
            ];
455
 
456
            $.each(links, function(i, obj) {
457
                runTest(obj, 'time');
458
            });
459
        });
460
 
461
 
462
        /*
463
         * SWEDISH MOBILE VALIDATION
464
         */
465
        test("Swe mobile validation", function() {
466
 
467
            clearForm();
468
 
469
            var links = [
470
                {val:'0702777118', isValid:true},
471
                {val:'0722777118', isValid:true},
472
                {val:'46702777118', isValid:true},
473
                {val:'45702777118', isValid:false},
474
                {val:'+46702777118', isValid:true},
475
                {val:'+45702777118', isValid:false},
476
                {val:'0732777118', isValid:true},
477
                {val:'0302777118', isValid:false},
478
                {val:'07027771', isValid:false}
479
            ];
480
 
481
            $.each(links, function(i, obj) {
482
                runTest(obj, 'swemobile');
483
            });
484
        });
485
 
486
        /*
487
         * LENGTH VALIDATION
488
         */
489
        test("Length validation", function() {
490
 
491
            clearForm();
492
 
493
            var links = [
494
                {val:input('1234', {'length':'max3', '':'length'}), isValid:false},
495
                {val:input('1234', {'length':'min3', '':'length'}), isValid:true},
496
                {val:input('1234', {'length':'min5', '':'length'}), isValid:false},
497
                {val:input('1234', {'length':'2-35', '':'length'}), isValid:true},
498
                {val:input('123456', {'length':'2-5', '':'length'}), isValid:false},
499
                {val:input('1234', {'length':'max4', '':'length'}), isValid:true},
500
                {val:input('1234', {length : 'min5', '':'number length'}), isValid:false},
501
                {val:input('12345', {length : 'min5', '':'number length'}), isValid:true},
502
                {val:input('1234a', {length : 'min5', '':'number length'}), isValid:false},
503
                {val:input('12345678', {length : 'min5', '':'number length'}), isValid:true}
504
            ];
505
 
506
            $.each(links, function(i, obj) {
507
                runTest(obj, 'length');
508
            });
509
        });
510
 
511
        /*
512
         * SWEDISH SSN VALIDATION
513
         */
514
        test("Swedish SSN validation", function() {
515
 
516
            clearForm();
517
 
518
            var links = [
519
                {val:'19:59', isValid:false},
520
                {val:'', isValid:false},
521
                {val:'198311084936', isValid:true},
522
                {val:'198311084935', isValid:false},
523
                {val:'198301128529', isValid:true},
524
                {val:'198301128528', isValid:false},
525
                {val:input('', {'use-hyphen' : 'true', '':'swesec'}), isValid:false},
526
                {val:input('198301128529', {'use-hyphen' : 'true', '':'swesec'}), isValid:false},
527
                {val:input('198311084936', {'use-hyphen' : 'true', '':'swesec'}), isValid:false},
528
                {val:input('19830112-8529', {'use-hyphen' : 'true', '':'swesec'}), isValid:true},
529
                {val:input('19831108-4936', {'use-hyphen' : 'true', '':'swesec'}), isValid:true}
530
            ];
531
 
532
            $.each(links, function(i, obj) {
533
                runTest(obj, 'swesec');
534
            });
535
        });
536
 
537
        /*
538
         * FILE VALIDATION
539
         */
540
        test('File validation', function() {
541
 
542
            clearForm();
543
 
544
            equal(100, $.formUtils.convertSizeNameToBytes('100'));
545
            equal(100, $.formUtils.convertSizeNameToBytes('100b'));
546
            equal(100, $.formUtils.convertSizeNameToBytes('100B'));
547
            equal(112640, $.formUtils.convertSizeNameToBytes('110kb'));
548
            equal(112640, $.formUtils.convertSizeNameToBytes('110KB'));
549
            equal(10485760, $.formUtils.convertSizeNameToBytes('10M'));
550
            equal(10485760, $.formUtils.convertSizeNameToBytes('10MB'));
551
            equal(10485760, $.formUtils.convertSizeNameToBytes('10mb'));
552
            equal(10485760, $.formUtils.convertSizeNameToBytes('10m'));
553
 
554
            /*
555
             todo: test this somehow
556
            var extensionTests = [
557
                {val:input('file.jpg', {'allowing' : 'jpg', '':'extension'}), isValid:true},
558
                {val:input('file.JPG', {'allowing' : 'jpg', '':'extension'}), isValid:true},
559
                {val:input('file.jpgs', {'allowing' : 'jpg', '':'extension'}, {type:'file'}), isValid:false},
560
                {val:input('file', {'allowing' : 'jpg', '':'extension'}), isValid:false},
561
                {val:input('file.jpeg', {'allowing' : 'jpg', '':'extension'}), isValid:true},
562
                {val:input('file.JPEG', {'allowing' : 'jpg, png, gif', '':'extension'}), isValid:true},
563
                {val:input('file.JPEG', {'allowing' : 'jpg,', '':'extension'}), isValid:true},
564
                {val:input('file.JPEG', {'allowing' : ' jpg ', '':'extension'}), isValid:true}
565
            ];
566
 
567
            $.each(extensionTests, function(i, obj) {
568
                runTest(obj, 'extension');
569
            });
570
             */
571
        });
572
 
573
        test('Confirmation', function() {
574
 
575
            clearForm();
576
 
577
            var $inputA = input('hejsan', {'':'confirmation'}, {name:'test'}),
578
                $inputB = input('hej', undefined, {name:'test_confirmation'}),
579
                result = $.formUtils.validateInput($inputA, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
580
 
581
            equal(
582
                typeof(result) == 'string', // Should be an error message
583
                true,
584
                'Could not check that inputs did not confirmation each other'
585
            );
586
 
587
            $inputB.val('hejsan');
588
            result = $.formUtils.validateInput($inputA, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
589
            equal(
590
                result,
591
                true,
592
                'Could not validate confirmation'
593
            );
594
 
595
            clearForm();
596
 
597
            var $inputC = input('value', {'':'confirmation', 'confirm':'input-D'}, {name:'test'}),
598
                $inputD = input('hej', undefined, {name:'input-D'});
599
 
600
            result = $.formUtils.validateInput($inputC, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
601
 
602
            equal(
603
                typeof(result) == 'string', // Should be an error message
604
                true,
605
                'Could not check that inputs did not confirmation each other'
606
            );
607
 
608
            $inputD.val('value');
609
            result = $.formUtils.validateInput($inputC, $.formUtils.LANG, $.formUtils.defaultConfig(), $form);
610
            equal(
611
                result,
612
                true,
613
                'Could not validate confirmation'
614
            );
615
        });
616
 
617
        // TODO: Write more tests...
618
 
619
    }
620
 
621
    var dev = window.location.hash.indexOf('dev') > -1 ? '.dev' : '';
622
 
623
    $.validate({
624
        modules : 'security'+dev+', location'+dev+', sweden'+dev+', file'+dev+', date'+dev+', uk'+dev,
625
        onModulesLoaded: function( $form ) {
7246 dpurdie 626
            //console.log('About to run all tests');
5048 dpurdie 627
            runAllTests();
628
        }
629
    });
630
 
631
})(jQuery);
632
</script>
633
 
634
</body>
635
</html>