From 1bcabca97d56f2f8cd94010f1284c4eb2cc2cb8a Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Thu, 9 Mar 2017 12:30:02 +0100 Subject: fixed a bug with clone which didnt copy over dom data (#621) --- spec/spec/element.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'spec') 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() { -- cgit v1.2.3