|
|
@@ -225,20 +225,20 @@ describe( 'Node', () => {
|
|
|
expect( textBA.getAncestors() ).to.deep.equal( [ root, two ] );
|
|
|
} );
|
|
|
|
|
|
- it( 'should include itself if includeNode option is set to true', () => {
|
|
|
- expect( root.getAncestors( { includeNode: true } ) ).to.deep.equal( [ root ] );
|
|
|
- expect( two.getAncestors( { includeNode: true } ) ).to.deep.equal( [ root, two ] );
|
|
|
- expect( textBA.getAncestors( { includeNode: true } ) ).to.deep.equal( [ root, two, textBA ] );
|
|
|
- expect( img.getAncestors( { includeNode: true } ) ).to.deep.equal( [ root, two, img ] );
|
|
|
- expect( textR.getAncestors( { includeNode: true } ) ).to.deep.equal( [ root, two, textR ] );
|
|
|
+ it( 'should include itself if includeSelf option is set to true', () => {
|
|
|
+ expect( root.getAncestors( { includeSelf: true } ) ).to.deep.equal( [ root ] );
|
|
|
+ expect( two.getAncestors( { includeSelf: true } ) ).to.deep.equal( [ root, two ] );
|
|
|
+ expect( textBA.getAncestors( { includeSelf: true } ) ).to.deep.equal( [ root, two, textBA ] );
|
|
|
+ expect( img.getAncestors( { includeSelf: true } ) ).to.deep.equal( [ root, two, img ] );
|
|
|
+ expect( textR.getAncestors( { includeSelf: true } ) ).to.deep.equal( [ root, two, textR ] );
|
|
|
} );
|
|
|
|
|
|
it( 'should reverse order if parentFirst option is set to true', () => {
|
|
|
- expect( root.getAncestors( { includeNode: true, parentFirst: true } ) ).to.deep.equal( [ root ] );
|
|
|
- expect( two.getAncestors( { includeNode: true, parentFirst: true } ) ).to.deep.equal( [ two, root ] );
|
|
|
- expect( textBA.getAncestors( { includeNode: true, parentFirst: true } ) ).to.deep.equal( [ textBA, two, root ] );
|
|
|
- expect( img.getAncestors( { includeNode: true, parentFirst: true } ) ).to.deep.equal( [ img, two, root ] );
|
|
|
- expect( textR.getAncestors( { includeNode: true, parentFirst: true } ) ).to.deep.equal( [ textR, two, root ] );
|
|
|
+ expect( root.getAncestors( { includeSelf: true, parentFirst: true } ) ).to.deep.equal( [ root ] );
|
|
|
+ expect( two.getAncestors( { includeSelf: true, parentFirst: true } ) ).to.deep.equal( [ two, root ] );
|
|
|
+ expect( textBA.getAncestors( { includeSelf: true, parentFirst: true } ) ).to.deep.equal( [ textBA, two, root ] );
|
|
|
+ expect( img.getAncestors( { includeSelf: true, parentFirst: true } ) ).to.deep.equal( [ img, two, root ] );
|
|
|
+ expect( textR.getAncestors( { includeSelf: true, parentFirst: true } ) ).to.deep.equal( [ textR, two, root ] );
|
|
|
} );
|
|
|
} );
|
|
|
|