diff --git a/test/unit/color.js b/test/unit/color.js index 145b8c35fb2..aea5ef8693e 100644 --- a/test/unit/color.js +++ b/test/unit/color.js @@ -303,7 +303,18 @@ assert.equal(oColor.toHex(), '180637'); assert.equal(oColor.getAlpha(), 0.2, 'alpha should be set properly'); }); - + + QUnit.test('fromHsla (with decimals)', function(assert) { + assert.ok(typeof fabric.Color.fromHsla === 'function'); + var originalHsla = 'hsla(262.33,80.333%,12.4444%,0.5)'; + var oColor = fabric.Color.fromHsla(originalHsla); + assert.ok(oColor); + assert.ok(oColor instanceof fabric.Color); + assert.equal(oColor.toHsla(), originalHsla); + assert.equal(oColor.toHex(), '180637'); + assert.equal(oColor.getAlpha(), 0.5, 'alpha should be set properly'); + }); + QUnit.test('fromHsla (with whitespaces)', function(assert) { assert.ok(typeof fabric.Color.fromHsla === 'function'); var originalHsla = 'hsla( 262 , 80% , 12% , 0.2 )';