Skip to content

Commit a0fb2c2

Browse files
committed
Tests: Lint.
1 parent a289830 commit a0fb2c2

File tree

9 files changed

+63
-59
lines changed

9 files changed

+63
-59
lines changed

tests/unit/progressbar/progressbar_events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test("create", function() {
1515
change: function() {
1616
ok(false, 'create() has triggered change()');
1717
}
18-
})
18+
});
1919
});
2020

2121
test("change", function() {

tests/unit/resizable/resizable_methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test("init", function() {
2020
$('<div></div>').resizable().resizable("foo").remove();
2121
ok(true, 'arbitrary method called after init');
2222

23-
el = $('<div></div>').resizable()
23+
el = $('<div></div>').resizable();
2424
var foo = el.resizable("option", "foo");
2525
el.remove();
2626
ok(true, 'arbitrary option getter after init');

tests/unit/selectable/selectable_methods.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test("init", function() {
2020
$("<div></div>").selectable().selectable("foo").remove();
2121
ok(true, 'arbitrary method called after init');
2222

23-
el = $("<div></div>").selectable()
23+
el = $("<div></div>").selectable();
2424
var foo = el.selectable("option", "foo");
2525
el.remove();
2626
ok(true, 'arbitrary option getter after init');
@@ -49,7 +49,8 @@ test("destroy", function() {
4949

5050
test("enable", function() {
5151
expect(3);
52-
var fired = false;
52+
var expected, actual,
53+
fired = false;
5354

5455
el = $("#selectable1");
5556
el.selectable({
@@ -63,14 +64,15 @@ test("enable", function() {
6364
equal(fired, true, "start fired");
6465
el.selectable("destroy");
6566

66-
var expected = $('<div></div>').selectable(),
67-
actual = expected.selectable('enable');
67+
expected = $('<div></div>').selectable();
68+
actual = expected.selectable('enable');
6869
equal(actual, expected, 'enable is chainable');
6970
});
7071

7172
test("disable", function() {
7273
expect(3);
73-
var fired = false;
74+
var expected, actual,
75+
fired = false;
7476

7577
el = $("#selectable1");
7678
el.selectable({
@@ -85,8 +87,8 @@ test("disable", function() {
8587
equal(fired, false, "start fired");
8688
el.selectable("destroy");
8789

88-
var expected = $('<div></div>').selectable(),
89-
actual = expected.selectable('disable');
90+
expected = $('<div></div>').selectable();
91+
actual = expected.selectable('disable');
9092
equal(actual, expected, 'disable is chainable');
9193
});
9294

tests/unit/selectable/selectable_options.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module("selectable: options");
88
test("autoRefresh", function() {
99
expect(3);
1010
el = $("#selectable1");
11-
var actual, sel = $("*", el), selected = function() { actual += 1 };
11+
var actual, sel = $("*", el), selected = function() { actual += 1; };
1212

1313
actual = 0;
1414
el = $("#selectable1").selectable({ autoRefresh: false, selected: selected });
@@ -33,12 +33,12 @@ test("autoRefresh", function() {
3333
test("filter", function() {
3434
expect(2);
3535
el = $("#selectable1");
36-
var actual, sel = $("*", el), selected = function() { actual += 1 };
36+
var actual, sel = $("*", el), selected = function() { actual += 1; };
3737

3838
actual = 0;
3939
el = $("#selectable1").selectable({ filter: '.special', selected: selected });
4040
drag(1000, 1000);
41-
ok(sel.length != 1, "this test assumes more than 1 selectee");
41+
ok(sel.length !== 1, "this test assumes more than 1 selectee");
4242
equal(actual, 1);
4343
el.selectable("destroy");
4444
});

tests/unit/slider/slider_methods.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ test("init", function() {
1717
$('<div></div>').slider().remove();
1818
ok(true, '.slider() called on disconnected DOMElement');
1919

20-
var el = $('<div></div>').slider();
21-
var foo = el.slider("option", "foo");
20+
var el = $('<div></div>').slider(),
21+
foo = el.slider("option", "foo");
2222
el.remove();
2323
ok(true, 'arbitrary option getter after init');
2424

@@ -42,11 +42,12 @@ test("destroy", function() {
4242
});
4343

4444
test("enable", function() {
45-
var expected = $('<div></div>').slider(),
45+
var el,
46+
expected = $('<div></div>').slider(),
4647
actual = expected.slider('enable');
4748
equal(actual, expected, 'enable is chainable');
4849

49-
var el = $('<div></div>').slider({ disabled: true });
50+
el = $('<div></div>').slider({ disabled: true });
5051
ok(el.hasClass('ui-disabled'), 'slider has ui-disabled class before enable method call');
5152
ok(el.hasClass('ui-slider-disabled'), 'slider has ui-slider-disabled class before enable method call');
5253
el.slider('enable');
@@ -55,11 +56,12 @@ test("enable", function() {
5556
});
5657

5758
test("disable", function() {
58-
var expected = $('<div></div>').slider(),
59+
var el,
60+
expected = $('<div></div>').slider(),
5961
actual = expected.slider('disable');
6062
equal(actual, expected, 'disable is chainable');
6163

62-
var el = $('<div></div>').slider({ disabled: false });
64+
el = $('<div></div>').slider({ disabled: false });
6365
ok(!el.hasClass('ui-disabled'), 'slider does not have ui-disabled class before disabled method call');
6466
ok(!el.hasClass('ui-slider-disabled'), 'slider does not have ui-slider-disabled class before disable method call');
6567
el.slider('disable');

tests/unit/slider/slider_options.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ test("max", function() {
2323
};
2424

2525
el.slider(options);
26-
ok(el.slider("option", "value") == options.value, "value option is not contained by max");
27-
ok(el.slider("value") == options.max, "value method is contained by max");
26+
ok(el.slider("option", "value") === options.value, "value option is not contained by max");
27+
ok(el.slider("value") === options.max, "value method is contained by max");
2828
el.slider('destroy');
2929

3030
});
@@ -41,8 +41,8 @@ test("min", function() {
4141
};
4242

4343
el.slider(options);
44-
ok(el.slider("option", "value") == options.value, "value option is not contained by min");
45-
ok(el.slider("value") == options.min, "value method is contained by min");
44+
ok(el.slider("option", "value") === options.value, "value option is not contained by min");
45+
ok(el.slider("value") === options.min, "value method is contained by min");
4646
el.slider('destroy');
4747

4848
});
@@ -73,7 +73,7 @@ test("orientation", function() {
7373
value: -1
7474
};
7575

76-
var percentVal = (options.value - options.min) / (options.max - options.min) * 100;
76+
percentVal = (options.value - options.min) / (options.max - options.min) * 100;
7777

7878
el.slider(options).slider("option", "orientation", "vertical");
7979
ok(el.is('.ui-slider-vertical'), "vertical slider has class .ui-slider-vertical");

tests/unit/sortable/sortable_events.js

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,118 +6,118 @@
66
module("sortable: events");
77

88
test("start", function() {
9-
9+
1010
var hash;
1111
$("#sortable")
1212
.sortable({ start: function(e, ui) { hash = ui; } })
1313
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 10 });
14-
15-
ok(hash, 'start event triggered');
14+
15+
ok(hash, 'start event triggered');
1616
ok(hash.helper, 'UI hash includes: helper');
1717
ok(hash.placeholder, 'UI hash includes: placeholder');
1818
ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
1919
ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
2020
ok(hash.item, 'UI hash includes: item');
2121
ok(!hash.sender, 'UI hash does not include: sender');
2222

23-
23+
2424
});
2525

2626
test("sort", function() {
27-
27+
2828
var hash;
2929
$("#sortable")
3030
.sortable({ sort: function(e, ui) { hash = ui; } })
3131
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 10 });
32-
33-
ok(hash, 'sort event triggered');
32+
33+
ok(hash, 'sort event triggered');
3434
ok(hash.helper, 'UI hash includes: helper');
3535
ok(hash.placeholder, 'UI hash includes: placeholder');
3636
ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
3737
ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
3838
ok(hash.item, 'UI hash includes: item');
3939
ok(!hash.sender, 'UI hash does not include: sender');
40-
40+
4141
});
4242

4343
test("change", function() {
44-
44+
4545
var hash;
4646
$("#sortable")
4747
.sortable({ change: function(e, ui) { hash = ui; } })
4848
.find('li:eq(0)').simulate("drag", { dx: 1, dy: 1 });
49-
49+
5050
ok(!hash, '1px drag, change event should not be triggered');
51-
51+
5252
$("#sortable")
5353
.sortable({ change: function(e, ui) { hash = ui; } })
54-
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
55-
56-
ok(hash, 'change event triggered');
54+
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
55+
56+
ok(hash, 'change event triggered');
5757
ok(hash.helper, 'UI hash includes: helper');
5858
ok(hash.placeholder, 'UI hash includes: placeholder');
5959
ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
6060
ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
6161
ok(hash.item, 'UI hash includes: item');
6262
ok(!hash.sender, 'UI hash does not include: sender');
63-
63+
6464
});
6565

6666
test("beforeStop", function() {
67-
67+
6868
var hash;
6969
$("#sortable")
7070
.sortable({ beforeStop: function(e, ui) { hash = ui; } })
71-
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
72-
73-
ok(hash, 'beforeStop event triggered');
71+
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
72+
73+
ok(hash, 'beforeStop event triggered');
7474
ok(hash.helper, 'UI hash includes: helper');
7575
ok(hash.placeholder, 'UI hash includes: placeholder');
7676
ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
7777
ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
7878
ok(hash.item, 'UI hash includes: item');
7979
ok(!hash.sender, 'UI hash does not include: sender');
80-
80+
8181
});
8282

8383
test("stop", function() {
84-
84+
8585
var hash;
8686
$("#sortable")
8787
.sortable({ stop: function(e, ui) { hash = ui; } })
88-
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
89-
90-
ok(hash, 'stop event triggered');
88+
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
89+
90+
ok(hash, 'stop event triggered');
9191
ok(!hash.helper, 'UI should not include: helper');
9292
ok(hash.placeholder, 'UI hash includes: placeholder');
9393
ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
9494
ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
9595
ok(hash.item, 'UI hash includes: item');
9696
ok(!hash.sender, 'UI hash does not include: sender');
97-
97+
9898
});
9999

100100
test("update", function() {
101-
101+
102102
var hash;
103103
$("#sortable")
104104
.sortable({ update: function(e, ui) { hash = ui; } })
105105
.find('li:eq(0)').simulate("drag", { dx: 1, dy: 1 });
106-
106+
107107
ok(!hash, '1px drag, update event should not be triggered');
108-
108+
109109
$("#sortable")
110110
.sortable({ update: function(e, ui) { hash = ui; } })
111-
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
112-
113-
ok(hash, 'update event triggered');
111+
.find('li:eq(0)').simulate("drag", { dx: 0, dy: 20 });
112+
113+
ok(hash, 'update event triggered');
114114
ok(!hash.helper, 'UI hash should not include: helper');
115115
ok(hash.placeholder, 'UI hash includes: placeholder');
116116
ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
117117
ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
118118
ok(hash.item, 'UI hash includes: item');
119119
ok(!hash.sender, 'UI hash does not include: sender');
120-
120+
121121
});
122122

123123
test("receive", function() {

tests/unit/sortable/sortable_methods.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
var el, offsetBefore, offsetAfter, dragged;
77

8-
var drag = function(handle, dx, dy) {
8+
function drag(handle, dx, dy) {
99
offsetBefore = $(handle).offset();
1010
$(handle).simulate("drag", {
1111
dx: dx || 0,
@@ -15,7 +15,7 @@ var drag = function(handle, dx, dy) {
1515
offsetAfter = $(handle).offset();
1616
}
1717

18-
var sort = function(handle, dx, dy, index, msg) {
18+
function sort(handle, dx, dy, index, msg) {
1919
drag(handle, dx, dy);
2020
equal($(handle).parent().children().index(handle), index, msg);
2121
}

tests/unit/sortable/sortable_tickets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
var el, offsetBefore, offsetAfter, dragged;
77

8-
var drag = function(handle, dx, dy) {
8+
function drag(handle, dx, dy) {
99
offsetBefore = $(handle).offset();
1010
$(handle).simulate("drag", {
1111
dx: dx || 0,
@@ -15,7 +15,7 @@ var drag = function(handle, dx, dy) {
1515
offsetAfter = $(handle).offset();
1616
}
1717

18-
var sort = function(handle, dx, dy, index, msg) {
18+
function sort(handle, dx, dy, index, msg) {
1919
drag(handle, dx, dy);
2020
equal($(handle).parent().children().index(handle), index, msg);
2121
}

0 commit comments

Comments
 (0)