Skip to content
Permalink
Browse files

Tests: Convert single quotes to double quotes.

  • Loading branch information...
mikesherov committed Dec 26, 2012
1 parent 74d7eac commit 0d4022bceb33fb95c41fab768c1829d464861899
Showing with 2,086 additions and 2,085 deletions.
  1. +1 −0 tests/.jshintrc
  2. +128 −128 tests/unit/core/selector.js
  3. +329 −329 tests/unit/datepicker/datepicker_core.js
  4. +87 −87 tests/unit/datepicker/datepicker_events.js
  5. +102 −102 tests/unit/datepicker/datepicker_methods.js
  6. +714 −714 tests/unit/datepicker/datepicker_options.js
  7. +4 −4 tests/unit/datepicker/datepicker_test_helpers.js
  8. +6 −6 tests/unit/dialog/dialog_common.js
  9. +4 −4 tests/unit/dialog/dialog_core.js
  10. +6 −6 tests/unit/dialog/dialog_deprecated.js
  11. +92 −92 tests/unit/dialog/dialog_events.js
  12. +54 −54 tests/unit/dialog/dialog_methods.js
  13. +123 −123 tests/unit/dialog/dialog_options.js
  14. +5 −5 tests/unit/dialog/dialog_test_helpers.js
  15. +12 −12 tests/unit/draggable/draggable_core.js
  16. +2 −2 tests/unit/draggable/draggable_events.js
  17. +27 −27 tests/unit/draggable/draggable_methods.js
  18. +104 −104 tests/unit/draggable/draggable_options.js
  19. +7 −7 tests/unit/draggable/draggable_test_helpers.js
  20. +6 −6 tests/unit/droppable/droppable_core.js
  21. +19 −19 tests/unit/droppable/droppable_methods.js
  22. +2 −2 tests/unit/droppable/droppable_test_helpers.js
  23. +1 −1 tests/unit/qunit-composite.js
  24. +5 −5 tests/unit/resizable/resizable_common.js
  25. +20 −20 tests/unit/resizable/resizable_core.js
  26. +16 −16 tests/unit/resizable/resizable_options.js
  27. +5 −5 tests/unit/selectable/selectable_common.js
  28. +19 −19 tests/unit/selectable/selectable_methods.js
  29. +1 −1 tests/unit/selectable/selectable_options.js
  30. +2 −2 tests/unit/slider/slider_common.js
  31. +32 −32 tests/unit/slider/slider_core.js
  32. +43 −43 tests/unit/slider/slider_methods.js
  33. +20 −20 tests/unit/slider/slider_options.js
  34. +63 −63 tests/unit/sortable/sortable_events.js
  35. +25 −25 tests/unit/sortable/sortable_methods.js
