Skip to content

Commit

Permalink
Update parser.js
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Jun 2, 2015
1 parent 3b460d9 commit 4523835
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/unit/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@
deepEqual(fabric.parseStyleAttribute(element), expectedObject);
});

test('parseStyleAttribute with trailing spaces', function() {
var element = fabric.document.createElement('path');
element.setAttribute('style', 'left:10px; top:5px; ');

var expectedObject = {
'left': 10,
'top': 5
};
deepEqual(fabric.parseStyleAttribute(element), expectedObject);
});

test('parseStyleAttribute with value normalization', function() {
var element = fabric.document.createElement('path');
element.setAttribute('style', 'fill:none; stroke-dasharray: 2 0.4;');
Expand Down

0 comments on commit 4523835

Please sign in to comment.