]>
git.proxmox.com Git - extjs.git/blob - extjs/packages/charts/test/specs/draw/sprite/Path.js
1 describe("Ext.draw.sprite.Path", function () {
3 describe("hitTest", function () {
4 var sprite
, surface
, container
;
6 beforeEach(function () {
7 container
= new Ext
.draw
.Container();
8 surface
= new Ext
.draw
.Surface();
9 sprite
= new Ext
.draw
.sprite
.Circle({
21 container
.add(surface
);
24 afterEach(function () {
25 Ext
.destroy(sprite
, surface
, container
);
28 it("should return an object with the 'sprite' property set to the sprite itself, " +
29 "if the sprite is visible and its bounding box and path are hit", function () {
30 var result
= sprite
.hitTest([90, 90]);
31 expect(result
&& result
.sprite
).toBe(sprite
);
34 it("should return null, if the sprite is visible, its bounding box is hit, but the path isn't", function () {
35 var result
= sprite
.hitTest([10, 10]);
36 expect(result
).toBe(null);