Adding test for Path#closePath

This commit is contained in:
Jeff Avallone 2018-02-18 15:52:26 -05:00
parent 45b652d9af
commit 9716e166df
1 changed files with 9 additions and 0 deletions

View File

@ -27,4 +27,13 @@ describe('Path', () => {
expect(path.toString()).toEqual(str);
})
));
test('path resetting with closePath', () => {
const path = new Path()
.moveTo({ x: 5, y: 5 })
.lineTo({ x: 5, y: 5, relative: true })
.closePath()
.lineTo({ x: 5, y: 5 });
expect(path.toString()).toEqual('M5,5l5,5Z'); // Last lineTo is ignored since it goes nowhere
});
});