@@ -23,13 +23,37 @@ describe('WrapperArray', () => {
23
23
expect ( ( ) => wrapperArray . find ( ) ) . to . throw ( ) . with . property ( 'message' , message )
24
24
} )
25
25
26
- it ( 'findAll throws error if wrapper is not empty' , ( ) => {
26
+ it ( 'emitted throws error if wrapper is not empty' , ( ) => {
27
+ const wrapperArray = new WrapperArray ( [ ] )
28
+ const message = '[vue-test-utils]: emitted cannot be called on 0 items'
29
+ expect ( ( ) => wrapperArray . emitted ( ) ) . to . throw ( ) . with . property ( 'message' , message )
30
+ } )
31
+
32
+ it ( 'emitted throws error if wrapper is empty' , ( ) => {
33
+ const wrapperArray = new WrapperArray ( [ 1 , 2 , 3 ] )
34
+ const message = '[vue-test-utils]: emitted must be called on a single wrapper, use at(i) to access a wrapper'
35
+ expect ( ( ) => wrapperArray . emitted ( ) ) . to . throw ( ) . with . property ( 'message' , message )
36
+ } )
37
+
38
+ it ( 'emittedByOrder throws error if wrapper is not empty' , ( ) => {
39
+ const wrapperArray = new WrapperArray ( [ ] )
40
+ const message = '[vue-test-utils]: emittedByOrder cannot be called on 0 items'
41
+ expect ( ( ) => wrapperArray . emittedByOrder ( ) ) . to . throw ( ) . with . property ( 'message' , message )
42
+ } )
43
+
44
+ it ( 'emittedByOrder throws error if wrapper is empty' , ( ) => {
45
+ const wrapperArray = new WrapperArray ( [ 1 , 2 , 3 ] )
46
+ const message = '[vue-test-utils]: emittedByOrder must be called on a single wrapper, use at(i) to access a wrapper'
47
+ expect ( ( ) => wrapperArray . emittedByOrder ( ) ) . to . throw ( ) . with . property ( 'message' , message )
48
+ } )
49
+
50
+ it ( 'findAll throws error if wrapper is empty' , ( ) => {
27
51
const wrapperArray = new WrapperArray ( [ ] )
28
52
const message = '[vue-test-utils]: findAll cannot be called on 0 items'
29
53
expect ( ( ) => wrapperArray . findAll ( ) ) . to . throw ( ) . with . property ( 'message' , message )
30
54
} )
31
55
32
- it ( 'findAll throws error if wrapper is empty' , ( ) => {
56
+ it ( 'findAll throws error if wrapper is not empty' , ( ) => {
33
57
const wrapperArray = new WrapperArray ( [ 1 , 2 , 3 ] )
34
58
const message = '[vue-test-utils]: findAll must be called on a single wrapper, use at(i) to access a wrapper'
35
59
expect ( ( ) => wrapperArray . findAll ( ) ) . to . throw ( ) . with . property ( 'message' , message )
0 commit comments