@@ -32,7 +32,7 @@ describe('WrapperArray', () => {
3232 } )
3333
3434 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',
3636 'name' , 'props' , 'setComputed' , 'setMethods' , 'setData' , 'setProps' , 'trigger' , 'update' , 'destroy' ]
3737 methods . forEach ( ( method ) => {
3838 it ( `throws error if ${ method } is called when there are no items in wrapper array` , ( ) => {
@@ -46,7 +46,7 @@ describe('WrapperArray', () => {
4646 } )
4747
4848 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',
5050 'setComputed' , 'setMethods' , 'setData' , 'setProps' , 'trigger' , 'update' , 'destroy' ] . includes ( method ) ) {
5151 return
5252 }
@@ -176,6 +176,16 @@ describe('WrapperArray', () => {
176176 expect ( wrapperArray . isEmpty ( ) ) . to . equal ( false )
177177 } )
178178
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+
179189 it ( 'isVueInstance returns true if every wrapper.isVueInstance() returns true' , ( ) => {
180190 const wrapperArray = getWrapperArray ( [ { isVueInstance : ( ) => true } , { isVueInstance : ( ) => true } ] )
181191 expect ( wrapperArray . isVueInstance ( ) ) . to . equal ( true )
0 commit comments