diff --git a/test/unit/parser.js b/test/unit/parser.js index aec9f96a..9c62f04e 100644 --- a/test/unit/parser.js +++ b/test/unit/parser.js @@ -364,7 +364,8 @@ styleElement = doc.createElement('style'); styleElement.textContent = 'g polygon.cls, rect {fill:#FF0000; stroke:#000000;stroke-width:0.25px;}\ polygon.cls {fill:none;stroke:#0000FF;}', - doc.body.appendChild(styleElement); + doc.body.appendChild(styleElement), + svgUid = 'uniqueId'; var expectedObject = { 'g polygon.cls': { @@ -383,8 +384,8 @@ } } - fabric.cssRules = fabric.getCSSRules(doc); - deepEqual(fabric.cssRules, expectedObject); + fabric.cssRules[svgUid] = fabric.getCSSRules(doc); + deepEqual(fabric.cssRules[svgUid], expectedObject); var elPolygon = fabric.document.createElement('polygon'), expectedStyle = { @@ -394,6 +395,7 @@ elPolygon.setAttribute('points', '10,12 20,22'); elPolygon.setAttribute('class', 'cls'); + elPolygon.setAttribute('svgUid', svgUid); var style = fabric.parseAttributes(elPolygon, [ ]); deepEqual(style, expectedStyle);