Skip to content

Commit 1c0033e

Browse files
committed
update test
1 parent 6c41bb0 commit 1c0033e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/class.test.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,11 @@ a1.63 1.63 0 0 0 -0.906 0.274a1.63 1.63 0 0 0 -0.601 0.73a1.63 1.63 0 0 0 -0.094
222222
});
223223

224224
it('Test getBBox arcs', async () => {
225-
const path = new SVGPathCommander('M77.7553 122.1843A15.6631 5.5 45 0 1 92.7199 129.3707L100.7729 137.4237A15.6631 5.5 45 0 1 92.9947 145.2019L84.9417 137.1489A15.6631 5.5 45 0 1 77.7553 122.1843').getBBox();
226-
expect(path, 'Using the SVGPathCommander').to.deep.equal({cx: 92.85730493191977, cy: 137.28630493191974, cz: 47.294968430086385, height: 31.529978953390895, width: 31.529978953390938, x: 77.09231545522431, x2: 108.62229440861525, y: 121.52131545522431, y2: 153.0512944086152});
225+
// https://github.com/thednp/svg-path-commander/issues/47
226+
const path1 = new SVGPathCommander('M77.7553 122.1843A15.6631 5.5 45 0 1 92.7199 129.3707L100.7729 137.4237A15.6631 5.5 45 0 1 92.9947 145.2019L84.9417 137.1489A15.6631 5.5 45 0 1 77.7553 122.1843').getBBox();
227+
expect(path1, 'Using the SVGPathCommander').to.deep.equal({cx: 92.85730493191977, cy: 137.28630493191974, cz: 47.294968430086385, height: 31.529978953390895, width: 31.529978953390938, x: 77.09231545522431, x2: 108.62229440861525, y: 121.52131545522431, y2: 153.0512944086152});
228+
const path2 = new SVGPathCommander('M3 7L13 7m-20 10l10 0V27H23v10h10C33 43 38 47 43 47c0 5 5 10 10 10S63 67 63 67s-10 10 10 10Q50 50 73 57q20 -5 0 -10T70 40t0 -15A5 10 45 1 0 40 20a5 5 20 0 1 -10 -10Z').getBBox();
229+
expect(path2, 'Using the SVGPathCommander').to.deep.equal({ width: 90, height: 75.27596299546647, x: -7, y: 1.7240370045335283, x2: 83, y2: 77, cx: 38, cy: 39.362018502266764, cz: 127.63798149773324});
227230
});
228231

229232
it('Test getTotalLength', () => {

0 commit comments

Comments
 (0)