From 993afe3c83f579f898f180d8cd75fe9dff60d16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 12 Mar 2017 11:11:14 +0100 Subject: [PATCH] Tests: Implement unit tests for #1277 --- test/tests/Style.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/tests/Style.js b/test/tests/Style.js index 19dd5a49..b0d84183 100644 --- a/test/tests/Style.js +++ b/test/tests/Style.js @@ -57,24 +57,38 @@ test('setting Project#currentStyle to an object', function() { test('setting Path#style to an object', function() { var path = new Path(); + path.strokeWidth = 10; path.style = { fillColor: 'red', strokeColor: 'green' }; equals(path.fillColor, new Color('red'), 'path.fillColor'); equals(path.strokeColor, new Color('green'), 'path.strokeColor'); + equals(path.strokeWidth, 10, + 'path.strokeWidth, set outside object should not be cleared'); + equals(path.style.fillColor, new Color('red'), 'path.style.fillColor'); + equals(path.style.strokeColor, new Color('green'), 'path.style.strokeColor'); + equals(path.style.strokeWidth, 10, + 'path.style.strokeWidth, set outside object should not be cleared'); }); test('setting Group#style to an object', function() { var group = new Group(); var path = new Path(); group.addChild(path); + group.strokeWidth = 10; group.style = { fillColor: 'red', strokeColor: 'green' }; equals(path.fillColor, new Color('red'), 'path.fillColor'); equals(path.strokeColor, new Color('green'), 'path.strokeColor'); + equals(path.strokeWidth, 10, + 'path.strokeWidth, set outside object should not be cleared'); + equals(path.style.fillColor, new Color('red'), 'path.style.fillColor'); + equals(path.style.strokeColor, new Color('green'), 'path.style.strokeColor'); + equals(path.style.strokeWidth, 10, + 'path.style.strokeWidth, set outside object should not be cleared'); }); test('getting Group#fillColor', function() {