Skip to content

Commit bd79a3d

Browse files
committed
Update test.
1 parent 185cfc6 commit bd79a3d

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

dist/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
113113
},
114114
itemprops: {
115115
type: Function,
116+
117+
/* istanbul ignore next */
116118
default: function _default() {}
117119
}
118120
},

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
},
102102
itemprops: {
103103
type: Function,
104+
/* istanbul ignore next */
104105
default () {}
105106
}
106107
},

test/shape.test.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ describe(theme, () => {
7676
})
7777

7878
it(`[${theme}] check update correct.`, () => {
79+
const list = wrapper.find('.list')
80+
const listEl = list.vm.$el
7981
const vmData = wrapper.vm.$data
80-
const listEl = wrapper.find('.list').vm.$el
8182

83+
let itemFrags
8284
let expectOutsideHeight
8385

8486
// change size and check shape.
@@ -96,7 +98,13 @@ describe(theme, () => {
9698
expect(listEl.style.height).toBe(expectOutsideHeight)
9799

98100
vmData.bench = 66
99-
const itemFrags = wrapper.findAll('.for-item')
101+
itemFrags = wrapper.findAll('.for-item')
100102
expect(itemFrags.length).toBe(vmData.remian + 66)
103+
104+
vmData.items = getIndexList(7)
105+
listEl.scrollTop = 1000 // over scroll.
106+
list.trigger('scroll')
107+
itemFrags = wrapper.findAll('.for-item')
108+
expect(itemFrags.length).toBe(7)
101109
})
102110
})

test/variable.fn.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe(theme, () => {
5151

5252
data () {
5353
return {
54-
start: 0,
54+
start: 5,
5555
size: initSize,
5656
remian: initRemian,
5757
items: getVariableList(listCount)
@@ -79,7 +79,7 @@ describe(theme, () => {
7979
// no cache init.
8080
const list = wrapper.find('.list')
8181
const listDelta = list.vm.delta
82-
expect(Object.keys(listDelta.varCache).length === 0).toBe(true)
82+
expect(Object.keys(listDelta.varCache).length !== 0).toBe(true)
8383
})
8484

8585
it(`[${theme}] check update.`, () => {

0 commit comments

Comments
 (0)