File tree Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -142,29 +142,26 @@ export class ElementAssertion extends Assertion<ReactTestInstance> {
142142 message : `Expected element ${ this . toString ( ) } NOT to contain element ${ instanceToString ( element ) } .` ,
143143 } ) ;
144144
145- const isElementContained = (
146- parentElement : ReactTestInstance ,
147- childElement : ReactTestInstance ,
148- ) : boolean => {
149- if ( parentElement === null || childElement === null ) {
150- return false ;
151- }
152-
153- return (
154- parentElement . findAll (
155- node =>
156- node . type === childElement . type && node . props === childElement . props ,
157- ) . length > 0
158- ) ;
159- } ;
160-
161145 return this . execute ( {
162- assertWhen : isElementContained ( this . actual , element ) ,
146+ assertWhen : this . isElementContained ( this . actual , element ) ,
163147 error,
164148 invertedError,
165149 } ) ;
166150 }
167151
152+ private isElementContained ( parentElement : ReactTestInstance , childElement : ReactTestInstance ) : boolean {
153+ if ( parentElement === null || childElement === null ) {
154+ return false ;
155+ }
156+
157+ return (
158+ parentElement . findAll (
159+ node =>
160+ node . type === childElement . type && node . props === childElement . props ,
161+ ) . length > 0
162+ ) ;
163+ }
164+
168165 private isElementDisabled ( element : ReactTestInstance ) : boolean {
169166 const { type } = element ;
170167 const elementType = type . toString ( ) ;
You can’t perform that action at this time.
0 commit comments