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 @@ -169,29 +169,26 @@ export class ElementAssertion extends Assertion<ReactTestInstance> {
169169 message : `Expected element ${ this . toString ( ) } NOT to contain element ${ instanceToString ( element ) } .` ,
170170 } ) ;
171171
172- const isElementContained = (
173- parentElement : ReactTestInstance ,
174- childElement : ReactTestInstance ,
175- ) : boolean => {
176- if ( parentElement === null || childElement === null ) {
177- return false ;
178- }
179-
180- return (
181- parentElement . findAll (
182- node =>
183- node . type === childElement . type && node . props === childElement . props ,
184- ) . length > 0
185- ) ;
186- } ;
187-
188172 return this . execute ( {
189- assertWhen : isElementContained ( this . actual , element ) ,
173+ assertWhen : this . isElementContained ( this . actual , element ) ,
190174 error,
191175 invertedError,
192176 } ) ;
193177 }
194178
179+ private isElementContained ( parentElement : ReactTestInstance , childElement : ReactTestInstance ) : boolean {
180+ if ( parentElement === null || childElement === null ) {
181+ return false ;
182+ }
183+
184+ return (
185+ parentElement . findAll (
186+ node =>
187+ node . type === childElement . type && node . props === childElement . props ,
188+ ) . length > 0
189+ ) ;
190+ }
191+
195192 private isElementDisabled ( element : ReactTestInstance ) : boolean {
196193 const { type } = element ;
197194 const elementType = type . toString ( ) ;
You can’t perform that action at this time.
0 commit comments