-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
127 additions
and
10 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
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
Binary file modified
BIN
-2.8 KB
(82%)
...test/components/axis/__image_snapshots__/axis-test-tsx-axis-轴-grid样式-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
-358 Bytes
(97%)
...st/components/line/__image_snapshots__/line-test-tsx-折线图-对比折线图-虚实线对比-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.05 KB
(96%)
.../components/line/__image_snapshots__/radar-test-tsx-雷达图-面积雷达图-面积雷达图图-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-16.7 KB
(52%)
...components/point/__image_snapshots__/point-test-tsx-point-chart-基础点图-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-11.3 KB
(47%)
...onents/point/__image_snapshots__/point-test-tsx-point-chart-基础点图-极坐标-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.25 KB
...components/point/__image_snapshots__/shape-test-tsx-shape-类型-default-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.48 KB
...ents/point/__image_snapshots__/shape-test-tsx-shape-类型-hollow-circle-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.21 KB
...st/components/point/__image_snapshots__/shape-test-tsx-shape-类型-rect-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,86 @@ | ||
import { jsx } from '../../../src'; | ||
import { Canvas, Chart, Point, Axis } from '../../../src'; | ||
import { createContext, delay } from '../../util'; | ||
|
||
const data = [ | ||
{ | ||
day: '周一', | ||
value: 300, | ||
}, | ||
{ | ||
day: '周二', | ||
value: 400, | ||
}, | ||
{ | ||
day: '周三', | ||
value: 350, | ||
}, | ||
{ | ||
day: '周四', | ||
value: 500, | ||
}, | ||
{ | ||
day: '周五', | ||
value: 490, | ||
}, | ||
{ | ||
day: '周六', | ||
value: 600, | ||
}, | ||
{ | ||
day: '周日', | ||
value: 900, | ||
}, | ||
]; | ||
|
||
describe('shape 类型', () => { | ||
it('default', async () => { | ||
const context = createContext('default'); | ||
const { props } = ( | ||
<Canvas context={context} pixelRatio={1} animate={false}> | ||
<Chart data={data}> | ||
<Point x="day" y="value" /> | ||
</Chart> | ||
</Canvas> | ||
); | ||
|
||
const canvas = new Canvas(props); | ||
canvas.render(); | ||
|
||
await delay(100); | ||
expect(context).toMatchImageSnapshot(); | ||
}); | ||
it('hollowCircle', async () => { | ||
const context = createContext('hollowCircle'); | ||
const { props } = ( | ||
<Canvas context={context} pixelRatio={1} animate={false}> | ||
<Chart data={data}> | ||
<Point x="day" y="value" shape="hollowCircle" /> | ||
</Chart> | ||
</Canvas> | ||
); | ||
|
||
const canvas = new Canvas(props); | ||
canvas.render(); | ||
|
||
await delay(100); | ||
expect(context).toMatchImageSnapshot(); | ||
}); | ||
|
||
it('rect', async () => { | ||
const context = createContext('rect'); | ||
const { props } = ( | ||
<Canvas context={context} pixelRatio={1} animate={false}> | ||
<Chart data={data}> | ||
<Point x="day" y="value" shape="rect" /> | ||
</Chart> | ||
</Canvas> | ||
); | ||
|
||
const canvas = new Canvas(props); | ||
canvas.render(); | ||
|
||
await delay(100); | ||
expect(context).toMatchImageSnapshot(); | ||
}); | ||
}); |