Skip to content

Commit 0f25742

Browse files
authored
Merge pull request #561 from mrDinckleman/update-tests
Update tests
2 parents 79a1eea + c2a51fd commit 0f25742

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/jquery.form.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,12 @@
665665
// if using the $.param format that allows for multiple values with the same name
666666
if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
667667
extraInputs.push(
668-
$('<input type="hidden" name="' + s.extraData[n].name + '">', ownerDocument).val(s.extraData[n].value)
669-
.appendTo(form)[0]);
668+
$('<input type="hidden" name="' + s.extraData[n].name + '">', ownerDocument).val(s.extraData[n].value)
669+
.appendTo(form)[0]);
670670
} else {
671671
extraInputs.push(
672-
$('<input type="hidden" name="' + n + '">', ownerDocument).val(s.extraData[n])
673-
.appendTo(form)[0]);
672+
$('<input type="hidden" name="' + n + '">', ownerDocument).val(s.extraData[n])
673+
.appendTo(form)[0]);
674674
}
675675
}
676676
}
@@ -736,7 +736,8 @@
736736

737737
return;
738738

739-
} else if (e === SERVER_ABORT && xhr) {
739+
}
740+
if (e === SERVER_ABORT && xhr) {
740741
xhr.abort('server abort');
741742
deferred.reject(xhr, 'error', 'server abort');
742743

@@ -1405,7 +1406,7 @@
14051406
switch (tag) {
14061407
case 'input':
14071408
this.checked = this.defaultChecked;
1408-
// fall through
1409+
// fall through
14091410

14101411
case 'textarea':
14111412
this.value = this.defaultValue;
@@ -1453,8 +1454,8 @@
14531454
return true;
14541455

14551456
case 'form':
1456-
// guard against an input with the name of 'reset'
1457-
// note that IE reports the reset function as an 'object'
1457+
// guard against an input with the name of 'reset'
1458+
// note that IE reports the reset function as an 'object'
14581459
if (typeof this.reset === 'function' || (typeof this.reset === 'object' && !this.reset.nodeType)) {
14591460
this.reset();
14601461
}

test/test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212

213213

214214
<!-- mocha -->
215-
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-JAW99MJVpJBGcbzEuXk4Az05s/XyDdBomFqNlM3ic+I=" crossorigin="anonymous"></script>
215+
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
216216
<script src="../src/jquery.form.js"></script>
217217
<script src="../node_modules/mocha/mocha.js"></script>
218218
<script src="../node_modules/chai/chai.js"></script>

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ describe('form', function() {
408408
dataType: 'xml',
409409
success: function(responseXML, statusText) { // post-submit callback
410410
assert.ok(typeof responseXML == 'object', 'data type xml');
411-
assert.ok($('test', responseXML).size() == 3, 'xml data query');
411+
assert.ok($('test', responseXML).length == 3, 'xml data query');
412412
// start();
413413
}
414414
};

0 commit comments

Comments
 (0)