forked from vuejs/vue-test-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverview.spec.js
24 lines (20 loc) · 912 Bytes
/
overview.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { describeWithShallowAndMount } from '~resources/utils'
import { compileToFunctions } from 'vue-template-compiler'
import '@vue/test-utils'
describeWithShallowAndMount('overview', mountingMethod => {
it('throws error if wrapper array contains no items', () => {
const wrapper = mountingMethod(compileToFunctions('<div />'))
const message = '[vue-test-utils]: overview() cannot be called on 0 items'
expect(() => wrapper.findAll('p').overview())
.to.throw()
.with.property('message', message)
})
it('throws error when called on a WrapperArray', () => {
const wrapper = mountingMethod(compileToFunctions('<div><div /></div>'))
const message =
'[vue-test-utils]: overview() must be called on a single wrapper, use at(i) to access a wrapper'
expect(() => wrapper.findAll('div').overview())
.to.throw()
.with.property('message', message)
})
})