aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-06-21 18:25:29 +0200
committerwout <wout@impinc.co.uk>2014-06-21 18:25:29 +0200
commit19b6fd4338246d1fd9ca4806e57c7aebcec63826 (patch)
tree3dd1d207de9f586f7e4d4cd36917e347ab022a9e /spec
parentbb0e6be2da0cea98c5303871c0be055f5f70d7a9 (diff)
downloadsvg.js-19b6fd4338246d1fd9ca4806e57c7aebcec63826.tar.gz
svg.js-19b6fd4338246d1fd9ca4806e57c7aebcec63826.zip
Removed all structural references
Diffstat (limited to 'spec')
-rwxr-xr-xspec/spec/clip.js10
-rwxr-xr-xspec/spec/container.js10
-rwxr-xr-xspec/spec/doc.js2
-rwxr-xr-xspec/spec/element.js8
-rwxr-xr-xspec/spec/hyperlink.js6
-rw-r--r--spec/spec/marker.js2
-rwxr-xr-xspec/spec/mask.js8
-rw-r--r--spec/spec/symbol.js2
8 files changed, 27 insertions, 21 deletions
diff --git a/spec/spec/clip.js b/spec/spec/clip.js
index fb673f0..eba8df4 100755
--- a/spec/spec/clip.js
+++ b/spec/spec/clip.js
@@ -11,20 +11,20 @@ describe('ClipPath', function() {
draw.clear()
})
- it('moves the masking element to a new clip node', function() {
- expect(circle.parent instanceof SVG.Clip).toBe(true)
+ it('moves the clipping element to a new clip node', function() {
+ expect(circle.parent() instanceof SVG.ClipPath).toBe(true)
})
it('creates the clip node in the defs node', function() {
- expect(circle.parent.parent).toBe(draw.defs())
+ expect(circle.parent().parent()).toBe(draw.defs())
})
it('sets the "clip-path" attribute on the cliped element with the clip id', function() {
- expect(rect.attr('clip-path')).toBe('url("#' + circle.parent.attr('id') + '")')
+ expect(rect.attr('clip-path')).toBe('url("#' + circle.parent().attr('id') + '")')
})
it('references the clip element in the masked element', function() {
- expect(rect.clipper).toBe(circle.parent)
+ expect(rect.clipper).toBe(circle.parent())
})
it('references the clipped element in the clipPath target list', function() {
diff --git a/spec/spec/container.js b/spec/spec/container.js
index f72ec17..3fa0867 100755
--- a/spec/spec/container.js
+++ b/spec/spec/container.js
@@ -210,11 +210,11 @@ describe('Container', function() {
draw.clear()
expect(draw.children().length).toBe(0)
})
- it('keeps the defs node', function() {
+ it('creates a new defs node', function() {
var oldDefs = draw.defs()
draw.rect(100,100).maskWith(draw.circle(100, 100))
draw.clear()
- expect(draw.defs()).toBe(oldDefs)
+ expect(draw.defs()).not.toBe(oldDefs)
})
it('clears all children in the defs node', function() {
draw.rect(100,100).maskWith(draw.circle(100, 100))
@@ -336,6 +336,12 @@ describe('Container', function() {
})
})
+ describe('parent()', function() {
+ it('returns th parent element instance', function() {
+ var rect = draw.rect(100,100)
+ expect(rect.parent()).toBe(rect.node.parentNode.instance)
+ })
+ })
})
diff --git a/spec/spec/doc.js b/spec/spec/doc.js
index 4312678..ba9fecc 100755
--- a/spec/spec/doc.js
+++ b/spec/spec/doc.js
@@ -13,7 +13,7 @@ describe('Doc', function() {
expect(draw.defs()).toBe(draw._defs)
})
it('references parent node', function(){
- expect(draw.defs().parent).toBe(draw)
+ expect(draw.defs().parent()).toBe(draw)
})
})
diff --git a/spec/spec/element.js b/spec/spec/element.js
index 5bda0d2..f0f5c5d 100755
--- a/spec/spec/element.js
+++ b/spec/spec/element.js
@@ -227,7 +227,7 @@ describe('Element', function() {
, group = draw.group()
expect(rect.addTo(group)).toBe(rect)
- expect(rect.parent).toBe(group)
+ expect(rect.parent()).toBe(group)
})
})
@@ -237,7 +237,7 @@ describe('Element', function() {
, group = draw.group()
expect(rect.putIn(group)).toBe(group)
- expect(rect.parent).toBe(group)
+ expect(rect.parent()).toBe(group)
})
})
@@ -278,12 +278,12 @@ describe('Element', function() {
describe('parent', function() {
it('contains the parent svg', function() {
var rect = draw.rect(100,100)
- expect(rect.parent).toBe(draw)
+ expect(rect.parent()).toBe(draw)
})
it('contains the parent group when in a group', function() {
var group = draw.group()
, rect = group.rect(100,100)
- expect(rect.parent).toBe(group)
+ expect(rect.parent()).toBe(group)
})
})
diff --git a/spec/spec/hyperlink.js b/spec/spec/hyperlink.js
index 3fe78f8..affef6d 100755
--- a/spec/spec/hyperlink.js
+++ b/spec/spec/hyperlink.js
@@ -46,14 +46,14 @@ describe('Hyperlink', function() {
describe('linkTo()', function() {
it('wraps the called element in a link with given url', function() {
element.linkTo(url)
- expect(element.parent.attr('href')).toBe(url)
+ expect(element.parent().attr('href')).toBe(url)
})
it('wraps the called element in a link with given block', function() {
element.linkTo(function(link) {
link.to(url).target('_blank')
})
- expect(element.parent.attr('href')).toBe(url)
- expect(element.parent.attr('target')).toBe('_blank')
+ expect(element.parent().attr('href')).toBe(url)
+ expect(element.parent().attr('target')).toBe('_blank')
})
})
})
diff --git a/spec/spec/marker.js b/spec/spec/marker.js
index 8d18c85..ef1ea10 100644
--- a/spec/spec/marker.js
+++ b/spec/spec/marker.js
@@ -16,7 +16,7 @@ describe('Marker', function() {
})
it('creates marker in defs', function() {
- expect(marker.parent instanceof SVG.Defs).toBeTruthy()
+ expect(marker.parent() instanceof SVG.Defs).toBeTruthy()
})
describe('marker()', function() {
diff --git a/spec/spec/mask.js b/spec/spec/mask.js
index a13d842..ab367a0 100755
--- a/spec/spec/mask.js
+++ b/spec/spec/mask.js
@@ -12,19 +12,19 @@ describe('Mask', function() {
})
it('moves the masking element to a new mask node', function() {
- expect(circle.parent instanceof SVG.Mask).toBe(true)
+ expect(circle.parent() instanceof SVG.Mask).toBe(true)
})
it('creates the mask node in the defs node', function() {
- expect(circle.parent.parent).toBe(draw.defs())
+ expect(circle.parent().parent()).toBe(draw.defs())
})
it('sets the "mask" attribute on the masked element with the mask id', function() {
- expect(rect.attr('mask')).toBe('url("#' + circle.parent.attr('id') + '")')
+ expect(rect.attr('mask')).toBe('url("#' + circle.parent().attr('id') + '")')
})
it('references the mask element in the masked element', function() {
- expect(rect.masker).toBe(circle.parent)
+ expect(rect.masker).toBe(circle.parent())
})
it('references the masked element in the mask target list', function() {
diff --git a/spec/spec/symbol.js b/spec/spec/symbol.js
index 39a48db..a8e7b04 100644
--- a/spec/spec/symbol.js
+++ b/spec/spec/symbol.js
@@ -10,7 +10,7 @@ describe('Symbol', function() {
})
it('creates symbol in defs', function() {
- expect(symbol.parent instanceof SVG.Defs).toBeTruthy()
+ expect(symbol.parent() instanceof SVG.Defs).toBeTruthy()
})
}) \ No newline at end of file