🌐 AI搜索 & 代理 主页
Skip to content

Commit dcdc3c9

Browse files
authored
Update table-filtering.spec.js
1 parent 9f9cb35 commit dcdc3c9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/components/table/table-filtering.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,41 +248,41 @@ describe('table > filtering', () => {
248248
expect(wrapper).toBeDefined()
249249
expect(wrapper.findAll('tbody > tr').exists()).toBe(true)
250250
expect(wrapper.findAll('tbody > tr').length).toBe(3)
251-
expect(wrapper.vm.filterTimer).toBe(null)
251+
expect(wrapper.vm.$_filterTimer).toBe(null)
252252
await waitNT(wrapper.vm)
253253
expect(wrapper.emitted('input')).toBeDefined()
254254
expect(wrapper.emitted('input').length).toBe(1)
255255
expect(wrapper.emitted('input')[0][0]).toEqual(testItems)
256-
expect(wrapper.vm.filterTimer).toBe(null)
256+
expect(wrapper.vm.$_filterTimer).toBe(null)
257257

258258
// Set filter to a single character
259259
wrapper.setProps({
260260
filter: '1'
261261
})
262262
await waitNT(wrapper.vm)
263263
expect(wrapper.emitted('input').length).toBe(1)
264-
expect(wrapper.vm.filterTimer).not.toBe(null)
264+
expect(wrapper.vm.$_filterTimer).not.toBe(null)
265265

266266
// Change filter
267267
wrapper.setProps({
268268
filter: 'z'
269269
})
270270
await waitNT(wrapper.vm)
271271
expect(wrapper.emitted('input').length).toBe(1)
272-
expect(wrapper.vm.filterTimer).not.toBe(null)
272+
expect(wrapper.vm.$_filterTimer).not.toBe(null)
273273

274274
jest.runTimersToTime(101)
275275
await waitNT(wrapper.vm)
276276
expect(wrapper.emitted('input').length).toBe(2)
277277
expect(wrapper.emitted('input')[1][0]).toEqual([testItems[2]])
278-
expect(wrapper.vm.filterTimer).toBe(null)
278+
expect(wrapper.vm.$_filterTimer).toBe(null)
279279

280280
// Change filter
281281
wrapper.setProps({
282282
filter: '1'
283283
})
284284
await waitNT(wrapper.vm)
285-
expect(wrapper.vm.filterTimer).not.toBe(null)
285+
expect(wrapper.vm.$_filterTimer).not.toBe(null)
286286
expect(wrapper.emitted('input').length).toBe(2)
287287

288288
// Change filter-debounce to no debouncing
@@ -291,7 +291,7 @@ describe('table > filtering', () => {
291291
})
292292
await waitNT(wrapper.vm)
293293
// Should clear the pending timer
294-
expect(wrapper.vm.filterTimer).toBe(null)
294+
expect(wrapper.vm.$_filterTimer).toBe(null)
295295
// Should immediately filter the items
296296
expect(wrapper.emitted('input').length).toBe(3)
297297
expect(wrapper.emitted('input')[2][0]).toEqual([testItems[1]])

0 commit comments

Comments
 (0)