From f72c867e7e3da9d8939ab67afaddee0755678ba4 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sun, 25 Oct 2015 22:50:52 +0100 Subject: added support for css selectors with the `parent()` method --- spec/spec/element.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'spec') 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() { -- cgit v1.2.3