diff --git a/test/core/Container.js b/test/core/Container.js index 8a10b40..c8fe618 100644 --- a/test/core/Container.js +++ b/test/core/Container.js @@ -70,6 +70,21 @@ expect(spy).to.have.been.called; expect(spy).to.have.been.calledWith(0); }); + + it('should flag transform for recalculation', function () + { + const container = new PIXI.Container(); + + container.getBounds(); + + const parentID = container.transform._parentID; + const boundsID = container._boundsID; + + container.addChild(new PIXI.Container()); + + expect(parentID).to.not.be.equals(container.transform._parentID); + expect(boundsID).to.not.be.equals(container._boundsID); + }); }); describe('removeChildAt', function () @@ -95,6 +110,22 @@ expect(spy).to.have.been.called; expect(spy).to.have.been.calledWith(0); }); + + it('should flag transform for recalculation', function () + { + const container = new PIXI.Container(); + + container.addChild(new PIXI.Container()); + container.getBounds(); + + const parentID = container.transform._parentID; + const boundsID = container._boundsID; + + container.removeChildAt(0); + + expect(parentID).to.not.be.equals(container.transform._parentID); + expect(boundsID).to.not.be.equals(container._boundsID); + }); }); describe('addChildAt', function () @@ -157,6 +188,18 @@ expect(spy).to.have.been.called; expect(spy).to.have.been.calledWith(0); }); + + it('should flag transform for recalculation', function () + { + const container = new PIXI.Container(); + const parentID = container.transform._parentID; + const boundsID = container._boundsID; + + container.addChildAt(new PIXI.Container(), 0); + + expect(parentID).to.not.be.equals(container.transform._parentID); + expect(boundsID).to.not.be.equals(container._boundsID); + }); }); describe('removeChild', function () @@ -202,6 +245,23 @@ expect(spy).to.have.been.called; expect(spy).to.have.been.calledWith(0); }); + + it('should flag transform for recalculation', function () + { + const container = new PIXI.Container(); + const child = new PIXI.Container(); + + container.addChild(child); + container.getBounds(); + + const parentID = container.transform._parentID; + const boundsID = container._boundsID; + + container.removeChild(child); + + expect(parentID).to.not.be.equals(container.transform._parentID); + expect(boundsID).to.not.be.equals(container._boundsID); + }); }); describe('getChildIndex', function () @@ -475,6 +535,22 @@ expect(() => container.removeChildren(-1, 1)) .to.throw('removeChildren: numeric values are outside the acceptable range.'); }); + + it('should flag transform for recalculation', function () + { + const container = new PIXI.Container(); + + container.addChild(new PIXI.Container()); + container.getBounds(); + + const parentID = container.transform._parentID; + const boundsID = container._boundsID; + + container.removeChildren(); + + expect(parentID).to.not.be.equals(container.transform._parentID); + expect(boundsID).to.not.be.equals(container._boundsID); + }); }); describe('destroy', function ()