Skip to main content

Search and Top Navigation

Ticket #4784: multiple-options-test.diff


File multiple-options-test.diff, 0.8 KB (added by jzaefferer, August 18, 2009 01:07PM UTC)

Test

Index: tests/unit/core/core.js
===================================================================
--- tests/unit/core/core.js	(revision 3071)
+++ tests/unit/core/core.js	(working copy)
@@ -57,4 +57,26 @@
 	equals($('#zIndexAutoNoParent').zIndex(), 0, 'zIndex never explicitly set in hierarchy');
 });
 
+test('widget factory, merge multiple option arguments', function() {
+	expect(1);
+	$.widget("ui.widgetTest", {
+		_init: function() {
+			same(this.options, {
+				disabled: false,
+				option1: "value1",
+				option2: "value2",
+				option3: "value3"
+			});
+		}
+	});
+	$("#main > :first").widgetTest({
+		option1: "valuex",
+		option2: "valuex",
+		option3: "value3"
+	}, {
+		option1: "value1",
+		option2: "value2"
+	});
+});
+
 })(jQuery);

Download in other formats:

Original Format