diff --git a/test/core/Graphics.js b/test/core/Graphics.js index 020ecaf..c7c7a45 100644 --- a/test/core/Graphics.js +++ b/test/core/Graphics.js @@ -103,4 +103,29 @@ expect(graphics.height).to.be.equals(70); }); }); + + describe('containsPoint', () => + { + it('should return true when point inside', () => + { + const point = new PIXI.Point(1, 1); + const graphics = new PIXI.Graphics(); + + graphics.beginFill(0); + graphics.drawRect(0, 0, 10, 10); + + expect(graphics.containsPoint(point)).to.be.true; + }); + + it('should return false when point outside', () => + { + const point = new PIXI.Point(20, 20); + const graphics = new PIXI.Graphics(); + + graphics.beginFill(0); + graphics.drawRect(0, 0, 10, 10); + + expect(graphics.containsPoint(point)).to.be.false; + }); + }); });