summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2020-09-27 13:35:47 +1000
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2020-09-27 13:35:47 +1000
commit99e176f76332b47a6c026dbd9dcf7742191b8b29 (patch)
tree18fe3fbadb6fde0ca05b75ae09d7510de0a17ed0 /spec
parent3f78cb81973f9c6c9a0754a555c939e81d24a1ff (diff)
downloadsvg.js-99e176f76332b47a6c026dbd9dcf7742191b8b29.tar.gz
svg.js-99e176f76332b47a6c026dbd9dcf7742191b8b29.zip
fix `clone()` to return the correct instance (#1154)
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/elements/Dom.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/spec/elements/Dom.js b/spec/spec/elements/Dom.js
index 2e36c92..deb665a 100644
--- a/spec/spec/elements/Dom.js
+++ b/spec/spec/elements/Dom.js
@@ -172,6 +172,12 @@ describe('Dom.js', function () {
expect(clone.get(0).id()).not.toBe(rect.id())
expect(clone.id()).not.toBe(group.id())
})
+
+ it('returns an instance of the same class the method was called on', () => {
+ const rect = new Dom(create('rect'))
+ expect(rect.constructor).toBe(Dom)
+ expect(rect.clone().constructor).toBe(Dom)
+ })
})
describe('each()', () => {