summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-10-25 22:50:52 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2015-10-25 22:50:52 +0100
commitf72c867e7e3da9d8939ab67afaddee0755678ba4 (patch)
treea2a0eb636ef9543334f2d7cfb6cec9ac0cce4622 /spec
parent78e492ca461ccba1ca57eb2362be02280ef232ac (diff)
downloadsvg.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.js11
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() {