Improve unit test for new Path.Constructor({ insert: false })

This commit is contained in:
Jürg Lehni 2017-04-10 09:30:52 +02:00
parent c3333cc500
commit 2290ec0ff6
2 changed files with 16 additions and 4 deletions

View file

@ -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) {

View file

@ -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);
});