@@ -32,7 +32,7 @@ describe('WrapperArray', () => {
32
32
} )
33
33
34
34
const methods = [ 'at' , 'attributes' , 'classes' , 'contains' , 'emitted' , 'emittedByOrder' , 'hasAttribute' ,
35
- 'hasClass' , 'hasProp' , 'hasStyle' , 'find' , 'findAll' , 'html' , 'text' , 'is' , 'isEmpty' , 'isVueInstance' ,
35
+ 'hasClass' , 'hasProp' , 'hasStyle' , 'find' , 'findAll' , 'html' , 'text' , 'is' , 'isEmpty' , 'isVisible' , ' isVueInstance',
36
36
'name' , 'props' , 'setComputed' , 'setMethods' , 'setData' , 'setProps' , 'trigger' , 'update' , 'destroy' ]
37
37
methods . forEach ( ( method ) => {
38
38
it ( `throws error if ${ method } is called when there are no items in wrapper array` , ( ) => {
@@ -46,7 +46,7 @@ describe('WrapperArray', () => {
46
46
} )
47
47
48
48
it ( `${ method } throws error if called when there are items in wrapper array` , ( ) => {
49
- if ( [ 'at' , 'contains' , 'hasAttribute' , 'hasClass' , 'hasProp' , 'hasStyle' , 'is' , 'isEmpty' , 'isVueInstance' ,
49
+ if ( [ 'at' , 'contains' , 'hasAttribute' , 'hasClass' , 'hasProp' , 'hasStyle' , 'is' , 'isEmpty' , 'isVisible' , ' isVueInstance',
50
50
'setComputed' , 'setMethods' , 'setData' , 'setProps' , 'trigger' , 'update' , 'destroy' ] . includes ( method ) ) {
51
51
return
52
52
}
@@ -176,6 +176,16 @@ describe('WrapperArray', () => {
176
176
expect ( wrapperArray . isEmpty ( ) ) . to . equal ( false )
177
177
} )
178
178
179
+ it ( 'isVisible returns true if every wrapper.isVisible() returns true' , ( ) => {
180
+ const wrapperArray = getWrapperArray ( [ { isVisible : ( ) => true } , { isVisible : ( ) => true } ] )
181
+ expect ( wrapperArray . isVisible ( ) ) . to . equal ( true )
182
+ } )
183
+
184
+ it ( 'isVisible returns false if not every wrapper.isVisible() returns true' , ( ) => {
185
+ const wrapperArray = getWrapperArray ( [ { isVisible : ( ) => true } , { isVisible : ( ) => false } ] )
186
+ expect ( wrapperArray . isVisible ( ) ) . to . equal ( false )
187
+ } )
188
+
179
189
it ( 'isVueInstance returns true if every wrapper.isVueInstance() returns true' , ( ) => {
180
190
const wrapperArray = getWrapperArray ( [ { isVueInstance : ( ) => true } , { isVueInstance : ( ) => true } ] )
181
191
expect ( wrapperArray . isVueInstance ( ) ) . to . equal ( true )
0 commit comments