-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: getPointAtLength failed on an empty path * fix: add test case for antvis#634
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const expect = require('chai').expect; | ||
import Canvas from '../../../g-svg/src/canvas'; | ||
import Path from '../../../g-svg/src/shape/path'; | ||
|
||
const dom = document.createElement('div'); | ||
document.body.appendChild(dom); | ||
dom.id = 'c1'; | ||
|
||
describe('#634', () => { | ||
const canvas = new Canvas({ | ||
container: dom, | ||
width: 400, | ||
height: 400, | ||
}); | ||
|
||
it('should get null point on an empty path', () => { | ||
const path = new Path({ | ||
attrs: { | ||
path: [ | ||
['M', 0, 0], | ||
['L', 0, 0], | ||
], | ||
lineWidth: 1, | ||
stroke: 'red', | ||
}, | ||
}); | ||
canvas.add(path); | ||
expect(path.getPoint(0)).eqls(null); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--require source-map-support/register | ||
--recursive | ||
tests/unit | ||
tests/bugs |