From 65f915f1f3c878d97634ed360337d0ab2ea2d0d3 Mon Sep 17 00:00:00 2001 From: wout Date: Sun, 23 Jun 2013 15:32:20 +0100 Subject: Added `get()` method to SVG.Container --- spec/spec/container.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec') diff --git a/spec/spec/container.js b/spec/spec/container.js index 217e2e2..af07fd9 100644 --- a/spec/spec/container.js +++ b/spec/spec/container.js @@ -266,6 +266,19 @@ describe('Container', function() { expect(draw.viewbox().zoom).toEqual(100 / 50) }) }) + + describe('get()', function() { + it('gets an element at a given index', function() { + draw.clear() + var rect = draw.rect(100,100) + var circle = draw.circle(100) + var line = draw.line(0,0,100,100) + expect(draw.get(0)).toBe(rect) + expect(draw.get(1)).toBe(circle) + expect(draw.get(2)).toBe(line) + expect(draw.get(3)).toBe(undefined) + }) + }) }) -- cgit v1.2.3