summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-06-23 15:32:20 +0100
committerwout <wout@impinc.co.uk>2013-06-23 15:32:20 +0100
commit65f915f1f3c878d97634ed360337d0ab2ea2d0d3 (patch)
tree5459c3fc8a0f43f14a5fea19f0aa82336b985073 /spec
parent9841728efbe16219a1c412951841a06ee98ff6ec (diff)
downloadsvg.js-65f915f1f3c878d97634ed360337d0ab2ea2d0d3.tar.gz
svg.js-65f915f1f3c878d97634ed360337d0ab2ea2d0d3.zip
Added `get()` method to SVG.Container
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/container.js13
1 files changed, 13 insertions, 0 deletions
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)
+ })
+ })
})