mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-29 17:44:42 +00:00
Fix some unit tests
This commit is contained in:
parent
5d0524a6bd
commit
8c2a882e64
2 changed files with 8 additions and 9 deletions
|
|
@ -1,6 +1,5 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "4"
|
||||
- "0.12"
|
||||
- "0.11"
|
||||
- "0.10"
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@
|
|||
});
|
||||
|
||||
test('fill-opacity attribute with fill attribute', function() {
|
||||
var el = fabric.document.createElement(rect);
|
||||
var el = fabric.document.createElement('rect');
|
||||
var opacityValue = Math.random().toFixed(2);
|
||||
|
||||
el.setAttribute('fill-opacity', opacityValue);
|
||||
|
|
@ -435,22 +435,22 @@
|
|||
var obj = fabric.Rect.fromElement(el);
|
||||
|
||||
equal(obj.fill, 'rgba(255,0,0,' + parseFloat(opacityValue) * 255 + ')',
|
||||
'opacity should be parsed correctly from "opacity" attribute of ' + tagNames[i] + ' element');
|
||||
'opacity should be parsed correctly from "opacity" attribute of rect element');
|
||||
});
|
||||
|
||||
test('fill-opacity attribute without fill attribute', function() {
|
||||
var el = fabric.document.createElement(rect);
|
||||
var el = fabric.document.createElement('rect');
|
||||
var opacityValue = Math.random().toFixed(2);
|
||||
|
||||
el.setAttribute('fill-opacity', opacityValue);
|
||||
var obj = fabric.Rect.fromElement(el);
|
||||
|
||||
equal(obj.fill, 'rgba(0,0,0,' + parseFloat(opacityValue) * 255 + ')',
|
||||
'opacity should be parsed correctly from "opacity" attribute of ' + tagNames[i] + ' element');
|
||||
'opacity should be parsed correctly from "opacity" attribute of rect element');
|
||||
});
|
||||
|
||||
test('stroke-opacity attribute with fill attribute', function() {
|
||||
var el = fabric.document.createElement(rect);
|
||||
var el = fabric.document.createElement('rect');
|
||||
var opacityValue = Math.random().toFixed(2);
|
||||
|
||||
el.setAttribute('fill-opacity', opacityValue);
|
||||
|
|
@ -458,18 +458,18 @@
|
|||
var obj = fabric.Rect.fromElement(el);
|
||||
|
||||
equal(obj.fill, 'rgba(255,0,0,' + parseFloat(opacityValue) * 255 + ')',
|
||||
'opacity should be parsed correctly from "opacity" attribute of ' + tagNames[i] + ' element');
|
||||
'opacity should be parsed correctly from "opacity" attribute of rect element');
|
||||
});
|
||||
|
||||
test('stroke-opacity attribute without fill attribute', function() {
|
||||
var el = fabric.document.createElement(rect);
|
||||
var el = fabric.document.createElement('rect');
|
||||
var opacityValue = Math.random().toFixed(2);
|
||||
|
||||
el.setAttribute('fill-opacity', opacityValue);
|
||||
var obj = fabric.Rect.fromElement(el);
|
||||
|
||||
equal(obj.fill, 'rgba(0,0,0,' + parseFloat(opacityValue) * 255 + ')',
|
||||
'opacity should be parsed correctly from "opacity" attribute of ' + tagNames[i] + ' element');
|
||||
'opacity should be parsed correctly from "opacity" attribute of rect element');
|
||||
});
|
||||
|
||||
test('getCssRule', function() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue