File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ export class MockNode {
103103 return null ;
104104 }
105105
106+ contains ( otherNode : MockNode ) {
107+ return this . childNodes . includes ( otherNode ) ;
108+ }
109+
106110 removeChild ( childNode : MockNode ) {
107111 const index = this . childNodes . indexOf ( childNode ) ;
108112 if ( index > - 1 ) {
Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ describe('element', () => {
1111 const elmParent = document . createElement ( 'div' ) ;
1212 const elmChild = document . createElement ( 'div' ) ;
1313 elmParent . appendChild ( elmChild ) ;
14+ expect ( document . body . contains ( elmParent ) ) . toBe ( false ) ;
1415 document . body . appendChild ( elmParent ) ;
16+ expect ( document . body . contains ( elmParent ) ) . toBe ( true ) ;
1517 expect ( elmParent . isConnected ) . toBe ( true ) ;
1618 expect ( elmChild . isConnected ) . toBe ( true ) ;
1719 expect ( document . body . isConnected ) . toBe ( true ) ;
You can’t perform that action at this time.
0 commit comments