@@ -9,6 +9,7 @@
"latedef": true,
"noarg": true,
"onevar": true,
"quotmark": "double",
"trailing": true,
"undef": true,
"unused": true,

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -17,137 +17,137 @@ function callback(date, inst) {

function callback2(year, month, inst) {
selectedThis = this;
selectedDate = year + '/' + month;
selectedDate = year + "/" + month;
selectedInst = inst;
}

test('events', function() {
test("events", function() {
expect( 26 );
var dateStr, newMonthYear, inp2,
inp = TestHelpers.datepicker.init('#inp', {onSelect: callback}),
inp = TestHelpers.datepicker.init("#inp", {onSelect: callback}),
date = new Date();
// onSelect
inp.val('').datepicker('show').
simulate('keydown', {keyCode: $.ui.keyCode.ENTER});
equal(selectedThis, inp[0], 'Callback selected this');
equal(selectedInst, $.data(inp[0], TestHelpers.datepicker.PROP_NAME), 'Callback selected inst');
equal(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
'Callback selected date');
inp.val('').datepicker('show').
simulate('keydown', {ctrlKey: true, keyCode: $.ui.keyCode.DOWN}).
simulate('keydown', {keyCode: $.ui.keyCode.ENTER});
inp.val("").datepicker("show").
simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
equal(selectedThis, inp[0], "Callback selected this");
equal(selectedInst, $.data(inp[0], TestHelpers.datepicker.PROP_NAME), "Callback selected inst");
equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", date),
"Callback selected date");
inp.val("").datepicker("show").
simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.DOWN}).
simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
date.setDate(date.getDate() + 7);
equal(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
'Callback selected date - ctrl+down');
inp.val('').datepicker('show').
simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE});
equal(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
'Callback selected date - esc');
dateStr = '02/04/2008';
inp.val(dateStr).datepicker('show').
simulate('keydown', {keyCode: $.ui.keyCode.ENTER});
equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", date),
"Callback selected date - ctrl+down");
inp.val("").datepicker("show").
simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", date),
"Callback selected date - esc");
dateStr = "02/04/2008";
inp.val(dateStr).datepicker("show").
simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
equal(dateStr, selectedDate,
'onSelect is called after enter keydown');
"onSelect is called after enter keydown");
// onChangeMonthYear
inp.datepicker('option', {onChangeMonthYear: callback2, onSelect: null}).
val('').datepicker('show');
inp.datepicker("option", {onChangeMonthYear: callback2, onSelect: null}).
val("").datepicker("show");
newMonthYear = function(date) {
return date.getFullYear() + '/' + (date.getMonth() + 1);
return date.getFullYear() + "/" + (date.getMonth() + 1);
};
date = new Date();
date.setDate(1);
inp.simulate('keydown', {keyCode: $.ui.keyCode.PAGE_UP});
inp.simulate("keydown", {keyCode: $.ui.keyCode.PAGE_UP});
date.setMonth(date.getMonth() - 1);
equal(selectedThis, inp[0], 'Callback change month/year this');
equal(selectedInst, $.data(inp[0], TestHelpers.datepicker.PROP_NAME), 'Callback change month/year inst');
equal(selectedThis, inp[0], "Callback change month/year this");
equal(selectedInst, $.data(inp[0], TestHelpers.datepicker.PROP_NAME), "Callback change month/year inst");
equal(selectedDate, newMonthYear(date),
'Callback change month/year date - pgup');
inp.simulate('keydown', {keyCode: $.ui.keyCode.PAGE_DOWN});
"Callback change month/year date - pgup");
inp.simulate("keydown", {keyCode: $.ui.keyCode.PAGE_DOWN});
date.setMonth(date.getMonth() + 1);
equal(selectedDate, newMonthYear(date),
'Callback change month/year date - pgdn');
inp.simulate('keydown', {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP});
"Callback change month/year date - pgdn");
inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP});
date.setFullYear(date.getFullYear() - 1);
equal(selectedDate, newMonthYear(date),
'Callback change month/year date - ctrl+pgup');
inp.simulate('keydown', {ctrlKey: true, keyCode: $.ui.keyCode.HOME});
"Callback change month/year date - ctrl+pgup");
inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.HOME});
date.setFullYear(date.getFullYear() + 1);
equal(selectedDate, newMonthYear(date),
'Callback change month/year date - ctrl+home');
inp.simulate('keydown', {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN});
"Callback change month/year date - ctrl+home");
inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN});
date.setFullYear(date.getFullYear() + 1);
equal(selectedDate, newMonthYear(date),
'Callback change month/year date - ctrl+pgdn');
inp.datepicker('setDate', new Date(2007, 1 - 1, 26));
equal(selectedDate, '2007/1', 'Callback change month/year date - setDate');
"Callback change month/year date - ctrl+pgdn");
inp.datepicker("setDate", new Date(2007, 1 - 1, 26));
equal(selectedDate, "2007/1", "Callback change month/year date - setDate");
selectedDate = null;
inp.datepicker('setDate', new Date(2007, 1 - 1, 12));
ok(selectedDate == null, 'Callback change month/year date - setDate no change');
inp.datepicker("setDate", new Date(2007, 1 - 1, 12));
ok(selectedDate == null, "Callback change month/year date - setDate no change");
// onChangeMonthYear step by 2
inp.datepicker('option', {stepMonths: 2}).
datepicker('hide').val('').datepicker('show').
simulate('keydown', {keyCode: $.ui.keyCode.PAGE_UP});
inp.datepicker("option", {stepMonths: 2}).
datepicker("hide").val("").datepicker("show").
simulate("keydown", {keyCode: $.ui.keyCode.PAGE_UP});
date.setMonth(date.getMonth() - 14);
equal(selectedDate, newMonthYear(date),
'Callback change month/year by 2 date - pgup');
inp.simulate('keydown', {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP});
"Callback change month/year by 2 date - pgup");
inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP});
date.setMonth(date.getMonth() - 12);
equal(selectedDate, newMonthYear(date),
'Callback change month/year by 2 date - ctrl+pgup');
inp.simulate('keydown', {keyCode: $.ui.keyCode.PAGE_DOWN});
"Callback change month/year by 2 date - ctrl+pgup");
inp.simulate("keydown", {keyCode: $.ui.keyCode.PAGE_DOWN});
date.setMonth(date.getMonth() + 2);
equal(selectedDate, newMonthYear(date),
'Callback change month/year by 2 date - pgdn');
inp.simulate('keydown', {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN});
"Callback change month/year by 2 date - pgdn");
inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN});
date.setMonth(date.getMonth() + 12);
equal(selectedDate, newMonthYear(date),
'Callback change month/year by 2 date - ctrl+pgdn');
"Callback change month/year by 2 date - ctrl+pgdn");
// onClose
inp.datepicker('option', {onClose: callback, onChangeMonthYear: null, stepMonths: 1}).
val('').datepicker('show').
simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE});
equal(selectedThis, inp[0], 'Callback close this');
equal(selectedInst, $.data(inp[0], TestHelpers.datepicker.PROP_NAME), 'Callback close inst');
equal(selectedDate, '', 'Callback close date - esc');
inp.val('').datepicker('show').
simulate('keydown', {keyCode: $.ui.keyCode.ENTER});
equal(selectedDate, $.datepicker.formatDate('mm/dd/yy', new Date()),
'Callback close date - enter');
inp.val('02/04/2008').datepicker('show').
simulate('keydown', {keyCode: $.ui.keyCode.ESCAPE});
equal(selectedDate, '02/04/2008', 'Callback close date - preset');
inp.val('02/04/2008').datepicker('show').
simulate('keydown', {ctrlKey: true, keyCode: $.ui.keyCode.END});
equal(selectedDate, '', 'Callback close date - ctrl+end');
inp.datepicker("option", {onClose: callback, onChangeMonthYear: null, stepMonths: 1}).
val("").datepicker("show").
simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
equal(selectedThis, inp[0], "Callback close this");
equal(selectedInst, $.data(inp[0], TestHelpers.datepicker.PROP_NAME), "Callback close inst");
equal(selectedDate, "", "Callback close date - esc");
inp.val("").datepicker("show").
simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", new Date()),
"Callback close date - enter");
inp.val("02/04/2008").datepicker("show").
simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
equal(selectedDate, "02/04/2008", "Callback close date - preset");
inp.val("02/04/2008").datepicker("show").
simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.END});
equal(selectedDate, "", "Callback close date - ctrl+end");

