Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add tests for color.fill and color.stroke
  • Loading branch information
mdtusz committed Apr 20, 2016
commit 97dc3993fa92c23862e6b78c4107d6840b320f92
2 changes: 1 addition & 1 deletion src/snapshot/tosvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module.exports = function toSVG(gd, format) {
}
}

// remove draglayer (it's invisible anyways!)
// remove draglayer for Adobe Illustrator compatibility
if(fullLayout._draggers) {
fullLayout._draggers.node().remove();
}
Expand Down
30 changes: 30 additions & 0 deletions test/jasmine/tests/color_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,34 @@ describe('Test color:', function() {
expect(container2).toEqual(expectedContainer2);
});
});

describe('fill', function() {

it('should call style with both fill and fill-opacity', function() {
var mockElement = {
style: function(object) {
expect(object.fill).toBe('rgb(255, 255, 0)');
expect(object['fill-opacity']).toBe(0.5);
}
};

Color.fill(mockElement, 'rgba(255,255,0,0.5');
});

});

describe('stroke', function() {

it('should call style with both fill and fill-opacity', function() {
var mockElement = {
style: function(object) {
expect(object.stroke).toBe('rgb(255, 255, 0)');
expect(object['stroke-opacity']).toBe(0.5);
}
};

Color.stroke(mockElement, 'rgba(255,255,0,0.5');
});

});
});