Adding test for Path#closePath
This commit is contained in:
parent
45b652d9af
commit
9716e166df
@ -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
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user