Add test for svg conversion

This commit is contained in:
Samy Pessé
2015-01-28 12:02:36 +01:00
parent 350f34561a
commit 924006d508
3 changed files with 19 additions and 0 deletions
+6
View File
@@ -12,4 +12,10 @@ describe('eBook Generator', function () {
assert(fs.existsSync(path.join(output, "SUMMARY.html")));
}, done);
});
it('should correctly convert svg images to png', function(done) {
testGeneration(books[4], "ebook", function(output) {
assert(fs.existsSync(path.join(output, "test.png")));
}, done);
});
});
+2
View File
@@ -1,3 +1,5 @@
# Other Title
A description
![test image to be converted](./test.svg)
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
<svg version="1.1" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
<title id="test-title">basic SVG tiny doc</title>
<g id="test-body-content">
<text font-family="Arial" font-size="14" text-anchor="middle" x="225" y="25">hello world</text>
</g>
<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">Revision: 1.1</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</svg>

After

Width:  |  Height:  |  Size: 709 B