introduce break test (#4102)

This commit is contained in:
Andrea Bogazzi 2017-07-15 13:21:59 +02:00 committed by GitHub
parent 9e076bdcca
commit 392e21312b
2 changed files with 10 additions and 1 deletions

View file

@ -280,7 +280,7 @@
filtered = true;
markup.push(
'<g transform="', this.getSvgTransform(), this.getSvgTransformMatrix(), '">\n',
'<image ', this.getSvgId(), 'xlink:href="', this.getSvgSrc(filtered),
'\t<image ', this.getSvgId(), 'xlink:href="', this.getSvgSrc(filtered),
'" x="', x, '" y="', y,
'" style="', this.getSvgStyles(),
// we're essentially moving origin of transformation from top/left corner to the center of the shape

View file

@ -204,6 +204,15 @@
});
});
asyncTest('toSVG', function() {
createImageObject(function(image) {
ok(typeof image.toSVG === 'function');
var expectedSVG = '<g transform="translate(138 55)">\n\t<image xlink:href="' + IMG_SRC + '" x="-138" y="-55" style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" width="276" height="110"></image>\n</g>';
equal(image.toSVG(), expectedSVG);
start();
});
});
asyncTest('getSrc', function() {
createImageObject(function(image) {
ok(typeof image.getSrc == 'function');