diff --git a/test/core/Sprite.js b/test/core/Sprite.js index 2a3d301..b14419d 100755 --- a/test/core/Sprite.js +++ b/test/core/Sprite.js @@ -62,7 +62,7 @@ }); }); - describe('getBounds()', function () + describe('getBounds', function () { it('must have correct value according to texture size, width, height and anchor', function () { @@ -88,4 +88,25 @@ expect(bounds.height).to.equal(600); }); }); + + describe('containsPoint', function () + { + it('should return true when point inside', function () + { + const point = new PIXI.Point(10, 10); + const texture = new PIXI.RenderTexture.create(20, 30); + const sprite = new PIXI.Sprite(texture); + + expect(sprite.containsPoint(point)).to.be.true; + }); + + it('should return false when point outside', function () + { + const point = new PIXI.Point(100, 100); + const texture = new PIXI.RenderTexture.create(20, 30); + const sprite = new PIXI.Sprite(texture); + + expect(sprite.containsPoint(point)).to.be.false; + }); + }); });