mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Improve unit test for new Path.Constructor({ insert: false })
This commit is contained in:
parent
c3333cc500
commit
2290ec0ff6
2 changed files with 16 additions and 4 deletions
|
@ -28,7 +28,7 @@ Path.inject({ statics: new function() {
|
||||||
path._closed = closed;
|
path._closed = closed;
|
||||||
// Set named arguments at the end, since some depend on geometry to be
|
// Set named arguments at the end, since some depend on geometry to be
|
||||||
// defined (e.g. #clockwise)
|
// defined (e.g. #clockwise)
|
||||||
return path.set(props, {insert: true});
|
return path.set(props, { insert: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
function createEllipse(center, radius, args) {
|
function createEllipse(center, radius, args) {
|
||||||
|
|
|
@ -131,7 +131,19 @@ test('new Path.Line({ from: from, to: to })', function() {
|
||||||
equals(path.segments.toString(), '{ point: { x: 20, y: 20 } },{ point: { x: 40, y: 40 } }');
|
equals(path.segments.toString(), '{ point: { x: 20, y: 20 } },{ point: { x: 40, y: 40 } }');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('new Path.Line({insert: false, from:[50, 50], to:[100, 100]})', function() {
|
test('new Path.Line({ insert: false })', function() {
|
||||||
var path = new Path.Line({insert: false, from:[50, 50], to:[100, 100]});
|
var path = new Path.Line({
|
||||||
equals(path.insert === false, false);
|
from:[50, 50],
|
||||||
|
to:[100, 100],
|
||||||
|
insert: false
|
||||||
|
});
|
||||||
|
equals(function() {
|
||||||
|
return typeof path.insert;
|
||||||
|
}, 'function');
|
||||||
|
equals(function() {
|
||||||
|
return path.parent;
|
||||||
|
}, null);
|
||||||
|
equals(function() {
|
||||||
|
return path.isInserted();
|
||||||
|
}, false);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue