Skip to content

Commit b6c2912

Browse files
authored
Update table-tbody-transition.spec.js
1 parent 271d931 commit b6c2912

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/components/table/table-tbody-transition.spec.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ describe('table body transition', () => {
1010
propsData: {
1111
fields: testFields,
1212
items: testItems
13+
},
14+
stubs: {
15+
'transition-group': TransitionGroupStub
1316
}
1417
})
1518
expect(wrapper).toBeDefined()
@@ -27,14 +30,16 @@ describe('table body transition', () => {
2730
tbodyTransitionProps: {
2831
name: 'fade'
2932
}
33+
},
34+
stubs: {
35+
'transition-group': TransitionGroupStub
3036
}
3137
})
3238
expect(wrapper).toBeDefined()
3339
expect(wrapper.is('table')).toBe(true)
34-
expect(wrapper.find('tbody').exists()).toBe(true)
3540
expect(wrapper.find(TransitionGroupStub).exists()).toBe(true)
36-
expect(wrapper.find('tbody').is('tbody')).toBe(true)
37-
expect(wrapper.find('transition-group').is('tbody')).toBe(true)
41+
// Transition-group stub doesn't render itself with the specified tag
42+
expect(wrapper.find('tbody').exists()).toBe(false)
3843
})
3944

4045
it('tbody should be a transition-group component when tbody-transition-handlers set', async () => {
@@ -50,15 +55,13 @@ describe('table body transition', () => {
5055
}
5156
},
5257
stubs: {
53-
// the builtin stub doesn't really emulate transitio properly
54-
// so we let it use the real transition component
55-
'transition-group': false
58+
'transition-group': TransitionGroupStub
5659
}
5760
})
5861
expect(wrapper).toBeDefined()
5962
expect(wrapper.is('table')).toBe(true)
60-
expect(wrapper.find('tbody').exists()).toBe(true)
61-
expect(wrapper.find('transition-group').exists()).toBe(true)
62-
expect(wrapper.find('transition-group').is('tbody')).toBe(true)
63+
expect(wrapper.find(TransitionGroupStub).exists()).toBe(true)
64+
// Transition-group stub doesn't render itself with the specified tag
65+
expect(wrapper.find('tbody').exists()).toBe(false)
6366
})
6467
})

0 commit comments

Comments
 (0)