Skip to content

Commit ee7ca33

Browse files
committed
fix the test suite
1 parent b48bbd8 commit ee7ca33

22 files changed

+48
-31044
lines changed

.jshintrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"requireModule",
55
"Ember",
66
"Handlebars",
7+
"Bootstrap",
78
"Metamorph",
89
"ember_assert",
910
"ember_warn",
@@ -26,7 +27,14 @@
2627
"async",
2728
"invokeAsync",
2829
"jQuery",
29-
"expectAssertion"
30+
"expectAssertion",
31+
32+
"clickRelLink",
33+
"appendIntoDOM",
34+
"isAppendedToDOM",
35+
"isDestroyed",
36+
"documentHasSelector",
37+
"destroyIfNecessary"
3038
],
3139
node: false,
3240
es5: true,

packages/ember-bootstrap/tests/forms/controls/checkbox_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ module("Bootstrap.Forms.Checkbox", {
1111
},
1212

1313
teardown: function() {
14-
field.destroy();
15-
field = null;
14+
destroyIfNecessary(field);
1615
}
1716
});
1817

packages/ember-bootstrap/tests/forms/controls/select_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ module("Bootstrap.Forms.Select", {
1515
},
1616

1717
teardown: function() {
18-
field.destroy();
19-
field = null;
18+
destroyIfNecessary(field);
2019
}
2120
});
2221

packages/ember-bootstrap/tests/forms/controls/text_area_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ module("Bootstrap.Forms.TextArea", {
1111
},
1212

1313
teardown: function() {
14-
field.destroy();
15-
field = null;
14+
destroyIfNecessary(field);
1615
}
1716
});
1817

packages/ember-bootstrap/tests/forms/controls/text_field_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ module("Bootstrap.Forms.TextField", {
1111
},
1212

1313
teardown: function() {
14-
field.destroy();
15-
field = null;
14+
destroyIfNecessary(field);
1615
}
1716
});
1817

packages/ember-bootstrap/tests/forms/controls/uneditable_input_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ module("Bootstrap.Forms.UneditableInput", {
1111
},
1212

1313
teardown: function() {
14-
field.destroy();
15-
field = null;
14+
destroyIfNecessary(field);
1615
}
1716
});
1817

packages/ember-bootstrap/tests/forms/field_test.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ module("Bootstrap.Forms.Field", {
1010
},
1111

1212
teardown: function() {
13-
field.destroy();
14-
field = null;
13+
destroyIfNecessary(field);
1514
}
1615
});
1716

@@ -43,7 +42,7 @@ test("should have the label for attribute", function() {
4342
});
4443

4544
test("should use the valueBinding value as a default label", function() {
46-
field.destroy();
45+
destroyIfNecessary(field);
4746
field = null;
4847
object = Ember.Object.create({
4948
foo: null
@@ -93,7 +92,7 @@ test("should display the label errors", function() {
9392
});
9493

9594
test("should display the field errors", function() {
96-
field.destroy();
95+
destroyIfNecessary(field);
9796
field = null;
9897
object = Ember.Object.create({
9998
foo: null
@@ -126,7 +125,7 @@ test("should display the field errors", function() {
126125
});
127126

128127
test("should display the nested object's field errors", function() {
129-
field.destroy();
128+
destroyIfNecessary(field);
130129
field = null;
131130
object = Ember.Object.create({
132131
foo: null,

packages/ember-bootstrap/tests/views/alert_message_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ module("Bootstrap.AlertMessage", {
77
},
88
teardown: function() {
99
Ember.run(function() {
10-
window.destroyIfNecessary(alert);
11-
application.destroy();
10+
destroyIfNecessary(alert);
11+
destroyIfNecessary(application);
1212
});
1313
}
1414
});

packages/ember-bootstrap/tests/views/block_alert_message_test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ var blockAlert;
44
module("Bootstrap.BlockAlertMessage", {
55
setup: function() {},
66
teardown: function() {
7-
Ember.run(function() {
8-
window.destroyIfNecessary(blockAlert);
9-
});
7+
destroyIfNecessary(blockAlert);
108
}
119
});
1210

packages/ember-bootstrap/tests/views/breadcrumb_test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ module('Bootstrap.Breadcrumb', {
77
many = Ember.A(['Home', 'Library', 'Data']);
88
},
99
teardown: function() {
10-
run(function() {
11-
destroyIfNecessary(breadcrumb);
12-
});
10+
destroyIfNecessary(breadcrumb);
1311
}
1412
});
1513

0 commit comments

Comments
 (0)