aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-04-19 11:21:24 -0400
committerScott González <scott.gonzalez@gmail.com>2012-04-19 11:21:24 -0400
commit0e8d9dde20e6bb4481fbfa94a2066125179066b0 (patch)
tree11d6f6bd515d85204c33b0d979cfcc2072461b33 /tests/unit
parent266cc84013c7c4d57771b2e4d0cdac3763a6764b (diff)
downloadjquery-ui-0e8d9dde20e6bb4481fbfa94a2066125179066b0.tar.gz
jquery-ui-0e8d9dde20e6bb4481fbfa94a2066125179066b0.zip
Tests: Lint.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/widget/widget_extend.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/unit/widget/widget_extend.js b/tests/unit/widget/widget_extend.js
index 36cd999dd..ae9855929 100644
--- a/tests/unit/widget/widget_extend.js
+++ b/tests/unit/widget/widget_extend.js
@@ -12,7 +12,14 @@ test( "$.widget.extend()", function() {
deep2copy = { foo: { baz: true }, foo2: document },
deepmerged = { foo: { bar: true, baz: true }, foo2: document },
arr = [1, 2, 3],
- nestedarray = { arr: arr };
+ nestedarray = { arr: arr },
+ defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+ defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
+ options1 = { xnumber2: 1, xstring2: "x" },
+ options1Copy = { xnumber2: 1, xstring2: "x" },
+ options2 = { xstring2: "xx", xxx: "newstringx" },
+ options2Copy = { xstring2: "xx", xxx: "newstringx" },
+ merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" };
$.widget.extend( settings, options );
deepEqual( settings, merged, "Check if extended: settings must be extended" );
@@ -79,14 +86,6 @@ test( "$.widget.extend()", function() {
$.widget.extend( obj, { foo:"notnull" } );
equal( obj.foo, "notnull", "Make sure a null value can be overwritten" );
- var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
- defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" },
- options1 = { xnumber2: 1, xstring2: "x" },
- options1Copy = { xnumber2: 1, xstring2: "x" },
- options2 = { xstring2: "xx", xxx: "newstringx" },
- options2Copy = { xstring2: "xx", xxx: "newstringx" },
- merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" };
-
settings = $.widget.extend( {}, defaults, options1, options2 );
deepEqual( settings, merged2, "Check if extended: settings must be extended" );
deepEqual( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" );