summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-03-09 12:30:02 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-03-09 12:30:02 +0100
commit1bcabca97d56f2f8cd94010f1284c4eb2cc2cb8a (patch)
tree290051c5d3144e42386235c501e9b6579cbe5e49 /spec
parent9479d18674745cbf4bfb44e0fdbb0eab3c5bfe06 (diff)
downloadsvg.js-1bcabca97d56f2f8cd94010f1284c4eb2cc2cb8a.tar.gz
svg.js-1bcabca97d56f2f8cd94010f1284c4eb2cc2cb8a.zip
fixed a bug with clone which didnt copy over dom data (#621)
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/element.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/spec/element.js b/spec/spec/element.js
index 98d5211..e20d69e 100644
--- a/spec/spec/element.js
+++ b/spec/spec/element.js
@@ -669,11 +669,18 @@ describe('Element', function() {
clone = rect.clone()
expect(rect.next()).toBe(clone)
})
- it('inserts the clone in the specided parent', function() {
+ it('inserts the clone in the specified parent', function() {
var g = draw.group()
clone = rect.clone(g)
expect(g.get(0)).toBe(clone)
})
+ it('deep copies over dom data', function() {
+ group.dom = {'foo':'bar'}
+ rect.dom = {'foo':'baz'}
+ clone = group.clone()
+ expect(clone.dom.foo).toBe('bar')
+ expect(clone.get(0).dom.foo).toBe('baz')
+ })
})
describe('toString()', function() {