mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -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;
|
||||
// Set named arguments at the end, since some depend on geometry to be
|
||||
// defined (e.g. #clockwise)
|
||||
return path.set(props, {insert: true});
|
||||
return path.set(props, { insert: true });
|
||||
}
|
||||
|
||||
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 } }');
|
||||
});
|
||||
|
||||
test('new Path.Line({insert: false, from:[50, 50], to:[100, 100]})', function() {
|
||||
var path = new Path.Line({insert: false, from:[50, 50], to:[100, 100]});
|
||||
equals(path.insert === false, false);
|
||||
test('new Path.Line({ insert: false })', function() {
|
||||
var path = new Path.Line({
|
||||
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