diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-10-25 22:50:52 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-10-25 22:50:52 +0100 |
commit | f72c867e7e3da9d8939ab67afaddee0755678ba4 (patch) | |
tree | a2a0eb636ef9543334f2d7cfb6cec9ac0cce4622 /spec | |
parent | 78e492ca461ccba1ca57eb2362be02280ef232ac (diff) | |
download | svg.js-f72c867e7e3da9d8939ab67afaddee0755678ba4.tar.gz svg.js-f72c867e7e3da9d8939ab67afaddee0755678ba4.zip |
added support for css selectors with the `parent()` method
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec/element.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/spec/element.js b/spec/spec/element.js index 813ec9b..ea95748 100644 --- a/spec/spec/element.js +++ b/spec/spec/element.js @@ -390,6 +390,17 @@ describe('Element', function() { , rect = group.rect(100,100) expect(rect.parent()).toBe(group) }) + it('contains the parent which matches type', function() { + var group = draw.group() + , rect = group.rect(100,100) + expect(rect.parent(SVG.Doc)).toBe(draw) + }) + it('contains the parent which matches selector', function() { + var group1 = draw.group().addClass('test') + , group2 = group1.group() + , rect = group2.rect(100,100) + expect(rect.parent('.test')).toBe(group1) + }) }) describe('clone()', function() { |