From: wout Date: Sat, 21 Jun 2014 20:30:49 +0000 (+0200) Subject: Speccing adopter module X-Git-Tag: 2.0.0-rc.1~64 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c168777a82c9dd81af36cb7f7d4948c148403ea0;p=svg.js.git Speccing adopter module --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 06e4d5c..2454b6b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - added support to clone manually built text elements -> __TODO!__ - using `CustomEvent` instead of `Event` to be able to fire events with a `detail` object [thanks @Fuzzyma] - added polyfill for IE9 and IE10 custom events [thanks @Fuzzyma] -- added DOM query selector with the `select()` method on parent elements +- added DOM query selector with the `select()` method globally or on parent elements # 1.0.0-rc.9 (17/06/2014) diff --git a/dist/svg.js b/dist/svg.js index deafcfb..70f1693 100755 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,4 +1,4 @@ -/* svg.js 1.0.0-rc.10-8-g0bb294a - svg inventor adopter regex utilities default color array pointarray patharray number viewbox bbox rbox element parent container fx relative event defs group arrange mask clip gradient pattern doc spof shape symbol use rect ellipse line poly path image text textpath nested hyperlink marker sugar set data memory selector loader helpers polyfill - svgjs.com/license */ +/* svg.js 1.0.0-rc.10-9-g1953dbc - svg inventor adopter regex utilities default color array pointarray patharray number viewbox bbox rbox element parent container fx relative event defs group arrange mask clip gradient pattern doc spof shape symbol use rect ellipse line poly path image text textpath nested hyperlink marker sugar set data memory selector loader helpers polyfill - svgjs.com/license */ ;(function() { var SVG = this.SVG = function(element) { diff --git a/spec/index.html b/spec/index.html index 2dd41b2..7932214 100755 --- a/spec/index.html +++ b/spec/index.html @@ -19,6 +19,22 @@ + + + + + + + + + + + + A + B + C + + @@ -30,6 +46,7 @@ + diff --git a/spec/spec/adopter.js b/spec/spec/adopter.js new file mode 100644 index 0000000..efdb806 --- /dev/null +++ b/spec/spec/adopter.js @@ -0,0 +1,21 @@ +describe('Adopter', function() { + var path + + beforeEach(function() { + path = SVG.get('lineAB') + }) + + it('adopts an exiting path element', function() { + expect(path instanceof SVG.Path).toBe(true) + }) + + it('modifies an adopted element', function() { + path.fill('#f06') + expect(path.node.getAttribute('fill')).toBe('#ff0066') + }) + + it('adopts a parent when parent() method is called', function() { + expect(path.parent() instanceof SVG.Doc).toBe(true) + }) + +}) \ No newline at end of file