diff --git a/tests/unit/selectmenu/selectmenu_events.js b/tests/unit/selectmenu/selectmenu_events.js index 2694eaf7f..86bc33177 100644 --- a/tests/unit/selectmenu/selectmenu_events.js +++ b/tests/unit/selectmenu/selectmenu_events.js @@ -9,25 +9,19 @@ test("change", function () { expect(4); - var counter = 0; - this.element.selectmenu({ change: function (event, ui) { - counter++; - - if (counter === 1) { - ok(event, "change event fired on change"); - equals(event.type, "selectmenuchange", "event type set to selectmenuchange"); - ok(ui, "ui object is passed as second argument to event handler"); - equals(ui.item.element[0].nodeName, "OPTION", "ui points to original option element"); - } + ok(event, "change event fired on change"); + equals(event.type, "selectmenuchange", "event type set to selectmenuchange"); + ok(ui, "ui object is passed as second argument to event handler"); + equals(ui.item.element[0].nodeName, "OPTION", "ui points to original option element"); } }); var widget = this.element.selectmenu("widget"), menu = widget.filter(".ui-selectmenu-menu"); - menu.find(".ui-menu-item").simulate("click"); + menu.find(".ui-menu-item").eq(0).simulate("click"); }); test("close", function () { @@ -85,25 +79,19 @@ test("select", function () { expect(4); - var counter = 0; - this.element.selectmenu({ select: function (event, ui) { - counter++; - - if (counter === 1) { - ok(event, "select event fired on item select"); - equals(event.type, "selectmenuselect", "event type set to selectmenuselect"); - ok(ui, "ui object is passed as second argument to event handler"); - equals(ui.item.element[0].nodeName, "OPTION", "ui points to original option element"); - } + ok(event, "select event fired on item select"); + equals(event.type, "selectmenuselect", "event type set to selectmenuselect"); + ok(ui, "ui object is passed as second argument to event handler"); + equals(ui.item.element[0].nodeName, "OPTION", "ui points to original option element"); } }); var widget = this.element.selectmenu("widget"), menu = widget.filter(".ui-selectmenu-menu"); - menu.find(".ui-menu-item").simulate("click"); + menu.find(".ui-menu-item").eq(0).simulate("click"); }); })(jQuery); diff --git a/tests/unit/selectmenu/selectmenu_options.js b/tests/unit/selectmenu/selectmenu_options.js index ed6a27bab..0a502712c 100644 --- a/tests/unit/selectmenu/selectmenu_options.js +++ b/tests/unit/selectmenu/selectmenu_options.js @@ -7,47 +7,18 @@ } }); - test("{ appendTo: default }", function () { - expect(1); - - equals(this.element.selectmenu("option", "appendTo"), "body", "should be appended to by default"); - }); - test("appendTo another element", function () { expect(1); ok(this.element.selectmenu("option", "appendTo", "#qunit-fixture"), "appendTo accepts selector"); }); - test("{ dropdown: default }", function () { - expect(1); - - equals(this.element.selectmenu("option", "dropdown"), true, "should be true by default"); - }); - test("dropdown false", function () { expect(1); ok(this.element.selectmenu("option", "dropdown", false), "accepts false"); }); - test("{ position: default }", function () { - expect(4); - - var pos = this.element.selectmenu("option", "position"); - - ok(typeof (pos) === "object", "position should be of type 'object'"); - equals(pos.my, "left top", "my should be 'left top' by default"); - equals(pos.at, "left bottom", "at should be 'left bottom' by default"); - equals(pos.collision, "none", "collision should be 'none' by default") - }); - - test("{ value: default }", function () { - expect(1); - - equals(this.element.selectmenu("option", "value"), "Medium", "should reflect selected value of underlying select"); - }); - test("value in sync with selected item", function () { expect(1);