Fixes tests for rects

This commit is contained in:
Andrea Bogazzi 2014-08-05 13:19:53 +02:00
parent 78a5221143
commit 0538fe68c9

View file

@ -27,8 +27,6 @@
'clipTo': null,
'rx': 0,
'ry': 0,
'x': 0,
'y': 0
};
QUnit.module('fabric.Rect');
@ -99,8 +97,8 @@
ok(rectWithAttrs instanceof fabric.Rect);
var expectedObject = fabric.util.object.extend(REFERENCE_RECT, {
left: 121,
top: 186.5,
left: 10,
top: 20,
width: 222,
height: 333,
fill: 'rgb(255,255,255)',
@ -112,9 +110,7 @@
strokeLineJoin: 'bevil',
strokeMiterLimit: 5,
rx: 11,
ry: 12,
x: 10,
y: 20
ry: 12
});
deepEqual(rectWithAttrs.toObject(), expectedObject);
});
@ -135,7 +131,7 @@
var rect = new fabric.Rect({ width: 100, height: 100, rx: 20, ry: 30 });
var svg = rect.toSVG();
equal(svg, '<rect x="-50" y="-50" rx="20" ry="30" width="100" height="100" style="stroke: none; stroke-width: 1; stroke-dasharray: ; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); opacity: 1;" transform="translate(50 50)"/>');
equal(svg, '<rect x="-50" y="-50" rx="20" ry="30" width="100" height="100" style="stroke: none; stroke-width: 1; stroke-dasharray: ; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: source-over; opacity: 1;" transform="translate(50 50)"/>\n');
});
test('toObject without default values', function() {