diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-12 13:59:07 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-12 13:59:07 +0100 |
commit | 334d9c73c2f74679a93b1d7b3e39b614f6444faa (patch) | |
tree | 75e7da40f8a1af67854816f1aa65b199b0733387 /spec | |
parent | b9f5c216c6eb75f3a00c6b121da5a72885286fa0 (diff) | |
download | svg.js-334d9c73c2f74679a93b1d7b3e39b614f6444faa.tar.gz svg.js-334d9c73c2f74679a93b1d7b3e39b614f6444faa.zip |
reworked parents so that it is useful now, changelog
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/element.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/spec/element.js b/spec/spec/element.js index 1cb754e..b36ea82 100644 --- a/spec/spec/element.js +++ b/spec/spec/element.js @@ -651,15 +651,16 @@ describe('Element', function() { }) describe('parents()', function() { - it('returns array of parent up to but not including the dom element filtered by type', function() { + it('returns array of parents until the passed element or document', function() { var group1 = draw.group().addClass('test') , group2 = group1.group() - , rect = group2.rect(100,100) + , group3 = group2.group() + , rect = group3.rect(100,100) - expect(rect.parents('.test')[0]).toBe(group1) - expect(rect.parents(SVG.G)[0]).toBe(group2) - expect(rect.parents(SVG.G)[1]).toBe(group1) - expect(rect.parents().length).toBe(3) + expect(rect.parents('.test')[0]).toBe(group3) + expect(rect.parents('.test')[1]).toBe(group2) + expect(rect.parents(group2)[0]).toBe(group3) + expect(rect.parents(group1).length).toBe(2) }) }) |