aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/slider
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-28 15:56:32 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-29 18:36:40 +0100
commit72023dd045a7fead5a3136ec2400ad4743a190d2 (patch)
tree4999a287a815e6a4200498a2a0241abc349fe599 /tests/unit/slider
parente6b7486abf2e0f98837e76027084fad6fe908cff (diff)
downloadjquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.tar.gz
jquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.zip
Update to QUnit 1.3. Replace usage of same with deepEqual and equals with equal.
Diffstat (limited to 'tests/unit/slider')
-rw-r--r--tests/unit/slider/slider_core.js68
-rw-r--r--tests/unit/slider/slider_events.js22
-rw-r--r--tests/unit/slider/slider_methods.js28
-rw-r--r--tests/unit/slider/slider_options.js26
4 files changed, 72 insertions, 72 deletions
diff --git a/tests/unit/slider/slider_core.js b/tests/unit/slider/slider_core.js
index 38d4f4669..e5f21ee1b 100644
--- a/tests/unit/slider/slider_core.js
+++ b/tests/unit/slider/slider_core.js
@@ -28,9 +28,9 @@ test("keydown HOME on handle sets value to min", function() {
el.slider("value", 0);
handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
- el.slider('destroy');
+ el.slider('destroy');
el = $('<div></div>');
options = {
@@ -44,7 +44,7 @@ test("keydown HOME on handle sets value to min", function() {
el.slider("value", 0);
handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
el.slider('destroy');
});
@@ -62,9 +62,9 @@ test("keydown END on handle sets value to max", function() {
el.slider("value", 0);
handle().simulate("keydown", { keyCode: $.ui.keyCode.END });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
- el.slider('destroy');
+ el.slider('destroy');
el = $('<div></div>');
options = {
@@ -78,7 +78,7 @@ test("keydown END on handle sets value to max", function() {
el.slider("value", 0);
handle().simulate("keydown", { keyCode: $.ui.keyCode.END });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
el.slider('destroy');
});
@@ -97,10 +97,10 @@ test("keydown PAGE_UP on handle increases value by 1/5 range, not greater than m
el.slider("value", 70);
handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_UP });
- equals(el.slider("value"), 90);
+ equal(el.slider("value"), 90);
handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_UP });
- equals(el.slider("value"), 100);
+ equal(el.slider("value"), 100);
el.slider("destroy");
});
@@ -120,10 +120,10 @@ test("keydown PAGE_DOWN on handle decreases value by 1/5 range, not less than mi
el.slider("value", 30);
handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_DOWN });
- equals(el.slider("value"), 10);
+ equal(el.slider("value"), 10);
handle().simulate("keydown", { keyCode: $.ui.keyCode.PAGE_DOWN });
- equals(el.slider("value"), 0);
+ equal(el.slider("value"), 0);
el.slider("destroy");
});
@@ -142,12 +142,12 @@ test("keydown UP on handle increases value by step, not greater than max", funct
el.slider("value", options.max - options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
- el.slider("destroy");
+ el.slider("destroy");
el = $('<div></div>');
options = {
@@ -161,12 +161,12 @@ test("keydown UP on handle increases value by step, not greater than max", funct
el.slider("value", options.max - options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
handle().simulate("keydown", { keyCode: $.ui.keyCode.UP });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
- el.slider("destroy");
+ el.slider("destroy");
});
test("keydown RIGHT on handle increases value by step, not greater than max", function() {
@@ -182,12 +182,12 @@ test("keydown RIGHT on handle increases value by step, not greater than max", fu
el.slider("value", options.max - options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
- el.slider("destroy");
+ el.slider("destroy");
el = $('<div></div>');
options = {
@@ -201,12 +201,12 @@ test("keydown RIGHT on handle increases value by step, not greater than max", fu
el.slider("value", options.max - options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
handle().simulate("keydown", { keyCode: $.ui.keyCode.RIGHT });
- equals(el.slider("value"), options.max);
+ equal(el.slider("value"), options.max);
- el.slider("destroy");
+ el.slider("destroy");
});
test("keydown DOWN on handle decreases value by step, not less than min", function() {
@@ -222,12 +222,12 @@ test("keydown DOWN on handle decreases value by step, not less than min", functi
el.slider("value", options.min + options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
- el.slider("destroy");
+ el.slider("destroy");
el = $('<div></div>');
options = {
@@ -241,12 +241,12 @@ test("keydown DOWN on handle decreases value by step, not less than min", functi
el.slider("value", options.min + options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
handle().simulate("keydown", { keyCode: $.ui.keyCode.DOWN });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
- el.slider("destroy");
+ el.slider("destroy");
});
test("keydown LEFT on handle decreases value by step, not less than min", function() {
@@ -262,12 +262,12 @@ test("keydown LEFT on handle decreases value by step, not less than min", functi
el.slider("value", options.min + options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
- el.slider("destroy");
+ el.slider("destroy");
el = $('<div></div>');
options = {
@@ -281,12 +281,12 @@ test("keydown LEFT on handle decreases value by step, not less than min", functi
el.slider("value", options.min + options.step);
handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
handle().simulate("keydown", { keyCode: $.ui.keyCode.LEFT });
- equals(el.slider("value"), options.min);
+ equal(el.slider("value"), options.min);
- el.slider("destroy");
+ el.slider("destroy");
});
})(jQuery);
diff --git a/tests/unit/slider/slider_events.js b/tests/unit/slider/slider_events.js
index 0b7b250f2..9e39d2a3e 100644
--- a/tests/unit/slider/slider_events.js
+++ b/tests/unit/slider/slider_events.js
@@ -2,7 +2,7 @@
* slider_events.js
*/
(function($) {
-
+
module( "slider: events" );
//Specs from http://wiki.jqueryui.com/Slider#specs
@@ -11,21 +11,21 @@ module( "slider: events" );
// or value method/option"
test( "mouse based interaction", function() {
expect(4);
-
+
var el = $( "<div></div>" )
.appendTo( "body" )
.slider({
start: function(event, ui) {
- equals( event.originalEvent.type, "mousedown", "start triggered by mousedown" );
+ equal( event.originalEvent.type, "mousedown", "start triggered by mousedown" );
},
slide: function(event, ui) {
- equals( event.originalEvent.type, "mousemove", "slider triggered by mousemove" );
+ equal( event.originalEvent.type, "mousemove", "slider triggered by mousemove" );
},
stop: function(event, ui) {
- equals( event.originalEvent.type, "mouseup", "stop triggered by mouseup" );
+ equal( event.originalEvent.type, "mouseup", "stop triggered by mouseup" );
},
change: function(event, ui) {
- equals( event.originalEvent.type, "mouseup", "change triggered by mouseup" );
+ equal( event.originalEvent.type, "mouseup", "change triggered by mouseup" );
}
});
@@ -35,22 +35,22 @@ test( "mouse based interaction", function() {
});
test( "keyboard based interaction", function() {
expect(3);
-
+
// Test keyup at end of handle slide (keyboard)
var el = $( "<div></div>" )
.appendTo( "body" )
.slider({
start: function(event, ui) {
- equals( event.originalEvent.type, "keydown", "start triggered by keydown" );
+ equal( event.originalEvent.type, "keydown", "start triggered by keydown" );
},
slide: function(event, ui) {
ok( false, "Slider never triggered by keys" );
},
stop: function(event, ui) {
- equals( event.originalEvent.type, "keyup", "stop triggered by keyup" );
+ equal( event.originalEvent.type, "keyup", "stop triggered by keyup" );
},
change: function(event, ui) {
- equals( event.originalEvent.type, "keyup", "change triggered by keyup" );
+ equal( event.originalEvent.type, "keyup", "change triggered by keyup" );
}
});
@@ -62,7 +62,7 @@ test( "keyboard based interaction", function() {
});
test( "programmatic event triggers", function() {
expect(6);
-
+
// Test value method
var el = $( "<div></div>" )
.slider({
diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js
index 66624e8a8..b46222002 100644
--- a/tests/unit/slider/slider_methods.js
+++ b/tests/unit/slider/slider_methods.js
@@ -38,13 +38,13 @@ test("destroy", function() {
var expected = $('<div></div>').slider(),
actual = expected.slider('destroy');
- equals(actual, expected, 'destroy is chainable');
+ equal(actual, expected, 'destroy is chainable');
});
test("enable", function() {
var expected = $('<div></div>').slider(),
actual = expected.slider('enable');
- equals(actual, expected, 'enable is chainable');
+ equal(actual, expected, 'enable is chainable');
var el = $('<div></div>').slider({ disabled: true });
ok(el.hasClass('ui-disabled'), 'slider has ui-disabled class before enable method call');
@@ -57,7 +57,7 @@ test("enable", function() {
test("disable", function() {
var expected = $('<div></div>').slider(),
actual = expected.slider('disable');
- equals(actual, expected, 'disable is chainable');
+ equal(actual, expected, 'disable is chainable');
var el = $('<div></div>').slider({ disabled: false });
ok(!el.hasClass('ui-disabled'), 'slider does not have ui-disabled class before disabled method call');
@@ -73,9 +73,9 @@ test("value", function() {
range: this,
value: 5
});
- equals(el.slider('value'), 5, 'range: ' + this + ' slider method get');
- equals(el.slider('value', 10), el, 'value method is chainable');
- equals(el.slider('value'), 10, 'range: ' + this + ' slider method set');
+ equal(el.slider('value'), 5, 'range: ' + this + ' slider method get');
+ equal(el.slider('value', 10), el, 'value method is chainable');
+ equal(el.slider('value'), 10, 'range: ' + this + ' slider method set');
el.remove();
});
var el = $('<div></div>').slider({
@@ -83,16 +83,16 @@ test("value", function() {
});
// min with value option vs value method
el.slider('option', 'value', -2);
- equals(el.slider('option', 'value'), -2, 'value option does not respect min');
- equals(el.slider('value'), -1, 'value method get respects min');
- equals(el.slider('value', -2), el, 'value method is chainable');
- equals(el.slider('option', 'value'), -1, 'value method set respects min');
+ equal(el.slider('option', 'value'), -2, 'value option does not respect min');
+ equal(el.slider('value'), -1, 'value method get respects min');
+ equal(el.slider('value', -2), el, 'value method is chainable');
+ equal(el.slider('option', 'value'), -1, 'value method set respects min');
// max with value option vs value method
el.slider('option', 'value', 2);
- equals(el.slider('option', 'value'), 2, 'value option does not respect max');
- equals(el.slider('value'), 1, 'value method get respects max');
- equals(el.slider('value', 2), el, 'value method is chainable');
- equals(el.slider('option', 'value'), 1, 'value method set respects max');
+ equal(el.slider('option', 'value'), 2, 'value option does not respect max');
+ equal(el.slider('value'), 1, 'value method get respects max');
+ equal(el.slider('value', 2), el, 'value method is chainable');
+ equal(el.slider('option', 'value'), 1, 'value method set respects max');
});
//test("values", function() {
diff --git a/tests/unit/slider/slider_options.js b/tests/unit/slider/slider_options.js
index 040589bd6..7d9899284 100644
--- a/tests/unit/slider/slider_options.js
+++ b/tests/unit/slider/slider_options.js
@@ -13,7 +13,7 @@ module("slider: options");
test("max", function() {
el = $('<div></div>');
-
+
options = {
max: 37,
min: 6,
@@ -31,7 +31,7 @@ test("max", function() {
test("min", function() {
el = $('<div></div>');
-
+
options = {
max: 37,
min: 6,
@@ -62,7 +62,7 @@ test("orientation", function() {
el.slider(options).slider("option", "orientation", "horizontal");
ok(el.is('.ui-slider-horizontal'), "horizontal slider has class .ui-slider-horizontal");
ok(!el.is('.ui-slider-vertical'), "horizontal slider does not have class .ui-slider-vertical");
- equals(handle().css('left'), percentVal + '%', "horizontal slider handle is positioned with left: %");
+ equal(handle().css('left'), percentVal + '%', "horizontal slider handle is positioned with left: %");
el.slider('destroy');
@@ -78,7 +78,7 @@ test("orientation", function() {
el.slider(options).slider("option", "orientation", "vertical");
ok(el.is('.ui-slider-vertical'), "vertical slider has class .ui-slider-vertical");
ok(!el.is('.ui-slider-horizontal'), "vertical slider does not have class .ui-slider-horizontal");
- equals(handle().css('bottom'), percentVal + '%', "vertical slider handle is positioned with bottom: %");
+ equal(handle().css('bottom'), percentVal + '%', "vertical slider handle is positioned with bottom: %");
el.slider('destroy');
@@ -98,19 +98,19 @@ test("step", function() {
step: 10,
max: 100
});
- equals( el.slider("value"), 0 );
+ equal( el.slider("value"), 0 );
el.slider("value", 1);
- equals( el.slider("value"), 0 );
+ equal( el.slider("value"), 0 );
el.slider("value", 9);
- equals( el.slider("value"), 10 );
+ equal( el.slider("value"), 10 );
el.slider("value", 11);
- equals( el.slider("value"), 10 );
+ equal( el.slider("value"), 10 );
el.slider("value", 19);
- equals( el.slider("value"), 20 );
+ equal( el.slider("value"), 20 );
el = $('<div></div>').slider({
min: 0,
@@ -121,16 +121,16 @@ el = $('<div></div>').slider({
el.slider("value", 0);
el.slider("option", "value", 1);
- equals( el.slider("value"), 0 );
+ equal( el.slider("value"), 0 );
el.slider("option", "value", 9);
- equals( el.slider("value"), 0 );
+ equal( el.slider("value"), 0 );
el.slider("option", "value", 11);
- equals( el.slider("value"), 20 );
+ equal( el.slider("value"), 20 );
el.slider("option", "value", 19);
- equals( el.slider("value"), 20 );
+ equal( el.slider("value"), 20 );
el.slider('destroy');
});