Skip to content

Commit

Permalink
fix: add test case for #634
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoiver committed Oct 26, 2020
1 parent 392a5cd commit 8dc95b1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/g-svg/tests/bugs/issue-634-spec.js
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);
});
});
1 change: 1 addition & 0 deletions packages/g-svg/tests/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--require source-map-support/register
--recursive
tests/unit
tests/bugs

0 comments on commit 8dc95b1

Please sign in to comment.