Skip to content

Commit 9cd0fcd

Browse files
committed
Fix the code style for the new test case
1 parent a7558e3 commit 9cd0fcd

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

test/unit/specs/InfiniteLoading.spec.js

+18-12
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('InfiniteLoading.vue', () => {
2121
isCustomSpinner: false,
2222
listContainerHeight: 100,
2323
listItemHeight: 10,
24-
customSpinnerHeight: 10
24+
customSpinnerHeight: 10,
2525
},
2626
template: `
2727
<div style="margin: 0; padding: 0;"
@@ -30,16 +30,21 @@ describe('InfiniteLoading.vue', () => {
3030
height: listContainerHeight + 'px'
3131
}">
3232
<ul style="margin: 0; padding: 0; font-size: 5px;">
33-
<li v-for="item in list" v-text="item" style="height: 10px; margin: 0; padding: 0;" :style="{
34-
height: listItemHeight + 'px'
33+
<li v-for="item in list" v-text="item"
34+
style="height: 10px; margin: 0; padding: 0;"
35+
:style="{
36+
height: listItemHeight + 'px'
3537
}"></li>
3638
</ul>
3739
<infinite-loading :distance="distance"
3840
:on-infinite="onInfinite"
3941
v-if="!isLoadedAll">
40-
<span slot="spinner" v-if="isCustomSpinner"><i class="custom-spinner" style="display: inline-block; width: 10px;" :style="{
41-
height: customSpinnerHeight + 'px'
42-
}"></i></span>
42+
<span slot="spinner" v-if="isCustomSpinner">
43+
<i class="custom-spinner" style="display: inline-block; width: 10px;"
44+
:style="{
45+
height: customSpinnerHeight + 'px'
46+
}"></i>
47+
</span>
4348
</infinite-loading>
4449
</div>
4550
`,
@@ -140,24 +145,25 @@ describe('InfiniteLoading.vue', () => {
140145
vm.$mount().$appendTo('body');
141146
});
142147

143-
it('should load results to fill up the container', function (done) {
148+
it('should load results to fill up the container', function fillUpTest(done) {
144149
const TEST_TIMEOUT = 2000;
145-
let mocha = this;
150+
const mocha = this;
146151
let i = 0;
147152
vm.listContainerHeight = 100;
148153
vm.listItemHeight = 10;
149154
vm.distance = 10;
150155
vm.isCustomSpinner = true;
151156
vm.customSpinnerHeight = 10;
152-
let expectedCount = Math.floor(vm.listContainerHeight / vm.listItemHeight);
157+
const expectedCount = Math.floor(vm.listContainerHeight / vm.listItemHeight);
158+
153159
vm.onInfinite = function test() {
154160
this.list.push(++i);
155161
Vue.nextTick(() => {
156162
this.$broadcast('$InfiniteLoading:loaded');
157-
if (i == expectedCount) {
163+
if (i === expectedCount) {
158164
mocha.timeout(TEST_TIMEOUT + 100);
159-
setTimeout(function () {
160-
if (i == expectedCount) {
165+
setTimeout(() => {
166+
if (i === expectedCount) {
161167
done();
162168
} else {
163169
done(new Error('Unexpected number of items added'));

0 commit comments

Comments
 (0)