UNPKG

dojox

Version:

Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.

22 lines (21 loc) 659 B
define(["doh", "dojo/_base/declare", "../Selection", "dijit/_WidgetBase"], function(doh, declare, Selection, _WidgetBase){ doh.register("tests.Selection", [ function test_Lifecycle(t){ var C = declare("MyWidget", [_WidgetBase, Selection], { updateRenderers: function(){ } }); var o = new C(); o.set("selectedItem", "1"); t.is("1", o.get("selectedItem")); t.is(["1"], o.get("selectedItems")); o.set("selectedItems", ["2"]); t.is("2", o.get("selectedItem")); t.is(["2"], o.get("selectedItems")); o = new C({selectedItem: "1"}); t.is("1", o.get("selectedItem")); t.is(["1"], o.get("selectedItems")); } ]); });