diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2012-12-26 08:08:48 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-12-26 08:08:48 -0500 |
commit | 0d4022bceb33fb95c41fab768c1829d464861899 (patch) | |
tree | 8584929224e413fd6163c4000fe03b6978f969ec /tests/unit/dialog | |
parent | 74d7eac2daabce0411e98ed9d59dada551cdd911 (diff) | |
download | jquery-ui-0d4022bceb33fb95c41fab768c1829d464861899.tar.gz jquery-ui-0d4022bceb33fb95c41fab768c1829d464861899.zip |
Tests: Convert single quotes to double quotes.
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r-- | tests/unit/dialog/dialog_common.js | 12 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_core.js | 8 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_deprecated.js | 12 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_events.js | 184 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_methods.js | 108 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_options.js | 246 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_test_helpers.js | 10 |
7 files changed, 290 insertions, 290 deletions
diff --git a/tests/unit/dialog/dialog_common.js b/tests/unit/dialog/dialog_common.js index 57d7aa0aa..ea4c91767 100644 --- a/tests/unit/dialog/dialog_common.js +++ b/tests/unit/dialog/dialog_common.js @@ -4,11 +4,11 @@ TestHelpers.commonWidgetTests( "dialog", { autoOpen: true, buttons: [], closeOnEscape: true, - closeText: 'close', + closeText: "close", disabled: false, - dialogClass: '', + dialogClass: "", draggable: true, - height: 'auto', + height: "auto", hide: null, maxHeight: null, maxWidth: null, @@ -16,10 +16,10 @@ TestHelpers.commonWidgetTests( "dialog", { minWidth: 150, modal: false, position: { - my: 'center', - at: 'center', + my: "center", + at: "center", of: window, - collision: 'fit', + collision: "fit", using: $.ui.dialog.prototype.options.position.using }, resizable: true, diff --git a/tests/unit/dialog/dialog_core.js b/tests/unit/dialog/dialog_core.js index 817f76ea9..b488bd112 100644 --- a/tests/unit/dialog/dialog_core.js +++ b/tests/unit/dialog/dialog_core.js @@ -10,10 +10,10 @@ test("title id", function() { expect(1); var titleId, - el = $('<div></div>').dialog(); + el = $("<div></div>").dialog(); - titleId = el.dialog('widget').find('.ui-dialog-title').attr('id'); - ok( /ui-id-\d+$/.test( titleId ), 'auto-numbered title id'); + titleId = el.dialog("widget").find(".ui-dialog-title").attr("id"); + ok( /ui-id-\d+$/.test( titleId ), "auto-numbered title id"); el.remove(); }); @@ -27,7 +27,7 @@ test( "ARIA", function() { equal( wrapper.attr( "aria-describedby" ), el.attr( "id" ), "aria-describedby added" ); el.remove(); - el = $( '<div><div aria-describedby="section2"><p id="section2">descriotion</p></div></div>' ).dialog(); + el = $("<div><div aria-describedby='section2'><p id='section2'>descriotion</p></div></div>").dialog(); strictEqual( el.dialog( "widget" ).attr( "aria-describedby" ), undefined, "no aria-describedby added, as already present in markup" ); el.remove(); }); diff --git a/tests/unit/dialog/dialog_deprecated.js b/tests/unit/dialog/dialog_deprecated.js index 918190791..57f360544 100644 --- a/tests/unit/dialog/dialog_deprecated.js +++ b/tests/unit/dialog/dialog_deprecated.js @@ -34,8 +34,8 @@ test( "position, right bottom on window", function() { test("position, offset from top left w/array", function() { expect( 2 ); - var el = $('<div></div>').dialog({ position: [10, 10] }), - dialog = el.dialog('widget'), + var el = $("<div></div>").dialog({ position: [10, 10] }), + dialog = el.dialog("widget"), offset = dialog.offset(); closeEnough(offset.left, 10 + $(window).scrollLeft(), 1); closeEnough(offset.top, 10 + $(window).scrollTop(), 1); @@ -44,8 +44,8 @@ test("position, offset from top left w/array", function() { test("position, top on window", function() { expect( 2 ); - var el = $('<div></div>').dialog({ position: "top" }), - dialog = el.dialog('widget'), + var el = $("<div></div>").dialog({ position: "top" }), + dialog = el.dialog("widget"), offset = dialog.offset(); closeEnough(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft(), 1); closeEnough(offset.top, $(window).scrollTop(), 1); @@ -54,8 +54,8 @@ test("position, top on window", function() { test("position, left on window", function() { expect( 2 ); - var el = $('<div></div>').dialog({ position: "left" }), - dialog = el.dialog('widget'), + var el = $("<div></div>").dialog({ position: "left" }), + dialog = el.dialog("widget"), offset = dialog.offset(); closeEnough(offset.left, 0, 1); closeEnough(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop(), 1); diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js index 19337ad5d..254158ef4 100644 --- a/tests/unit/dialog/dialog_events.js +++ b/tests/unit/dialog/dialog_events.js @@ -12,10 +12,10 @@ test("open", function() { el.dialog({ open: function(ev, ui) { ok(el.data("ui-dialog")._isOpen, "interal _isOpen flag is set"); - ok(true, 'autoOpen: true fires open callback'); + ok(true, "autoOpen: true fires open callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogopen', 'event type in callback'); - deepEqual(ui, {}, 'ui hash in callback'); + equal(ev.type, "dialogopen", "event type in callback"); + deepEqual(ui, {}, "ui hash in callback"); } }); el.remove(); @@ -24,16 +24,16 @@ test("open", function() { el.dialog({ autoOpen: false, open: function(ev, ui) { - ok(true, '.dialog("open") fires open callback'); + ok(true, ".dialog('open') fires open callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogopen', 'event type in callback'); - deepEqual(ui, {}, 'ui hash in callback'); + equal(ev.type, "dialogopen", "event type in callback"); + deepEqual(ui, {}, "ui hash in callback"); } - }).bind('dialogopen', function(ev, ui) { + }).bind("dialogopen", function(ev, ui) { ok(el.data("ui-dialog")._isOpen, "interal _isOpen flag is set"); - ok(true, 'dialog("open") fires open event'); - equal(this, el[0], 'context of event'); - deepEqual(ui, {}, 'ui hash in event'); + ok(true, "dialog('open') fires open event"); + equal(this, el[0], "context of event"); + deepEqual(ui, {}, "ui hash in event"); }); el.dialog("open"); el.remove(); @@ -88,22 +88,22 @@ test("dragStart", function() { expect(9); var handle, - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ dragStart: function(ev, ui) { - ok(true, 'dragging fires dragStart callback'); + ok(true, "dragging fires dragStart callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogdragstart', 'event type in callback'); + equal(ev.type, "dialogdragstart", "event type in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); } - }).bind('dialogdragstart', function(ev, ui) { - ok(true, 'dragging fires dialogdragstart event'); - equal(this, el[0], 'context of event'); + }).bind("dialogdragstart", function(ev, ui) { + ok(true, "dragging fires dialogdragstart event"); + equal(this, el[0], "context of event"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); }); - handle = $(".ui-dialog-titlebar", el.dialog('widget')); + handle = $(".ui-dialog-titlebar", el.dialog("widget")); TestHelpers.dialog.drag(el, handle, 50, 50); el.remove(); }); @@ -112,26 +112,26 @@ test("drag", function() { expect(9); var handle, hasDragged = false, - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ drag: function(ev, ui) { if (!hasDragged) { - ok(true, 'dragging fires drag callback'); + ok(true, "dragging fires drag callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogdrag', 'event type in callback'); + equal(ev.type, "dialogdrag", "event type in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); hasDragged = true; } } - }).one('dialogdrag', function(ev, ui) { - ok(true, 'dragging fires dialogdrag event'); - equal(this, el[0], 'context of event'); + }).one("dialogdrag", function(ev, ui) { + ok(true, "dragging fires dialogdrag event"); + equal(this, el[0], "context of event"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); }); - handle = $(".ui-dialog-titlebar", el.dialog('widget')); + handle = $(".ui-dialog-titlebar", el.dialog("widget")); TestHelpers.dialog.drag(el, handle, 50, 50); el.remove(); }); @@ -140,22 +140,22 @@ test("dragStop", function() { expect(9); var handle, - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ dragStop: function(ev, ui) { - ok(true, 'dragging fires dragStop callback'); + ok(true, "dragging fires dragStop callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogdragstop', 'event type in callback'); + equal(ev.type, "dialogdragstop", "event type in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); } - }).bind('dialogdragstop', function(ev, ui) { - ok(true, 'dragging fires dialogdragstop event'); - equal(this, el[0], 'context of event'); + }).bind("dialogdragstop", function(ev, ui) { + ok(true, "dragging fires dialogdragstop event"); + equal(this, el[0], "context of event"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); }); - handle = $(".ui-dialog-titlebar", el.dialog('widget')); + handle = $(".ui-dialog-titlebar", el.dialog("widget")); TestHelpers.dialog.drag(el, handle, 50, 50); el.remove(); }); @@ -164,26 +164,26 @@ test("resizeStart", function() { expect(13); var handle, - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ resizeStart: function(ev, ui) { - ok(true, 'resizing fires resizeStart callback'); + ok(true, "resizing fires resizeStart callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogresizestart', 'event type in callback'); + equal(ev.type, "dialogresizestart", "event type in callback"); ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); ok(ui.originalSize !== undefined, "ui.originalSize in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.size !== undefined, "ui.size in callback"); } - }).bind('dialogresizestart', function(ev, ui) { - ok(true, 'resizing fires dialogresizestart event'); - equal(this, el[0], 'context of event'); + }).bind("dialogresizestart", function(ev, ui) { + ok(true, "resizing fires dialogresizestart event"); + equal(this, el[0], "context of event"); ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); ok(ui.originalSize !== undefined, "ui.originalSize in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.size !== undefined, "ui.size in callback"); }); - handle = $(".ui-resizable-se", el.dialog('widget')); + handle = $(".ui-resizable-se", el.dialog("widget")); TestHelpers.dialog.drag(el, handle, 50, 50); el.remove(); }); @@ -192,12 +192,12 @@ test("resize", function() { expect(13); var handle, hasResized = false, - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ resize: function(ev, ui) { if (!hasResized) { - ok(true, 'resizing fires resize callback'); + ok(true, "resizing fires resize callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogresize', 'event type in callback'); + equal(ev.type, "dialogresize", "event type in callback"); ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); ok(ui.originalSize !== undefined, "ui.originalSize in callback"); ok(ui.position !== undefined, "ui.position in callback"); @@ -206,16 +206,16 @@ test("resize", function() { hasResized = true; } } - }).one('dialogresize', function(ev, ui) { - ok(true, 'resizing fires dialogresize event'); - equal(this, el[0], 'context of event'); + }).one("dialogresize", function(ev, ui) { + ok(true, "resizing fires dialogresize event"); + equal(this, el[0], "context of event"); ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); ok(ui.originalSize !== undefined, "ui.originalSize in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.size !== undefined, "ui.size in callback"); }); - handle = $(".ui-resizable-se", el.dialog('widget')); + handle = $(".ui-resizable-se", el.dialog("widget")); TestHelpers.dialog.drag(el, handle, 50, 50); el.remove(); }); @@ -224,26 +224,26 @@ test("resizeStop", function() { expect(13); var handle, - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ resizeStop: function(ev, ui) { - ok(true, 'resizing fires resizeStop callback'); + ok(true, "resizing fires resizeStop callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogresizestop', 'event type in callback'); + equal(ev.type, "dialogresizestop", "event type in callback"); ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); ok(ui.originalSize !== undefined, "ui.originalSize in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.size !== undefined, "ui.size in callback"); } - }).bind('dialogresizestop', function(ev, ui) { - ok(true, 'resizing fires dialogresizestop event'); - equal(this, el[0], 'context of event'); + }).bind("dialogresizestop", function(ev, ui) { + ok(true, "resizing fires dialogresizestop event"); + equal(this, el[0], "context of event"); ok(ui.originalPosition !== undefined, "ui.originalPosition in callback"); ok(ui.originalSize !== undefined, "ui.originalSize in callback"); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.size !== undefined, "ui.size in callback"); }); - handle = $(".ui-resizable-se", el.dialog('widget')); + handle = $(".ui-resizable-se", el.dialog("widget")); TestHelpers.dialog.drag(el, handle, 50, 50); el.remove(); }); @@ -251,77 +251,77 @@ test("resizeStop", function() { asyncTest("close", function() { expect(14); - var el = $('<div></div>').dialog({ + var el = $("<div></div>").dialog({ close: function(ev, ui) { - ok(true, '.dialog("close") fires close callback'); + ok(true, ".dialog('close') fires close callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogclose', 'event type in callback'); - deepEqual(ui, {}, 'ui hash in callback'); + equal(ev.type, "dialogclose", "event type in callback"); + deepEqual(ui, {}, "ui hash in callback"); } - }).bind('dialogclose', function(ev, ui) { - ok(true, '.dialog("close") fires dialogclose event'); - equal(this, el[0], 'context of event'); - deepEqual(ui, {}, 'ui hash in event'); + }).bind("dialogclose", function(ev, ui) { + ok(true, ".dialog('close') fires dialogclose event"); + equal(this, el[0], "context of event"); + deepEqual(ui, {}, "ui hash in event"); }); - el.dialog('close'); + el.dialog("close"); el.remove(); // Close event with an effect - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ hide: 10, close: function(ev, ui) { - ok(true, '.dialog("close") fires close callback'); + ok(true, ".dialog('close') fires close callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogclose', 'event type in callback'); - deepEqual(ui, {}, 'ui hash in callback'); + equal(ev.type, "dialogclose", "event type in callback"); + deepEqual(ui, {}, "ui hash in callback"); start(); } - }).bind('dialogclose', function(ev, ui) { - ok(true, '.dialog("close") fires dialogclose event'); - equal(this, el[0], 'context of event'); - deepEqual(ui, {}, 'ui hash in event'); + }).bind("dialogclose", function(ev, ui) { + ok(true, ".dialog('close') fires dialogclose event"); + equal(this, el[0], "context of event"); + deepEqual(ui, {}, "ui hash in event"); }); - el.dialog('close'); + el.dialog("close"); }); test("beforeClose", function() { expect(14); - var el = $('<div></div>').dialog({ + var el = $("<div></div>").dialog({ beforeClose: function(ev, ui) { - ok(true, '.dialog("close") fires beforeClose callback'); + ok(true, ".dialog('close') fires beforeClose callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogbeforeclose', 'event type in callback'); - deepEqual(ui, {}, 'ui hash in callback'); + equal(ev.type, "dialogbeforeclose", "event type in callback"); + deepEqual(ui, {}, "ui hash in callback"); return false; } }); - el.dialog('close'); - ok( el.dialog("widget").is(":visible"), 'beforeClose callback should prevent dialog from closing'); + el.dialog("close"); + ok( el.dialog("widget").is(":visible"), "beforeClose callback should prevent dialog from closing"); el.remove(); - el = $('<div></div>').dialog(); - el.dialog('option', 'beforeClose', function(ev, ui) { - ok(true, '.dialog("close") fires beforeClose callback'); + el = $("<div></div>").dialog(); + el.dialog("option", "beforeClose", function(ev, ui) { + ok(true, ".dialog('close') fires beforeClose callback"); equal(this, el[0], "context of callback"); - equal(ev.type, 'dialogbeforeclose', 'event type in callback'); - deepEqual(ui, {}, 'ui hash in callback'); + equal(ev.type, "dialogbeforeclose", "event type in callback"); + deepEqual(ui, {}, "ui hash in callback"); return false; }); - el.dialog('close'); + el.dialog("close"); - ok( el.dialog("widget").is(":visible"), 'beforeClose callback should prevent dialog from closing'); + ok( el.dialog("widget").is(":visible"), "beforeClose callback should prevent dialog from closing"); el.remove(); - el = $('<div></div>').dialog().bind('dialogbeforeclose', function(ev, ui) { - ok(true, '.dialog("close") triggers dialogbeforeclose event'); + el = $("<div></div>").dialog().bind("dialogbeforeclose", function(ev, ui) { + ok(true, ".dialog('close') triggers dialogbeforeclose event"); equal(this, el[0], "context of event"); - deepEqual(ui, {}, 'ui hash in event'); + deepEqual(ui, {}, "ui hash in event"); return false; }); - el.dialog('close'); - ok( el.dialog("widget").is(":visible"), 'dialogbeforeclose event should prevent dialog from closing'); + el.dialog("close"); + ok( el.dialog("widget").is(":visible"), "dialogbeforeclose event should prevent dialog from closing"); el.remove(); }); @@ -329,14 +329,14 @@ test("beforeClose", function() { asyncTest("ensure dialog's container doesn't scroll on resize and focus", function() { expect(2); - var el = $('#dialog1').dialog(), + var el = $("#dialog1").dialog(), initialScroll = $(window).scrollTop(); - el.dialog('option', 'height', 600); + el.dialog("option", "height", 600); equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after height change"); setTimeout( function(){ - $(".ui-dialog-titlebar-close").simulate('mousedown'); + $(".ui-dialog-titlebar-close").simulate("mousedown"); equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after focus moved to dialog"); - el.dialog('destroy'); + el.dialog("destroy"); start(); }, 500); }); diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index 85d13d157..b4c58c31e 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -12,25 +12,25 @@ module("dialog: methods", { test("init", function() { expect(6); - $("<div></div>").appendTo('body').dialog().remove(); - ok(true, '.dialog() called on element'); + $("<div></div>").appendTo("body").dialog().remove(); + ok(true, ".dialog() called on element"); $([]).dialog().remove(); - ok(true, '.dialog() called on empty collection'); + ok(true, ".dialog() called on empty collection"); - $('<div></div>').dialog().remove(); - ok(true, '.dialog() called on disconnected DOMElement - never connected'); + $("<div></div>").dialog().remove(); + ok(true, ".dialog() called on disconnected DOMElement - never connected"); - $('<div></div>').appendTo('body').remove().dialog().remove(); - ok(true, '.dialog() called on disconnected DOMElement - removed'); + $("<div></div>").appendTo("body").remove().dialog().remove(); + ok(true, ".dialog() called on disconnected DOMElement - removed"); - var el = $('<div></div>').dialog(); + var el = $("<div></div>").dialog(); el.dialog("option", "foo"); el.remove(); - ok(true, 'arbitrary option getter after init'); + ok(true, "arbitrary option getter after init"); - $('<div></div>').dialog().dialog("option", "foo", "bar").remove(); - ok(true, 'arbitrary option setter after init'); + $("<div></div>").dialog().dialog("option", "foo", "bar").remove(); + ok(true, "arbitrary option setter after init"); }); test("destroy", function() { @@ -61,12 +61,12 @@ test("destroy", function() { test("#4980: Destroy should place element back in original DOM position", function(){ expect( 2 ); - var container = $('<div id="container"><div id="modal">Content</div></div>'), - modal = container.find('#modal'); + var container = $("<div id='container'><div id='modal'>Content</div></div>"), + modal = container.find("#modal"); modal.dialog(); - ok(!$.contains(container[0], modal[0]), 'dialog should move modal element to outside container element'); - modal.dialog('destroy'); - ok($.contains(container[0], modal[0]), 'dialog(destroy) should place element back in original DOM position'); + ok(!$.contains(container[0], modal[0]), "dialog should move modal element to outside container element"); + modal.dialog("destroy"); + ok($.contains(container[0], modal[0]), "dialog(destroy) should place element back in original DOM position"); }); test( "enable/disable disabled", function() { @@ -81,29 +81,29 @@ test("close", function() { expect( 3 ); var el, - expected = $('<div></div>').dialog(), - actual = expected.dialog('close'); - equal(actual, expected, 'close is chainable'); - - el = $('<div></div>').dialog(); - ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog visible before close method called'); - el.dialog('close'); - ok(el.dialog('widget').is(':hidden') && !el.dialog('widget').is(':visible'), 'dialog hidden after close method called'); + expected = $("<div></div>").dialog(), + actual = expected.dialog("close"); + equal(actual, expected, "close is chainable"); + + el = $("<div></div>").dialog(); + ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog visible before close method called"); + el.dialog("close"); + ok(el.dialog("widget").is(":hidden") && !el.dialog("widget").is(":visible"), "dialog hidden after close method called"); }); test("isOpen", function() { expect(4); - var el = $('<div></div>').dialog(); - equal(el.dialog('isOpen'), true, "dialog is open after init"); - el.dialog('close'); - equal(el.dialog('isOpen'), false, "dialog is closed"); + var el = $("<div></div>").dialog(); + equal(el.dialog("isOpen"), true, "dialog is open after init"); + el.dialog("close"); + equal(el.dialog("isOpen"), false, "dialog is closed"); el.remove(); - el = $('<div></div>').dialog({autoOpen: false}); - equal(el.dialog('isOpen'), false, "dialog is closed after init"); - el.dialog('open'); - equal(el.dialog('isOpen'), true, "dialog is open"); + el = $("<div></div>").dialog({autoOpen: false}); + equal(el.dialog("isOpen"), false, "dialog is closed after init"); + el.dialog("open"); + equal(el.dialog("isOpen"), true, "dialog is open"); el.remove(); }); @@ -137,49 +137,49 @@ test("moveToTop", function() { test("open", function() { expect( 3 ); var el, - expected = $('<div></div>').dialog(), - actual = expected.dialog('open'); - equal(actual, expected, 'open is chainable'); - - el = $('<div></div>').dialog({ autoOpen: false }); - ok(el.dialog('widget').is(':hidden') && !el.dialog('widget').is(':visible'), 'dialog hidden before open method called'); - el.dialog('open'); - ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog visible after open method called'); + expected = $("<div></div>").dialog(), + actual = expected.dialog("open"); + equal(actual, expected, "open is chainable"); + + el = $("<div></div>").dialog({ autoOpen: false }); + ok(el.dialog("widget").is(":hidden") && !el.dialog("widget").is(":visible"), "dialog hidden before open method called"); + el.dialog("open"); + ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog visible after open method called"); }); test("#6137: dialog('open') causes form elements to reset on IE7", function() { expect(2); - var d1 = $('<form><input type="radio" name="radio" id="a" value="a" checked="checked"></input>' + - '<input type="radio" name="radio" id="b" value="b">b</input></form>').appendTo( "body" ).dialog({autoOpen: false}); + var d1 = $("<form><input type='radio' name='radio' id='a' value='a' checked='checked'></input>" + + "<input type='radio' name='radio' id='b' value='b'>b</input></form>").appendTo( "body" ).dialog({autoOpen: false}); - d1.find('#b').prop( "checked", true ); - equal(d1.find('input:checked').val(), 'b', "checkbox b is checked"); + d1.find("#b").prop( "checked", true ); + equal(d1.find("input:checked").val(), "b", "checkbox b is checked"); - d1.dialog('open'); - equal(d1.find('input:checked').val(), 'b', "checkbox b is checked"); + d1.dialog("open"); + equal(d1.find("input:checked").val(), "b", "checkbox b is checked"); d1.remove(); }); test("#5531: dialog width should be at least minWidth on creation", function () { expect( 4 ); - var el = $('<div></div>').dialog({ + var el = $("<div></div>").dialog({ width: 200, minWidth: 300 }); - equal(el.dialog('option', 'width'), 300, "width is minWidth"); - el.dialog('option', 'width', 200); - equal(el.dialog('option', 'width'), 300, "width unchanged when set to < minWidth"); - el.dialog('option', 'width', 320); - equal(el.dialog('option', 'width'), 320, "width changed if set to > minWidth"); + equal(el.dialog("option", "width"), 300, "width is minWidth"); + el.dialog("option", "width", 200); + equal(el.dialog("option", "width"), 300, "width unchanged when set to < minWidth"); + el.dialog("option", "width", 320); + equal(el.dialog("option", "width"), 320, "width changed if set to > minWidth"); el.remove(); - el = $('<div></div>').dialog({ + el = $("<div></div>").dialog({ minWidth: 300 }); - ok(el.dialog('option', 'width') >= 300, "width is at least 300"); + ok(el.dialog("option", "width") >= 300, "width is at least 300"); el.remove(); }); diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js index dff3ffaae..a20480de6 100644 --- a/tests/unit/dialog/dialog_options.js +++ b/tests/unit/dialog/dialog_options.js @@ -49,12 +49,12 @@ test( "appendTo", function() { test("autoOpen", function() { expect(2); - var el = $('<div></div>').dialog({ autoOpen: false }); - ok( !el.dialog("widget").is(":visible"), '.dialog({ autoOpen: false })'); + var el = $("<div></div>").dialog({ autoOpen: false }); + ok( !el.dialog("widget").is(":visible"), ".dialog({ autoOpen: false })"); el.remove(); - el = $('<div></div>').dialog({ autoOpen: true }); - ok( el.dialog("widget").is(":visible"), '.dialog({ autoOpen: true })'); + el = $("<div></div>").dialog({ autoOpen: true }); + ok( el.dialog("widget").is(":visible"), ".dialog({ autoOpen: true })"); el.remove(); }); @@ -74,7 +74,7 @@ test("buttons", function() { equal(ev.target, btn[1], "event target"); } }, - el = $('<div></div>').dialog({ buttons: buttons }); + el = $("<div></div>").dialog({ buttons: buttons }); btn = el.dialog( "widget" ).find( ".ui-dialog-buttonpane button" ); equal(btn.length, 2, "number of buttons"); @@ -85,8 +85,8 @@ test("buttons", function() { i++; }); - ok(btn.parent().hasClass('ui-dialog-buttonset'), "buttons in container"); - ok(el.parent().hasClass('ui-dialog-buttons'), "dialog wrapper adds class about having buttons"); + ok(btn.parent().hasClass("ui-dialog-buttonset"), "buttons in container"); + ok(el.parent().hasClass("ui-dialog-buttons"), "dialog wrapper adds class about having buttons"); btn.trigger("click"); @@ -98,13 +98,13 @@ test("buttons", function() { } }; - deepEqual(el.dialog("option", "buttons"), buttons, '.dialog("option", "buttons") getter'); + deepEqual(el.dialog("option", "buttons"), buttons, ".dialog('option', 'buttons') getter"); el.dialog("option", "buttons", newButtons); - deepEqual(el.dialog("option", "buttons"), newButtons, '.dialog("option", "buttons", ...) setter'); + deepEqual(el.dialog("option", "buttons"), newButtons, ".dialog('option', 'buttons', ...) setter"); btn = el.dialog( "widget" ).find( ".ui-dialog-buttonpane button" ); equal(btn.length, 1, "number of buttons after setter"); - btn.trigger('click'); + btn.trigger("click"); i = 0; $.each(newButtons, function( key ) { @@ -116,7 +116,7 @@ test("buttons", function() { btn = el.dialog( "widget" ).find( ".ui-dialog-buttonpane button" ); equal(btn.length, 0, "all buttons have been removed"); equal(el.find(".ui-dialog-buttonset").length, 0, "buttonset has been removed"); - equal(el.parent().hasClass('ui-dialog-buttons'), false, "dialog wrapper removes class about having buttons"); + equal(el.parent().hasClass("ui-dialog-buttons"), false, "dialog wrapper removes class about having buttons"); el.remove(); }); @@ -156,77 +156,77 @@ test("buttons - advanced", function() { test("closeOnEscape", function() { expect( 6 ); - var el = $('<div></div>').dialog({ closeOnEscape: false }); - ok(true, 'closeOnEscape: false'); - ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog is open before ESC'); - el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE }) - .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE }) - .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE }); - ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog is open after ESC'); - - el.remove(); - - el = $('<div></div>').dialog({ closeOnEscape: true }); - ok(true, 'closeOnEscape: true'); - ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog is open before ESC'); - el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE }) - .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE }) - .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE }); - ok(el.dialog('widget').is(':hidden') && !el.dialog('widget').is(':visible'), 'dialog is closed after ESC'); + var el = $("<div></div>").dialog({ closeOnEscape: false }); + ok(true, "closeOnEscape: false"); + ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog is open before ESC"); + el.simulate("keydown", { keyCode: $.ui.keyCode.ESCAPE }) + .simulate("keypress", { keyCode: $.ui.keyCode.ESCAPE }) + .simulate("keyup", { keyCode: $.ui.keyCode.ESCAPE }); + ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog is open after ESC"); + + el.remove(); + + el = $("<div></div>").dialog({ closeOnEscape: true }); + ok(true, "closeOnEscape: true"); + ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog is open before ESC"); + el.simulate("keydown", { keyCode: $.ui.keyCode.ESCAPE }) + .simulate("keypress", { keyCode: $.ui.keyCode.ESCAPE }) + .simulate("keyup", { keyCode: $.ui.keyCode.ESCAPE }); + ok(el.dialog("widget").is(":hidden") && !el.dialog("widget").is(":visible"), "dialog is closed after ESC"); }); test("closeText", function() { expect(3); - var el = $('<div></div>').dialog(); - equal(el.dialog('widget').find('.ui-dialog-titlebar-close span').text(), 'close', - 'default close text'); + var el = $("<div></div>").dialog(); + equal(el.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "close", + "default close text"); el.remove(); - el = $('<div></div>').dialog({ closeText: "foo" }); - equal(el.dialog('widget').find('.ui-dialog-titlebar-close span').text(), 'foo', - 'closeText on init'); + el = $("<div></div>").dialog({ closeText: "foo" }); + equal(el.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "foo", + "closeText on init"); el.remove(); - el = $('<div></div>').dialog().dialog('option', 'closeText', 'bar'); - equal(el.dialog('widget').find('.ui-dialog-titlebar-close span').text(), 'bar', - 'closeText via option method'); + el = $("<div></div>").dialog().dialog("option", "closeText", "bar"); + equal(el.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "bar", + "closeText via option method"); el.remove(); }); test("dialogClass", function() { expect( 6 ); - var el = $('<div></div>').dialog(); - equal(el.dialog('widget').is(".foo"), false, 'dialogClass not specified. foo class added'); + var el = $("<div></div>").dialog(); + equal(el.dialog("widget").is(".foo"), false, "dialogClass not specified. foo class added"); el.remove(); - el = $('<div></div>').dialog({ dialogClass: "foo" }); - equal(el.dialog('widget').is(".foo"), true, 'dialogClass in init. foo class added'); + el = $("<div></div>").dialog({ dialogClass: "foo" }); + equal(el.dialog("widget").is(".foo"), true, "dialogClass in init. foo class added"); el.dialog( "option", "dialogClass", "foobar" ); - equal( el.dialog('widget').is(".foo"), false, "dialogClass changed, previous one was removed" ); - equal( el.dialog('widget').is(".foobar"), true, "dialogClass changed, new one was added" ); + equal( el.dialog("widget").is(".foo"), false, "dialogClass changed, previous one was removed" ); + equal( el.dialog("widget").is(".foobar"), true, "dialogClass changed, new one was added" ); el.remove(); - el = $('<div></div>').dialog({ dialogClass: "foo bar" }); - equal(el.dialog('widget').is(".foo"), true, 'dialogClass in init, two classes. foo class added'); - equal(el.dialog('widget').is(".bar"), true, 'dialogClass in init, two classes. bar class added'); + el = $("<div></div>").dialog({ dialogClass: "foo bar" }); + equal(el.dialog("widget").is(".foo"), true, "dialogClass in init, two classes. foo class added"); + equal(el.dialog("widget").is(".bar"), true, "dialogClass in init, two classes. bar class added"); el.remove(); }); test("draggable", function() { expect(4); - var el = $('<div></div>').dialog({ draggable: false }); + var el = $("<div></div>").dialog({ draggable: false }); TestHelpers.dialog.testDrag(el, 50, -50, 0, 0); - el.dialog('option', 'draggable', true); + el.dialog("option", "draggable", true); TestHelpers.dialog.testDrag(el, 50, -50, 50, -50); el.remove(); - el = $('<div></div>').dialog({ draggable: true }); + el = $("<div></div>").dialog({ draggable: true }); TestHelpers.dialog.testDrag(el, 50, -50, 50, -50); - el.dialog('option', 'draggable', false); + el.dialog("option", "draggable", false); TestHelpers.dialog.testDrag(el, 50, -50, 0, 0); el.remove(); }); @@ -234,22 +234,22 @@ test("draggable", function() { test("height", function() { expect(4); - var el = $('<div></div>').dialog(); - equal(el.dialog('widget').outerHeight(), 150, "default height"); + var el = $("<div></div>").dialog(); + equal(el.dialog("widget").outerHeight(), 150, "default height"); el.remove(); - el = $('<div></div>').dialog({ height: 237 }); - equal(el.dialog('widget').outerHeight(), 237, "explicit height"); + el = $("<div></div>").dialog({ height: 237 }); + equal(el.dialog("widget").outerHeight(), 237, "explicit height"); el.remove(); - el = $('<div></div>').dialog(); - el.dialog('option', 'height', 238); - equal(el.dialog('widget').outerHeight(), 238, "explicit height set after init"); + el = $("<div></div>").dialog(); + el.dialog("option", "height", 238); + equal(el.dialog("widget").outerHeight(), 238, "explicit height set after init"); el.remove(); - el = $('<div></div>').css("padding", "20px") + el = $("<div></div>").css("padding", "20px") .dialog({ height: 240 }); - equal(el.dialog('widget').outerHeight(), 240, "explicit height with padding"); + equal(el.dialog("widget").outerHeight(), 240, "explicit height with padding"); el.remove(); }); @@ -265,76 +265,76 @@ asyncTest( "hide, #5860 - don't leave effects wrapper behind", function() { test("maxHeight", function() { expect(3); - var el = $('<div></div>').dialog({ maxHeight: 200 }); - TestHelpers.dialog.drag(el, '.ui-resizable-s', 1000, 1000); - closeEnough(el.dialog('widget').height(), 200, 1, "maxHeight"); + var el = $("<div></div>").dialog({ maxHeight: 200 }); + TestHelpers.dialog.drag(el, ".ui-resizable-s", 1000, 1000); + closeEnough(el.dialog("widget").height(), 200, 1, "maxHeight"); el.remove(); - el = $('<div></div>').dialog({ maxHeight: 200 }); - TestHelpers.dialog.drag(el, '.ui-resizable-n', -1000, -1000); - closeEnough(el.dialog('widget').height(), 200, 1, "maxHeight"); + el = $("<div></div>").dialog({ maxHeight: 200 }); + TestHelpers.dialog.drag(el, ".ui-resizable-n", -1000, -1000); + closeEnough(el.dialog("widget").height(), 200, 1, "maxHeight"); el.remove(); - el = $('<div></div>').dialog({ maxHeight: 200 }).dialog('option', 'maxHeight', 300); - TestHelpers.dialog.drag(el, '.ui-resizable-s', 1000, 1000); - closeEnough(el.dialog('widget').height(), 300, 1, "maxHeight"); + el = $("<div></div>").dialog({ maxHeight: 200 }).dialog("option", "maxHeight", 300); + TestHelpers.dialog.drag(el, ".ui-resizable-s", 1000, 1000); + closeEnough(el.dialog("widget").height(), 300, 1, "maxHeight"); el.remove(); }); test("maxWidth", function() { expect(3); - var el = $('<div></div>').dialog({ maxWidth: 200 }); - TestHelpers.dialog.drag(el, '.ui-resizable-e', 1000, 1000); - closeEnough(el.dialog('widget').width(), 200, 1, "maxWidth"); + var el = $("<div></div>").dialog({ maxWidth: 200 }); + TestHelpers.dialog.drag(el, ".ui-resizable-e", 1000, 1000); + closeEnough(el.dialog("widget").width(), 200, 1, "maxWidth"); el.remove(); - el = $('<div></div>').dialog({ maxWidth: 200 }); - TestHelpers.dialog.drag(el, '.ui-resizable-w', -1000, -1000); - closeEnough(el.dialog('widget').width(), 200, 1, "maxWidth"); + el = $("<div></div>").dialog({ maxWidth: 200 }); + TestHelpers.dialog.drag(el, ".ui-resizable-w", -1000, -1000); + closeEnough(el.dialog("widget").width(), 200, 1, "maxWidth"); el.remove(); - el = $('<div></div>').dialog({ maxWidth: 200 }).dialog('option', 'maxWidth', 300); - TestHelpers.dialog.drag(el, '.ui-resizable-w', -1000, -1000); - closeEnough(el.dialog('widget').width(), 300, 1, "maxWidth"); + el = $("<div></div>").dialog({ maxWidth: 200 }).dialog("option", "maxWidth", 300); + TestHelpers.dialog.drag(el, ".ui-resizable-w", -1000, -1000); + closeEnough(el.dialog("widget").width(), 300, 1, "maxWidth"); el.remove(); }); test("minHeight", function() { expect(3); - var el = $('<div></div>').dialog({ minHeight: 10 }); - TestHelpers.dialog.drag(el, '.ui-resizable-s', -1000, -1000); - closeEnough(el.dialog('widget').height(), 10, 1, "minHeight"); + var el = $("<div></div>").dialog({ minHeight: 10 }); + TestHelpers.dialog.drag(el, ".ui-resizable-s", -1000, -1000); + closeEnough(el.dialog("widget").height(), 10, 1, "minHeight"); el.remove(); - el = $('<div></div>').dialog({ minHeight: 10 }); - TestHelpers.dialog.drag(el, '.ui-resizable-n', 1000, 1000); - closeEnough(el.dialog('widget').height(), 10, 1, "minHeight"); + el = $("<div></div>").dialog({ minHeight: 10 }); + TestHelpers.dialog.drag(el, ".ui-resizable-n", 1000, 1000); + closeEnough(el.dialog("widget").height(), 10, 1, "minHeight"); el.remove(); - el = $('<div></div>').dialog({ minHeight: 10 }).dialog('option', 'minHeight', 30); - TestHelpers.dialog.drag(el, '.ui-resizable-n', 1000, 1000); - closeEnough(el.dialog('widget').height(), 30, 1, "minHeight"); + el = $("<div></div>").dialog({ minHeight: 10 }).dialog("option", "minHeight", 30); + TestHelpers.dialog.drag(el, ".ui-resizable-n", 1000, 1000); + closeEnough(el.dialog("widget").height(), 30, 1, "minHeight"); el.remove(); }); test("minWidth", function() { expect(3); - var el = $('<div></div>').dialog({ minWidth: 10 }); - TestHelpers.dialog.drag(el, '.ui-resizable-e', -1000, -1000); - closeEnough(el.dialog('widget').width(), 10, 1, "minWidth"); + var el = $("<div></div>").dialog({ minWidth: 10 }); + TestHelpers.dialog.drag(el, ".ui-resizable-e", -1000, -1000); + closeEnough(el.dialog("widget").width(), 10, 1, "minWidth"); el.remove(); - el = $('<div></div>').dialog({ minWidth: 10 }); - TestHelpers.dialog.drag(el, '.ui-resizable-w', 1000, 1000); - closeEnough(el.dialog('widget').width(), 10, 1, "minWidth"); + el = $("<div></div>").dialog({ minWidth: 10 }); + TestHelpers.dialog.drag(el, ".ui-resizable-w", 1000, 1000); + closeEnough(el.dialog("widget").width(), 10, 1, "minWidth"); el.remove(); - el = $('<div></div>').dialog({ minWidth: 30 }).dialog('option', 'minWidth', 30); - TestHelpers.dialog.drag(el, '.ui-resizable-w', 1000, 1000); - closeEnough(el.dialog('widget').width(), 30, 1, "minWidth"); + el = $("<div></div>").dialog({ minWidth: 30 }).dialog("option", "minWidth", 30); + TestHelpers.dialog.drag(el, ".ui-resizable-w", 1000, 1000); + closeEnough(el.dialog("widget").width(), 30, 1, "minWidth"); el.remove(); }); @@ -378,8 +378,8 @@ test( "position, right bottom at right bottom via ui.position args", function() test( "position, at another element", function() { expect( 4 ); - var parent = $('<div></div>').css({ - position: 'absolute', + var parent = $("<div></div>").css({ + position: "absolute", top: 400, left: 600, height: 10, @@ -420,16 +420,16 @@ test( "position, at another element", function() { test("resizable", function() { expect(4); - var el = $('<div></div>').dialog(); + var el = $("<div></div>").dialog(); TestHelpers.dialog.shouldResize(el, 50, 50, "[default]"); - el.dialog('option', 'resizable', false); - TestHelpers.dialog.shouldResize(el, 0, 0, 'disabled after init'); + el.dialog("option", "resizable", false); + TestHelpers.dialog.shouldResize(el, 0, 0, "disabled after init"); el.remove(); - el = $('<div></div>').dialog({ resizable: false }); + el = $("<div></div>").dialog({ resizable: false }); TestHelpers.dialog.shouldResize(el, 0, 0, "disabled in init options"); - el.dialog('option', 'resizable', true); - TestHelpers.dialog.shouldResize(el, 50, 50, 'enabled after init'); + el.dialog("option", "resizable", true); + TestHelpers.dialog.shouldResize(el, 50, 50, "enabled after init"); el.remove(); }); @@ -437,37 +437,37 @@ test( "title", function() { expect( 11 ); function titleText() { - return el.dialog('widget').find( ".ui-dialog-title" ).html(); + return el.dialog("widget").find( ".ui-dialog-title" ).html(); } - var el = $( '<div></div>' ).dialog(); + var el = $( "<div></div>" ).dialog(); // some browsers return a non-breaking space and some return " " // so we generate a non-breaking space for comparison equal( titleText(), $( "<span> </span>" ).html(), "[default]" ); equal( el.dialog( "option", "title" ), null, "option not changed" ); el.remove(); - el = $( '<div title="foo">' ).dialog(); + el = $( "<div title='foo'>" ).dialog(); equal( titleText(), "foo", "title in element attribute" ); equal( el.dialog( "option", "title"), "foo", "option updated from attribute" ); el.remove(); - el = $( '<div></div>' ).dialog({ title: 'foo' }); + el = $( "<div></div>" ).dialog({ title: "foo" }); equal( titleText(), "foo", "title in init options" ); equal( el.dialog("option", "title"), "foo", "opiton set from options hash" ); el.remove(); - el = $( '<div title="foo">' ).dialog({ title: 'bar' }); + el = $( "<div title='foo'>" ).dialog({ title: "bar" }); equal( titleText(), "bar", "title in init options should override title in element attribute" ); equal( el.dialog("option", "title"), "bar", "opiton set from options hash" ); el.remove(); - el = $( '<div></div>' ).dialog().dialog( 'option', 'title', 'foo' ); - equal( titleText(), 'foo', 'title after init' ); + el = $( "<div></div>" ).dialog().dialog( "option", "title", "foo" ); + equal( titleText(), "foo", "title after init" ); el.remove(); // make sure attroperties are properly ignored - #5742 - .attr() might return a DOMElement - el = $( '<form><input name="title"></form>' ).dialog(); + el = $( "<form><input name='title'></form>" ).dialog(); // some browsers return a non-breaking space and some return " " // so we get the text to normalize to the actual non-breaking space equal( titleText(), $( "<span> </span>" ).html(), "[default]" ); @@ -478,34 +478,34 @@ test( "title", function() { test("width", function() { expect(3); - var el = $('<div></div>').dialog(); - closeEnough(el.dialog('widget').width(), 300, 1, "default width"); + var el = $("<div></div>").dialog(); + closeEnough(el.dialog("widget").width(), 300, 1, "default width"); el.remove(); - el = $('<div></div>').dialog({width: 437 }); - closeEnough(el.dialog('widget').width(), 437, 1, "explicit width"); - el.dialog('option', 'width', 438); - closeEnough(el.dialog('widget').width(), 438, 1, 'explicit width after init'); + el = $("<div></div>").dialog({width: 437 }); + closeEnough(el.dialog("widget").width(), 437, 1, "explicit width"); + el.dialog("option", "width", 438); + closeEnough(el.dialog("widget").width(), 438, 1, "explicit width after init"); el.remove(); }); test("#4826: setting resizable false toggles resizable on dialog", function() { expect(6); var i, - el = $('<div></div>').dialog({ resizable: false }); + el = $("<div></div>").dialog({ resizable: false }); TestHelpers.dialog.shouldResize(el, 0, 0, "[default]"); for (i=0; i<2; i++) { - el.dialog('close').dialog('open'); - TestHelpers.dialog.shouldResize(el, 0, 0, 'initialized with resizable false toggle ('+ (i+1) +')'); + el.dialog("close").dialog("open"); + TestHelpers.dialog.shouldResize(el, 0, 0, "initialized with resizable false toggle ("+ (i+1) +")"); } el.remove(); - el = $('<div></div>').dialog({ resizable: true }); + el = $("<div></div>").dialog({ resizable: true }); TestHelpers.dialog.shouldResize(el, 50, 50, "[default]"); for (i=0; i<2; i++) { - el.dialog('close').dialog('option', 'resizable', false).dialog('open'); - TestHelpers.dialog.shouldResize(el, 0, 0, 'set option resizable false toggle ('+ (i+1) +')'); + el.dialog("close").dialog("option", "resizable", false).dialog("open"); + TestHelpers.dialog.shouldResize(el, 0, 0, "set option resizable false toggle ("+ (i+1) +")"); } el.remove(); diff --git a/tests/unit/dialog/dialog_test_helpers.js b/tests/unit/dialog/dialog_test_helpers.js index e104ed63f..4ecaf0c0f 100644 --- a/tests/unit/dialog/dialog_test_helpers.js +++ b/tests/unit/dialog/dialog_test_helpers.js @@ -1,6 +1,6 @@ TestHelpers.dialog = { drag: function(el, handle, dx, dy) { - var d = el.dialog('widget'); + var d = el.dialog("widget"); //this mouseover is to work around a limitation in resizable //TODO: fix resizable so handle doesn't require mouseover in order to be used $( handle, d ).simulate("mouseover").simulate( "drag", { @@ -10,7 +10,7 @@ TestHelpers.dialog = { }, testDrag: function(el, dx, dy, expectedDX, expectedDY, msg) { var actualDX, actualDY, offsetAfter, - d = el.dialog('widget'), + d = el.dialog("widget"), handle = $(".ui-dialog-titlebar", d), offsetBefore = d.offset(); @@ -22,11 +22,11 @@ TestHelpers.dialog = { actualDX = offsetAfter.left - offsetBefore.left; actualDY = offsetAfter.top - offsetBefore.top; - ok( expectedDX - actualDX <= 1 && expectedDY - actualDY <= 1, 'dragged[' + expectedDX + ', ' + expectedDY + '] ' + msg); + ok( expectedDX - actualDX <= 1 && expectedDY - actualDY <= 1, "dragged[" + expectedDX + ", " + expectedDY + "] " + msg); }, shouldResize: function(el, dw, dh, msg) { var heightAfter, widthAfter, actual, expected, - d = el.dialog('widget'), + d = el.dialog("widget"), handle = $(".ui-resizable-se", d), heightBefore = d.height(), widthBefore = d.width(); @@ -39,6 +39,6 @@ TestHelpers.dialog = { msg = msg ? msg + "." : ""; actual = { width: widthAfter, height: heightAfter }, expected = { width: widthBefore + dw, height: heightBefore + dh }; - deepEqual(actual, expected, 'resized[' + 50 + ', ' + 50 + '] ' + msg); + deepEqual(actual, expected, "resized[" + 50 + ", " + 50 + "] " + msg); } };
\ No newline at end of file |