inp2 = TestHelpers.datepicker.init('#inp2');
inp2.datepicker().datepicker('option', {onClose: callback}).datepicker('show');
inp.datepicker('show');
equal(selectedThis, inp2[0], 'Callback close this');
inp2 = TestHelpers.datepicker.init("#inp2");
inp2.datepicker().datepicker("option", {onClose: callback}).datepicker("show");
inp.datepicker("show");
equal(selectedThis, inp2[0], "Callback close this");
});

test('beforeShowDay-getDate', function() {
test("beforeShowDay-getDate", function() {
expect( 3 );
var inp = TestHelpers.datepicker.init('#inp', {beforeShowDay: function() { inp.datepicker('getDate'); return [true, '']; }}),
dp = $('#ui-datepicker-div');
inp.val('01/01/2010').datepicker('show');
var inp = TestHelpers.datepicker.init("#inp", {beforeShowDay: function() { inp.datepicker("getDate"); return [true, ""]; }}),
dp = $("#ui-datepicker-div");
inp.val("01/01/2010").datepicker("show");
// contains non-breaking space
equal($('div.ui-datepicker-title').text(),
equal($("div.ui-datepicker-title").text(),
// support: IE <9, jQuery <1.8
// In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways
$( "<span>January&#xa0;2010</span>" ).text(), 'Initial month');
$('a.ui-datepicker-next', dp).click();
$('a.ui-datepicker-next', dp).click();
$( "<span>January&#xa0;2010</span>" ).text(), "Initial month");
$("a.ui-datepicker-next", dp).click();
$("a.ui-datepicker-next", dp).click();
// contains non-breaking space
equal($('div.ui-datepicker-title').text(),
$( "<span>March&#xa0;2010</span>" ).text(), 'After next clicks');
inp.datepicker('hide').datepicker('show');
$('a.ui-datepicker-prev', dp).click();
$('a.ui-datepicker-prev', dp).click();
equal($("div.ui-datepicker-title").text(),
$( "<span>March&#xa0;2010</span>" ).text(), "After next clicks");
inp.datepicker("hide").datepicker("show");
$("a.ui-datepicker-prev", dp).click();
$("a.ui-datepicker-prev", dp).click();
// contains non-breaking space
equal($('div.ui-datepicker-title').text(),
$( "<span>November&#xa0;2009</span>" ).text(), 'After prev clicks');
inp.datepicker('hide');
equal($("div.ui-datepicker-title").text(),
$( "<span>November&#xa0;2009</span>" ).text(), "After prev clicks");
inp.datepicker("hide");
});

})(jQuery);

0 comments on commit 0d4022b

Please sign in to comment.
You can’t perform that action at this time.