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/slider | |
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/slider')
-rw-r--r-- | tests/unit/slider/slider_common.js | 4 | ||||
-rw-r--r-- | tests/unit/slider/slider_core.js | 64 | ||||
-rw-r--r-- | tests/unit/slider/slider_methods.js | 86 | ||||
-rw-r--r-- | tests/unit/slider/slider_options.js | 40 |
4 files changed, 97 insertions, 97 deletions
diff --git a/tests/unit/slider/slider_common.js b/tests/unit/slider/slider_common.js index ccf793549..48fd5e457 100644 --- a/tests/unit/slider/slider_common.js +++ b/tests/unit/slider/slider_common.js @@ -1,13 +1,13 @@ TestHelpers.commonWidgetTests( "slider", { defaults: { animate: false, - cancel: 'input,textarea,button,select,option', + cancel: "input,textarea,button,select,option", delay: 0, disabled: false, distance: 0, max: 100, min: 0, - orientation: 'horizontal', + orientation: "horizontal", range: false, step: 1, value: 0, diff --git a/tests/unit/slider/slider_core.js b/tests/unit/slider/slider_core.js index 86a516875..7195147cc 100644 --- a/tests/unit/slider/slider_core.js +++ b/tests/unit/slider/slider_core.js @@ -17,11 +17,11 @@ module("slider: core"); test("keydown HOME on handle sets value to min", function() { expect( 2 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'horizontal', + orientation: "horizontal", step: 1 }; el.slider(options); @@ -31,13 +31,13 @@ test("keydown HOME on handle sets value to min", function() { handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME }); equal(el.slider("value"), options.min); - el.slider('destroy'); + el.slider("destroy"); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'vertical', + orientation: "vertical", step: 1 }; el.slider(options); @@ -47,16 +47,16 @@ test("keydown HOME on handle sets value to min", function() { handle().simulate("keydown", { keyCode: $.ui.keyCode.HOME }); equal(el.slider("value"), options.min); - el.slider('destroy'); + el.slider("destroy"); }); test("keydown END on handle sets value to max", function() { expect( 2 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'horizontal', + orientation: "horizontal", step: 1 }; el.slider(options); @@ -66,13 +66,13 @@ test("keydown END on handle sets value to max", function() { handle().simulate("keydown", { keyCode: $.ui.keyCode.END }); equal(el.slider("value"), options.max); - el.slider('destroy'); + el.slider("destroy"); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'vertical', + orientation: "vertical", step: 1 }; el.slider(options); @@ -82,13 +82,13 @@ test("keydown END on handle sets value to max", function() { handle().simulate("keydown", { keyCode: $.ui.keyCode.END }); equal(el.slider("value"), options.max); - el.slider('destroy'); + el.slider("destroy"); }); test("keydown PAGE_UP on handle increases value by 1/5 range, not greater than max", function() { expect( 4 ); - $.each(['horizontal', 'vertical'], function(i, orientation) { - el = $('<div></div>'); + $.each(["horizontal", "vertical"], function(i, orientation) { + el = $("<div></div>"); options = { max: 100, min: 0, @@ -111,8 +111,8 @@ test("keydown PAGE_UP on handle increases value by 1/5 range, not greater than m test("keydown PAGE_DOWN on handle decreases value by 1/5 range, not less than min", function() { expect( 4 ); - $.each(['horizontal', 'vertical'], function(i, orientation) { - el = $('<div></div>'); + $.each(["horizontal", "vertical"], function(i, orientation) { + el = $("<div></div>"); options = { max: 100, min: 0, @@ -135,11 +135,11 @@ test("keydown PAGE_DOWN on handle decreases value by 1/5 range, not less than mi test("keydown UP on handle increases value by step, not greater than max", function() { expect( 4 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'horizontal', + orientation: "horizontal", step: 1 }; el.slider(options); @@ -154,11 +154,11 @@ test("keydown UP on handle increases value by step, not greater than max", funct el.slider("destroy"); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'vertical', + orientation: "vertical", step: 1 }; el.slider(options); @@ -176,11 +176,11 @@ test("keydown UP on handle increases value by step, not greater than max", funct test("keydown RIGHT on handle increases value by step, not greater than max", function() { expect( 4 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'horizontal', + orientation: "horizontal", step: 1 }; el.slider(options); @@ -195,11 +195,11 @@ test("keydown RIGHT on handle increases value by step, not greater than max", fu el.slider("destroy"); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'vertical', + orientation: "vertical", step: 1 }; el.slider(options); @@ -217,11 +217,11 @@ test("keydown RIGHT on handle increases value by step, not greater than max", fu test("keydown DOWN on handle decreases value by step, not less than min", function() { expect( 4 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'horizontal', + orientation: "horizontal", step: 1 }; el.slider(options); @@ -236,11 +236,11 @@ test("keydown DOWN on handle decreases value by step, not less than min", functi el.slider("destroy"); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'vertical', + orientation: "vertical", step: 1 }; el.slider(options); @@ -258,11 +258,11 @@ test("keydown DOWN on handle decreases value by step, not less than min", functi test("keydown LEFT on handle decreases value by step, not less than min", function() { expect( 4 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'horizontal', + orientation: "horizontal", step: 1 }; el.slider(options); @@ -277,11 +277,11 @@ test("keydown LEFT on handle decreases value by step, not less than min", functi el.slider("destroy"); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 5, min: -5, - orientation: 'vertical', + orientation: "vertical", step: 1 }; el.slider(options); diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js index 83e78b855..73b8eb739 100644 --- a/tests/unit/slider/slider_methods.js +++ b/tests/unit/slider/slider_methods.js @@ -8,22 +8,22 @@ module("slider: methods"); test("init", function() { expect(5); - $("<div></div>").appendTo('body').slider().remove(); - ok(true, '.slider() called on element'); + $("<div></div>").appendTo("body").slider().remove(); + ok(true, ".slider() called on element"); $([]).slider().remove(); - ok(true, '.slider() called on empty collection'); + ok(true, ".slider() called on empty collection"); - $('<div></div>').slider().remove(); - ok(true, '.slider() called on disconnected DOMElement'); + $("<div></div>").slider().remove(); + ok(true, ".slider() called on disconnected DOMElement"); - var el = $('<div></div>').slider(); + var el = $("<div></div>").slider(); el.slider("option", "foo"); el.remove(); - ok(true, 'arbitrary option getter after init'); + ok(true, "arbitrary option getter after init"); - $('<div></div>').slider().slider("option", "foo", "bar").remove(); - ok(true, 'arbitrary option setter after init'); + $("<div></div>").slider().slider("option", "foo", "bar").remove(); + ok(true, "arbitrary option setter after init"); }); test("destroy", function() { @@ -36,60 +36,60 @@ test("destroy", function() { test("enable", function() { expect( 5 ); var el, - expected = $('<div></div>').slider(), - actual = expected.slider('enable'); - equal(actual, expected, 'enable is chainable'); + expected = $("<div></div>").slider(), + actual = expected.slider("enable"); + equal(actual, expected, "enable is chainable"); - el = $('<div></div>').slider({ disabled: true }); - ok(el.hasClass('ui-state-disabled'), 'slider has ui-state-disabled class before enable method call'); - ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class before enable method call'); - el.slider('enable'); - ok(!el.hasClass('ui-state-disabled'), 'slider does not have ui-state-disabled class after enable method call'); - ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class after enable method call'); + el = $("<div></div>").slider({ disabled: true }); + ok(el.hasClass("ui-state-disabled"), "slider has ui-state-disabled class before enable method call"); + ok(el.hasClass("ui-slider-disabled"), "slider has ui-slider-disabled class before enable method call"); + el.slider("enable"); + ok(!el.hasClass("ui-state-disabled"), "slider does not have ui-state-disabled class after enable method call"); + ok(!el.hasClass("ui-slider-disabled"), "slider does not have ui-slider-disabled class after enable method call"); }); test("disable", function() { expect( 5 ); var el, - expected = $('<div></div>').slider(), - actual = expected.slider('disable'); - equal(actual, expected, 'disable is chainable'); + expected = $("<div></div>").slider(), + actual = expected.slider("disable"); + equal(actual, expected, "disable is chainable"); - el = $('<div></div>').slider({ disabled: false }); - ok(!el.hasClass('ui-state-disabled'), 'slider does not have ui-state-disabled class before disabled method call'); - ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class before disable method call'); - el.slider('disable'); - ok(el.hasClass('ui-state-disabled'), 'slider has ui-state-disabled class after disable method call'); - ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class after disable method call'); + el = $("<div></div>").slider({ disabled: false }); + ok(!el.hasClass("ui-state-disabled"), "slider does not have ui-state-disabled class before disabled method call"); + ok(!el.hasClass("ui-slider-disabled"), "slider does not have ui-slider-disabled class before disable method call"); + el.slider("disable"); + ok(el.hasClass("ui-state-disabled"), "slider has ui-state-disabled class after disable method call"); + ok(el.hasClass("ui-slider-disabled"), "slider has ui-slider-disabled class after disable method call"); }); test("value", function() { expect( 17 ); - $([false, 'min', 'max']).each(function() { - var el = $('<div></div>').slider({ + $([false, "min", "max"]).each(function() { + var el = $("<div></div>").slider({ range: this, value: 5 }); - 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'); + 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({ + var el = $("<div></div>").slider({ min: -1, value: 0, max: 1 }); // min with value option vs value method - el.slider('option', 'value', -2); - 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'); + el.slider("option", "value", -2); + 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); - 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'); + el.slider("option", "value", 2); + 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 e34352eb0..d354ef91c 100644 --- a/tests/unit/slider/slider_options.js +++ b/tests/unit/slider/slider_options.js @@ -13,12 +13,12 @@ module("slider: options"); test("max", function() { expect( 2 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 37, min: 6, - orientation: 'horizontal', + orientation: "horizontal", step: 1, value: 50 }; @@ -26,18 +26,18 @@ test("max", function() { el.slider(options); ok(el.slider("option", "value") === options.value, "value option is not contained by max"); ok(el.slider("value") === options.max, "value method is contained by max"); - el.slider('destroy'); + el.slider("destroy"); }); test("min", function() { expect( 2 ); - el = $('<div></div>'); + el = $("<div></div>"); options = { max: 37, min: 6, - orientation: 'vertical', + orientation: "vertical", step: 1, value: 2 }; @@ -45,45 +45,45 @@ test("min", function() { el.slider(options); ok(el.slider("option", "value") === options.value, "value option is not contained by min"); ok(el.slider("value") === options.min, "value method is contained by min"); - el.slider('destroy'); + el.slider("destroy"); }); test("orientation", function() { expect( 6 ); - el = $('#slider1'); + el = $("#slider1"); options = { max: 2, min: -2, - orientation: 'vertical', + orientation: "vertical", value: 1 }; var percentVal = (options.value - options.min) / (options.max - options.min) * 100; 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"); - equal(handle()[0].style.left, percentVal + '%', "horizontal slider handle is positioned with left: %"); + 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"); + equal(handle()[0].style.left, percentVal + "%", "horizontal slider handle is positioned with left: %"); - el.slider('destroy'); + el.slider("destroy"); options = { max: 2, min: -2, - orientation: 'horizontal', + orientation: "horizontal", value: -1 }; percentVal = (options.value - options.min) / (options.max - options.min) * 100; 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"); - equal(handle()[0].style.bottom, percentVal + '%', "vertical slider handle is positioned with bottom: %"); + 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"); + equal(handle()[0].style.bottom, percentVal + "%", "vertical slider handle is positioned with bottom: %"); - el.slider('destroy'); + el.slider("destroy"); }); @@ -96,7 +96,7 @@ test("orientation", function() { // What is returned by the value method is restricted by min (>=), max (<=), and step (even multiple) test("step", function() { expect( 9 ); - var el = $('<div></div>').slider({ + var el = $("<div></div>").slider({ min: 0, value: 0, step: 10, @@ -116,7 +116,7 @@ test("step", function() { el.slider("value", 19); equal( el.slider("value"), 20 ); - el = $('<div></div>').slider({ + el = $("<div></div>").slider({ min: 0, value: 0, step: 20, @@ -136,7 +136,7 @@ test("step", function() { el.slider("option", "value", 19); equal( el.slider("value"), 20 ); - el.slider('destroy'); + el.slider("destroy"); }); //test("value", function() { |