From d52a6f31074858ae6978ee872b5296b4241eb781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 15 Mar 2016 19:13:16 +0100 Subject: [PATCH] SVG Import: Add more tests. One currently failing. --- test/assets/arcs.svg | 62 ++++++++++++ test/assets/butterfly.svg | 204 ++++++++++++++++++++++++++++++++++++++ test/tests/SvgImport.js | 17 +++- 3 files changed, 279 insertions(+), 4 deletions(-) create mode 100644 test/assets/arcs.svg create mode 100644 test/assets/butterfly.svg diff --git a/test/assets/arcs.svg b/test/assets/arcs.svg new file mode 100644 index 00000000..d85fa4c4 --- /dev/null +++ b/test/assets/arcs.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + Arc start + Arc end + + + + + + + + + + large-arc-flag=0 + sweep-flag=0 + + + + + large-arc-flag=0 + sweep-flag=1 + + + + + large-arc-flag=1 + sweep-flag=0 + + + + + large-arc-flag=1 + sweep-flag=1 + + + + + + + diff --git a/test/assets/butterfly.svg b/test/assets/butterfly.svg new file mode 100644 index 00000000..4e7b65b5 --- /dev/null +++ b/test/assets/butterfly.svg @@ -0,0 +1,204 @@ + + + + + \ No newline at end of file diff --git a/test/tests/SvgImport.js b/test/tests/SvgImport.js index 4bc6abed..df86f021 100644 --- a/test/tests/SvgImport.js +++ b/test/tests/SvgImport.js @@ -157,14 +157,23 @@ function importSVG(assert, url, message, options) { if (!isNode) { // JSDom does not have SVG rendering, so we can't test there. - var svgFiles = ['viewbox', 'clipping', 'symbol', 'symbols', 'blendModes', 'gradients-1']; + var svgFiles = { + 'butterfly': {}, + 'viewbox': {}, + 'clipping': {}, + 'arcs': { tolerance: 1e-3 }, + 'symbol': {}, + 'symbols': {}, + 'blendModes': {}, + 'gradients-1': {} + }; // TODO: Investigate why Phantom struggles with this file: if (!isPhantom) - svgFiles.push('gradients-2'); - svgFiles.forEach(function(name) { + svgFiles['gradients-2'] = {}; + Base.each(svgFiles, function(options, name) { name += '.svg'; test('Import ' + name, function(assert) { - importSVG(assert, 'assets/' + name); + importSVG(assert, 'assets/' + name, null, options); }); });