Skip to content

Commit fae6fdc

Browse files
doz13189cexbrayat
authored andcommitted
test: add a test case for error wrapper
1 parent 38a0096 commit fae6fdc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/classes.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,18 @@ describe('classes', () => {
5555
expect(wrapper.classes('class-a')).toBe(true)
5656
expect(wrapper.classes('class-b')).toBe(false)
5757
})
58+
59+
it('throws an error if called on an empty wrapper', () => {
60+
const Component = defineComponent({
61+
render() {
62+
return h('div', { class: 'class-a' }, 'some text')
63+
}
64+
})
65+
66+
const wrapper = mount(Component)
67+
expect(() => wrapper.find('.class-c').classes()).toThrowError(
68+
'Cannot call classes on an empty DOMWrapper.'
69+
)
70+
})
5871
})
5972
})

0 commit comments

Comments
 (0)