mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Add messages to all PathStyle tests.
This commit is contained in:
parent
d9f96b9a7a
commit
51b2cf287d
1 changed files with 22 additions and 22 deletions
|
@ -4,12 +4,12 @@ test('currentStyle', function() {
|
||||||
var doc = new Document();
|
var doc = new Document();
|
||||||
doc.currentStyle.fillColor = 'black';
|
doc.currentStyle.fillColor = 'black';
|
||||||
var path = new Path();
|
var path = new Path();
|
||||||
compareRGBColors(path.fillColor, 'black');
|
compareRGBColors(path.fillColor, 'black', 'path.fillColor');
|
||||||
|
|
||||||
// When changing the current style of the document, the style of
|
// When changing the current style of the document, the style of
|
||||||
// paths created using document.currentStyle should not change.
|
// paths created using document.currentStyle should not change.
|
||||||
doc.currentStyle.fillColor = 'red';
|
doc.currentStyle.fillColor = 'red';
|
||||||
compareRGBColors(path.fillColor, 'black');
|
compareRGBColors(path.fillColor, 'black', 'path.fillColor');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('setting currentStyle to an object', function() {
|
test('setting currentStyle to an object', function() {
|
||||||
|
@ -19,8 +19,8 @@ test('setting currentStyle to an object', function() {
|
||||||
strokeColor: 'green'
|
strokeColor: 'green'
|
||||||
};
|
};
|
||||||
var path = new Path();
|
var path = new Path();
|
||||||
compareRGBColors(path.fillColor, 'red');
|
compareRGBColors(path.fillColor, 'red', 'path.fillColor');
|
||||||
compareRGBColors(path.strokeColor, 'green');
|
compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('setting path styles to an object', function() {
|
test('setting path styles to an object', function() {
|
||||||
|
@ -30,8 +30,8 @@ test('setting path styles to an object', function() {
|
||||||
fillColor: 'red',
|
fillColor: 'red',
|
||||||
strokeColor: 'green'
|
strokeColor: 'green'
|
||||||
};
|
};
|
||||||
compareRGBColors(path.fillColor, 'red');
|
compareRGBColors(path.fillColor, 'red', 'path.fillColor');
|
||||||
compareRGBColors(path.strokeColor, 'green');
|
compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('setting group styles to an object', function() {
|
test('setting group styles to an object', function() {
|
||||||
|
@ -43,8 +43,8 @@ test('setting group styles to an object', function() {
|
||||||
fillColor: 'red',
|
fillColor: 'red',
|
||||||
strokeColor: 'green'
|
strokeColor: 'green'
|
||||||
};
|
};
|
||||||
compareRGBColors(path.fillColor, 'red');
|
compareRGBColors(path.fillColor, 'red', 'path.fillColor');
|
||||||
compareRGBColors(path.strokeColor, 'green');
|
compareRGBColors(path.strokeColor, 'green', 'path.strokeColor');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('getting group styles', function() {
|
test('getting group styles', function() {
|
||||||
|
@ -54,7 +54,7 @@ test('getting group styles', function() {
|
||||||
path.fillColor = 'red';
|
path.fillColor = 'red';
|
||||||
group.appendTop(path);
|
group.appendTop(path);
|
||||||
|
|
||||||
compareRGBColors(group.fillColor, 'red');
|
compareRGBColors(group.fillColor, 'red', 'group.fillColor');
|
||||||
|
|
||||||
var secondPath = new Path();
|
var secondPath = new Path();
|
||||||
secondPath.fillColor = 'black';
|
secondPath.fillColor = 'black';
|
||||||
|
@ -62,11 +62,11 @@ test('getting group styles', function() {
|
||||||
|
|
||||||
// the group now contains two paths with different fillColors and therefore
|
// the group now contains two paths with different fillColors and therefore
|
||||||
// should return null:
|
// should return null:
|
||||||
equals(group.fillColor, null);
|
equals(group.fillColor, null, 'group.fillColor');
|
||||||
|
|
||||||
//If we remove the first path, it should now return 'black':
|
//If we remove the first path, it should now return 'black':
|
||||||
group.children[0].remove();
|
group.children[0].remove();
|
||||||
compareRGBColors(group.fillColor, 'black');
|
compareRGBColors(group.fillColor, 'black', 'group.fillColor');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('setting group styles', function() {
|
test('setting group styles', function() {
|
||||||
|
@ -86,11 +86,11 @@ test('setting group styles', function() {
|
||||||
|
|
||||||
// the paths contained in the group should now both have their fillColor
|
// the paths contained in the group should now both have their fillColor
|
||||||
// set to black:
|
// set to black:
|
||||||
compareRGBColors(path.fillColor, 'black');
|
compareRGBColors(path.fillColor, 'black', 'path.fillColor');
|
||||||
compareRGBColors(secondPath.fillColor, 'black');
|
compareRGBColors(secondPath.fillColor, 'black', 'secondPath.fillColor');
|
||||||
|
|
||||||
// The second path still has its strokeColor set to red:
|
// The second path still has its strokeColor set to red:
|
||||||
compareRGBColors(secondPath.strokeColor, 'red');
|
compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('setting group styles 2', function() {
|
test('setting group styles 2', function() {
|
||||||
|
@ -100,31 +100,31 @@ test('setting group styles 2', function() {
|
||||||
path.fillColor = 'red';
|
path.fillColor = 'red';
|
||||||
group.appendTop(path);
|
group.appendTop(path);
|
||||||
|
|
||||||
compareRGBColors(group.fillColor, 'red');
|
compareRGBColors(group.fillColor, 'red', 'group.fillColor');
|
||||||
|
|
||||||
var secondPath = new Path();
|
var secondPath = new Path();
|
||||||
secondPath.fillColor = 'blue';
|
secondPath.fillColor = 'blue';
|
||||||
secondPath.strokeColor = 'red';
|
secondPath.strokeColor = 'red';
|
||||||
group.appendTop(secondPath);
|
group.appendTop(secondPath);
|
||||||
|
|
||||||
compareRGBColors(secondPath.fillColor, 'blue');
|
compareRGBColors(secondPath.fillColor, 'blue', 'secondPath.fillColor');
|
||||||
compareRGBColors(secondPath.strokeColor, 'red');
|
compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');
|
||||||
|
|
||||||
// By appending a path with a different fillcolor,
|
// By appending a path with a different fillcolor,
|
||||||
// the group's fillColor should return null:
|
// the group's fillColor should return null:
|
||||||
equals(group.fillColor, null);
|
equals(group.fillColor, null, 'group.fillColor');
|
||||||
|
|
||||||
// But, both paths have a red strokeColor, so:
|
// But, both paths have a red strokeColor, so:
|
||||||
compareRGBColors(group.strokeColor, 'red');
|
compareRGBColors(group.strokeColor, 'red', 'group.strokeColor');
|
||||||
|
|
||||||
// Change the fill color of the group's style:
|
// Change the fill color of the group's style:
|
||||||
group.style.fillColor = 'black';
|
group.style.fillColor = 'black';
|
||||||
|
|
||||||
// the paths contained in the group should now both have their fillColor
|
// the paths contained in the group should now both have their fillColor
|
||||||
// set to black:
|
// set to black:
|
||||||
compareRGBColors(path.fillColor, 'black');
|
compareRGBColors(path.fillColor, 'black', 'path.fillColor');
|
||||||
compareRGBColors(secondPath.fillColor, 'black');
|
compareRGBColors(secondPath.fillColor, 'black', 'secondPath.fillColor');
|
||||||
|
|
||||||
// The second path still has its strokeColor set to red:
|
// The second path still has its strokeColor set to red:
|
||||||
compareRGBColors(secondPath.strokeColor, 'red');
|
compareRGBColors(secondPath.strokeColor, 'red', 'secondPath.strokeColor');
|
||||||
});
|
});
|
Loading…
Reference in a new issue