diff options
Diffstat (limited to 'tests/unit/dialog/dialog_events.js')
-rw-r--r-- | tests/unit/dialog/dialog_events.js | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js index 40a8575b6..4b769bafc 100644 --- a/tests/unit/dialog/dialog_events.js +++ b/tests/unit/dialog/dialog_events.js @@ -13,9 +13,9 @@ test("open", function() { open: function(ev, ui) { ok(el.data("dialog")._isOpen, "interal _isOpen flag is set"); ok(true, 'autoOpen: true fires open callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogopen', 'event type in callback'); - same(ui, {}, 'ui hash in callback'); + equal(this, el[0], "context of callback"); + equal(ev.type, 'dialogopen', 'event type in callback'); + deepEqual(ui, {}, 'ui hash in callback'); } }); el.remove(); @@ -25,15 +25,15 @@ test("open", function() { autoOpen: false, open: function(ev, ui) { ok(true, '.dialog("open") fires open callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogopen', 'event type in callback'); - same(ui, {}, 'ui hash in callback'); + equal(this, el[0], "context of callback"); + equal(ev.type, 'dialogopen', 'event type in callback'); + deepEqual(ui, {}, 'ui hash in callback'); } }).bind('dialogopen', function(ev, ui) { ok(el.data("dialog")._isOpen, "interal _isOpen flag is set"); ok(true, 'dialog("open") fires open event'); - equals(this, el[0], 'context of event'); - same(ui, {}, 'ui hash in event'); + equal(this, el[0], 'context of event'); + deepEqual(ui, {}, 'ui hash in event'); }); el.dialog("open"); el.remove(); @@ -45,14 +45,14 @@ test("dragStart", function() { el = $('<div></div>').dialog({ dragStart: function(ev, ui) { ok(true, 'dragging fires dragStart callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogdragstart', 'event type in callback'); + equal(this, el[0], "context of 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'); - equals(this, el[0], 'context of event'); + equal(this, el[0], 'context of event'); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); }); @@ -64,22 +64,22 @@ test("dragStart", function() { test("drag", function() { expect(9); var hasDragged = false; - + el = $('<div></div>').dialog({ drag: function(ev, ui) { if (!hasDragged) { ok(true, 'dragging fires drag callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogdrag', 'event type in callback'); + equal(this, el[0], "context of 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'); - equals(this, el[0], 'context of event'); + equal(this, el[0], 'context of event'); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); }); @@ -94,14 +94,14 @@ test("dragStop", function() { el = $('<div></div>').dialog({ dragStop: function(ev, ui) { ok(true, 'dragging fires dragStop callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogdragstop', 'event type in callback'); + equal(this, el[0], "context of 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'); - equals(this, el[0], 'context of event'); + equal(this, el[0], 'context of event'); ok(ui.position !== undefined, "ui.position in callback"); ok(ui.offset !== undefined, "ui.offset in callback"); }); @@ -116,8 +116,8 @@ test("resizeStart", function() { el = $('<div></div>').dialog({ resizeStart: function(ev, ui) { ok(true, 'resizing fires resizeStart callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogresizestart', 'event type in callback'); + equal(this, el[0], "context of 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"); @@ -125,7 +125,7 @@ test("resizeStart", function() { } }).bind('dialogresizestart', function(ev, ui) { ok(true, 'resizing fires dialogresizestart event'); - equals(this, el[0], 'context of 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"); @@ -144,19 +144,19 @@ test("resize", function() { resize: function(ev, ui) { if (!hasResized) { ok(true, 'resizing fires resize callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogresize', 'event type in callback'); + equal(this, el[0], "context of 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"); ok(ui.size !== undefined, "ui.size in callback"); - + hasResized = true; } } }).one('dialogresize', function(ev, ui) { ok(true, 'resizing fires dialogresize event'); - equals(this, el[0], 'context of 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"); @@ -173,8 +173,8 @@ test("resizeStop", function() { el = $('<div></div>').dialog({ resizeStop: function(ev, ui) { ok(true, 'resizing fires resizeStop callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogresizestop', 'event type in callback'); + equal(this, el[0], "context of 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"); @@ -182,7 +182,7 @@ test("resizeStop", function() { } }).bind('dialogresizestop', function(ev, ui) { ok(true, 'resizing fires dialogresizestop event'); - equals(this, el[0], 'context of 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"); @@ -199,14 +199,14 @@ test("close", function() { el = $('<div></div>').dialog({ close: function(ev, ui) { ok(true, '.dialog("close") fires close callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogclose', 'event type in callback'); - same(ui, {}, 'ui hash in callback'); + equal(this, el[0], "context of 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'); - equals(this, el[0], 'context of event'); - same(ui, {}, 'ui hash in event'); + equal(this, el[0], 'context of event'); + deepEqual(ui, {}, 'ui hash in event'); }); el.dialog('close'); el.remove(); @@ -218,9 +218,9 @@ test("beforeClose", function() { el = $('<div></div>').dialog({ beforeClose: function(ev, ui) { ok(true, '.dialog("close") fires beforeClose callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogbeforeclose', 'event type in callback'); - same(ui, {}, 'ui hash in callback'); + equal(this, el[0], "context of callback"); + equal(ev.type, 'dialogbeforeclose', 'event type in callback'); + deepEqual(ui, {}, 'ui hash in callback'); return false; } }); @@ -231,9 +231,9 @@ test("beforeClose", function() { el = $('<div></div>').dialog(); el.dialog('option', 'beforeClose', function(ev, ui) { ok(true, '.dialog("close") fires beforeClose callback'); - equals(this, el[0], "context of callback"); - equals(ev.type, 'dialogbeforeclose', 'event type in callback'); - same(ui, {}, 'ui hash in callback'); + equal(this, el[0], "context of callback"); + equal(ev.type, 'dialogbeforeclose', 'event type in callback'); + deepEqual(ui, {}, 'ui hash in callback'); return false; }); el.dialog('close'); @@ -242,8 +242,8 @@ test("beforeClose", function() { el = $('<div></div>').dialog().bind('dialogbeforeclose', function(ev, ui) { ok(true, '.dialog("close") triggers dialogbeforeclose event'); - equals(this, el[0], "context of event"); - same(ui, {}, 'ui hash in event'); + equal(this, el[0], "context of event"); + deepEqual(ui, {}, 'ui hash in event'); return false; }); el.dialog('close'); |