@@ -23,13 +23,37 @@ describe('WrapperArray', () => {
2323 expect ( ( ) => wrapperArray . find ( ) ) . to . throw ( ) . with . property ( 'message' , message )
2424 } )
2525
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' , ( ) => {
2751 const wrapperArray = new WrapperArray ( [ ] )
2852 const message = '[vue-test-utils]: findAll cannot be called on 0 items'
2953 expect ( ( ) => wrapperArray . findAll ( ) ) . to . throw ( ) . with . property ( 'message' , message )
3054 } )
3155
32- it ( 'findAll throws error if wrapper is empty' , ( ) => {
56+ it ( 'findAll throws error if wrapper is not empty' , ( ) => {
3357 const wrapperArray = new WrapperArray ( [ 1 , 2 , 3 ] )
3458 const message = '[vue-test-utils]: findAll must be called on a single wrapper, use at(i) to access a wrapper'
3559 expect ( ( ) => wrapperArray . findAll ( ) ) . to . throw ( ) . with . property ( 'message' , message )
0 commit comments