From 2290ec0ff6713752b6a02da09c7556bc1a28a782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 10 Apr 2017 09:30:52 +0200 Subject: [PATCH] Improve unit test for new Path.Constructor({ insert: false }) --- src/path/Path.Constructors.js | 2 +- test/tests/Path_Constructors.js | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/path/Path.Constructors.js b/src/path/Path.Constructors.js index 2098639d..3cc23b9d 100644 --- a/src/path/Path.Constructors.js +++ b/src/path/Path.Constructors.js @@ -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) { diff --git a/test/tests/Path_Constructors.js b/test/tests/Path_Constructors.js index e355b12f..220f0ca4 100644 --- a/test/tests/Path_Constructors.js +++ b/test/tests/Path_Constructors.js @@ -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); });