Skip to content

Commit ce3b461

Browse files
committed
fix: update test
1 parent f782762 commit ce3b461

File tree

6 files changed

+157
-246
lines changed

6 files changed

+157
-246
lines changed

example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@expo/webpack-config": "~19.0.1",
1313
"@shopify/react-native-skia": "1.2.3",
1414
"echarts": "^5.5.0",
15-
"expo": "~51.0.26",
15+
"expo": "~51.0.28",
1616
"react": "18.2.0",
1717
"react-dom": "18.2.0",
1818
"react-native": "0.74.5",

example/yarn.lock

+26-24
Original file line numberDiff line numberDiff line change
@@ -774,10 +774,10 @@
774774
mv "~2"
775775
safe-json-stringify "~1"
776776

777-
"@expo/cli@0.18.28":
778-
version "0.18.28"
779-
resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.18.28.tgz#eb49cbde4a3c9bdb24cc8f041dba425f93f3526e"
780-
integrity sha512-fvbVPId6s6etindzP6Nzos/CS1NurMVy4JKozjebArHr63tBid5i/UY5Pp+4wTCAM20gB2SjRdwcwoL6HFC4Iw==
777+
"@expo/cli@0.18.29":
778+
version "0.18.29"
779+
resolved "https://registry.yarnpkg.com/@expo/cli/-/cli-0.18.29.tgz#108682e28ccf3beab34938501d6dfc079683b82c"
780+
integrity sha512-X810C48Ss+67RdZU39YEO1khNYo1RmjouRV+vVe0QhMoTe8R6OA3t+XYEdwaNbJ5p/DJN7szfHfNmX2glpC7xg==
781781
dependencies:
782782
"@babel/runtime" "^7.20.0"
783783
"@expo/code-signing-certificates" "0.0.5"
@@ -2459,10 +2459,10 @@ babel-plugin-transform-flow-enums@^0.0.2:
24592459
dependencies:
24602460
"@babel/plugin-syntax-flow" "^7.12.1"
24612461

2462-
babel-preset-expo@~11.0.13:
2463-
version "11.0.13"
2464-
resolved "https://registry.yarnpkg.com/babel-preset-expo/-/babel-preset-expo-11.0.13.tgz#ccf349ca244a67a2ee57b6b57bd6468e9c892d71"
2465-
integrity sha512-5oUXyxnIVyDUhG4a306PpT2c9HhKx0tG4LXjpSIA/dERzwGvU8LUxDSD6yCohhRSsPZIoR7u2mnH0PypqFqYnQ==
2462+
babel-preset-expo@~11.0.14:
2463+
version "11.0.14"
2464+
resolved "https://registry.yarnpkg.com/babel-preset-expo/-/babel-preset-expo-11.0.14.tgz#ca0884e82d89e49cd216ad3497e3d7ad93657d51"
2465+
integrity sha512-4BVYR0Sc2sSNxYTiE/OLSnPiOp+weFNy8eV+hX3aD6YAIbBnw+VubKRWqJV/sOJauzOLz0SgYAYyFciYMqizRA==
24662466
dependencies:
24672467
"@babel/plugin-proposal-decorators" "^7.12.9"
24682468
"@babel/plugin-transform-export-namespace-from" "^7.22.11"
@@ -3880,21 +3880,23 @@ expo-keep-awake@~13.0.2:
38803880
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-13.0.2.tgz#5ef31311a339671eec9921b934fdd90ab9652b0e"
38813881
integrity sha512-kKiwkVg/bY0AJ5q1Pxnm/GvpeB6hbNJhcFsoOWDh2NlpibhCLaHL826KHUM+WsnJRbVRxJ+K9vbPRHEMvFpVyw==
38823882

3883-
expo-modules-autolinking@1.11.1:
3884-
version "1.11.1"
3885-
resolved "https://registry.yarnpkg.com/expo-modules-autolinking/-/expo-modules-autolinking-1.11.1.tgz#4a867f727d9dfde07de8dde14b333a3cbf82ce3c"
3886-
integrity sha512-2dy3lTz76adOl7QUvbreMCrXyzUiF8lygI7iFJLjgIQIVH+43KnFWE5zBumpPbkiaq0f0uaFpN9U0RGQbnKiMw==
3883+
expo-modules-autolinking@1.11.2:
3884+
version "1.11.2"
3885+
resolved "https://registry.yarnpkg.com/expo-modules-autolinking/-/expo-modules-autolinking-1.11.2.tgz#98245eb66f157bbfebebd2d576256ea7c683c605"
3886+
integrity sha512-fdcaNO8ucHA3yLNY52ZUENBcAG7KEx8QyMmnVNavO1JVBGRMZG8JyVcbrhYQDtVtpxkbai5YzwvLutINvbDZDQ==
38873887
dependencies:
38883888
chalk "^4.1.0"
38893889
commander "^7.2.0"
38903890
fast-glob "^3.2.5"
38913891
find-up "^5.0.0"
38923892
fs-extra "^9.1.0"
3893+
require-from-string "^2.0.2"
3894+
resolve-from "^5.0.0"
38933895

3894-
expo-modules-core@1.12.20:
3895-
version "1.12.20"
3896-
resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.12.20.tgz#072dea10791f32ea5d1d3b15a7d5fd1984173429"
3897-
integrity sha512-CCXjlgT8lDAufgt912P1W7TwD+KAylfIttc1Doh1a0hAfkdkUsDRmrgthnYrrxEo2ECVpbaB71Epp1bnZ1rRrA==
3896+
expo-modules-core@1.12.21:
3897+
version "1.12.21"
3898+
resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.12.21.tgz#8014fa549af3c1c00b14fd84a26ef921b39207fb"
3899+
integrity sha512-UQxRljqPcowS1+bECW9tnuVGfvWL18GAKPiKMnu9sZwJssAN9FU/JhED50DJzdzICLR0hL17FZAgV4rbMG3IWQ==
38983900
dependencies:
38993901
invariant "^2.2.4"
39003902

@@ -3908,24 +3910,24 @@ expo-pwa@0.0.127:
39083910
commander "2.20.0"
39093911
update-check "1.5.3"
39103912

3911-
expo@~51.0.26:
3912-
version "51.0.26"
3913-
resolved "https://registry.yarnpkg.com/expo/-/expo-51.0.26.tgz#a19b891f8d1f1e7639dc375fa69a152ab6f4843a"
3914-
integrity sha512-7ThQa6CVbiVtk4GNw0E9CewSzXYOeHkcRTCGorBZVcjAu6SuxbdWEtl0RI01/VpRKV+6I+yy/BmGnCl7lFRILg==
3913+
expo@~51.0.28:
3914+
version "51.0.28"
3915+
resolved "https://registry.yarnpkg.com/expo/-/expo-51.0.28.tgz#d60cbe6803e29f0c09ba3681462f91e13bc849ef"
3916+
integrity sha512-R+0tSV0Zf5R+DxN4W3mLFlVvYVpiJ+dtYrMmBedIRw0A54we50QRM1jS0Gq2Bdzg2JtainSEApdQXUC6r9j/BA==
39153917
dependencies:
39163918
"@babel/runtime" "^7.20.0"
3917-
"@expo/cli" "0.18.28"
3919+
"@expo/cli" "0.18.29"
39183920
"@expo/config" "9.0.3"
39193921
"@expo/config-plugins" "8.0.8"
39203922
"@expo/metro-config" "0.18.11"
39213923
"@expo/vector-icons" "^14.0.0"
3922-
babel-preset-expo "~11.0.13"
3924+
babel-preset-expo "~11.0.14"
39233925
expo-asset "~10.0.10"
39243926
expo-file-system "~17.0.1"
39253927
expo-font "~12.0.9"
39263928
expo-keep-awake "~13.0.2"
3927-
expo-modules-autolinking "1.11.1"
3928-
expo-modules-core "1.12.20"
3929+
expo-modules-autolinking "1.11.2"
3930+
expo-modules-core "1.12.21"
39293931
fbemitter "^3.0.0"
39303932
whatwg-url-without-unicode "8.0.0-3"
39313933

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"react-native-svg": "15.2.0",
8181
"react-test-renderer": "^18.3.1",
8282
"release-it": "^17.2.1",
83-
"sharp": "^0.33.3",
83+
"sharp": "^0.33.5",
8484
"typescript": "^5.0.4",
8585
"zrender": "^5.5.0"
8686
},

src/__tests__/__snapshots__/index.test.tsx.snap

+18-95
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`SkiaChart Component does not render Canvas when svgString is not provided 1`] = `null`;
4-
53
exports[`SkiaChart Component does not render GestureHandler when handleGesture is false 1`] = `
64
<View
75
style={
@@ -14,7 +12,7 @@ exports[`SkiaChart Component does not render GestureHandler when handleGesture i
1412
/>
1513
`;
1614

17-
exports[`SkiaChart Component renders Canvas when svgString is provided 1`] = `
15+
exports[`SkiaChart Component renders GestureHandler when handleGesture is true and useRNGH is ture 1`] = `
1816
<View
1917
style={
2018
{
@@ -25,18 +23,7 @@ exports[`SkiaChart Component renders Canvas when svgString is provided 1`] = `
2523
testID="component"
2624
>
2725
<View
28-
onMoveShouldSetResponder={[Function]}
29-
onMoveShouldSetResponderCapture={[Function]}
30-
onResponderEnd={[Function]}
31-
onResponderGrant={[Function]}
32-
onResponderMove={[Function]}
33-
onResponderReject={[Function]}
34-
onResponderRelease={[Function]}
35-
onResponderStart={[Function]}
36-
onResponderTerminate={[Function]}
37-
onResponderTerminationRequest={[Function]}
38-
onStartShouldSetResponder={[Function]}
39-
onStartShouldSetResponderCapture={[Function]}
26+
collapsable={false}
4027
style={
4128
{
4229
"backgroundColor": "rgba(0,0,0,0)",
@@ -45,12 +32,12 @@ exports[`SkiaChart Component renders Canvas when svgString is provided 1`] = `
4532
"width": "100%",
4633
}
4734
}
48-
testID="pan-responder-handler"
35+
testID="gesture-handler"
4936
/>
5037
</View>
5138
`;
5239

53-
exports[`SkiaChart Component renders GestureHandler when handleGesture is true and useRNGH is ture 1`] = `
40+
exports[`SkiaChart Component renders PanResponderHandler when handleGesture is true and useRNGH is false 1`] = `
5441
<View
5542
style={
5643
{
@@ -61,7 +48,18 @@ exports[`SkiaChart Component renders GestureHandler when handleGesture is true a
6148
testID="component"
6249
>
6350
<View
64-
collapsable={false}
51+
onMoveShouldSetResponder={[Function]}
52+
onMoveShouldSetResponderCapture={[Function]}
53+
onResponderEnd={[Function]}
54+
onResponderGrant={[Function]}
55+
onResponderMove={[Function]}
56+
onResponderReject={[Function]}
57+
onResponderRelease={[Function]}
58+
onResponderStart={[Function]}
59+
onResponderTerminate={[Function]}
60+
onResponderTerminationRequest={[Function]}
61+
onStartShouldSetResponder={[Function]}
62+
onStartShouldSetResponderCapture={[Function]}
6563
style={
6664
{
6765
"backgroundColor": "rgba(0,0,0,0)",
@@ -70,12 +68,12 @@ exports[`SkiaChart Component renders GestureHandler when handleGesture is true a
7068
"width": "100%",
7169
}
7270
}
73-
testID="gesture-handler"
71+
testID="pan-responder-handler"
7472
/>
7573
</View>
7674
`;
7775

78-
exports[`SkiaChart Component renders PanResponderHandler when handleGesture is true and useRNGH is false 1`] = `
76+
exports[`SkiaChart Component renders correctly 1`] = `
7977
<View
8078
style={
8179
{
@@ -111,10 +109,6 @@ exports[`SkiaChart Component renders PanResponderHandler when handleGesture is t
111109
</View>
112110
`;
113111

114-
exports[`SkiaChart Component renders correctly 1`] = `null`;
115-
116-
exports[`SvgChart Component does not render Canvas when svgString is not provided 1`] = `null`;
117-
118112
exports[`SvgChart Component does not render GestureHandler when handleGesture is false 1`] = `
119113
<View
120114
style={
@@ -163,77 +157,6 @@ exports[`SvgChart Component does not render GestureHandler when handleGesture is
163157
</View>
164158
`;
165159

166-
exports[`SvgChart Component renders Canvas when svgString is provided 1`] = `
167-
<View
168-
style={
169-
{
170-
"height": 100,
171-
"width": 100,
172-
}
173-
}
174-
testID="component"
175-
>
176-
<RNSVGSvgView
177-
align="xMidYMid"
178-
bbHeight={100}
179-
bbWidth={100}
180-
focusable={false}
181-
height={100}
182-
meetOrSlice={0}
183-
minX={0}
184-
minY={0}
185-
style={
186-
[
187-
{
188-
"backgroundColor": "transparent",
189-
"borderWidth": 0,
190-
},
191-
{
192-
"flex": 0,
193-
"height": 100,
194-
"width": 100,
195-
},
196-
]
197-
}
198-
vbHeight={100}
199-
vbWidth={100}
200-
width={100}
201-
>
202-
<RNSVGGroup
203-
fill={
204-
{
205-
"payload": 4278190080,
206-
"type": 0,
207-
}
208-
}
209-
/>
210-
</RNSVGSvgView>
211-
<View
212-
onMoveShouldSetResponder={[Function]}
213-
onMoveShouldSetResponderCapture={[Function]}
214-
onResponderEnd={[Function]}
215-
onResponderGrant={[Function]}
216-
onResponderMove={[Function]}
217-
onResponderReject={[Function]}
218-
onResponderRelease={[Function]}
219-
onResponderStart={[Function]}
220-
onResponderTerminate={[Function]}
221-
onResponderTerminationRequest={[Function]}
222-
onStartShouldSetResponder={[Function]}
223-
onStartShouldSetResponderCapture={[Function]}
224-
style={
225-
{
226-
"backgroundColor": "rgba(0,0,0,0)",
227-
"height": "100%",
228-
"position": "absolute",
229-
"width": "100%",
230-
}
231-
}
232-
testID="pan-responder-handler"
233-
/>
234-
</View>
235-
`;
236-
237160
exports[`SvgChart Component renders GestureHandler when handleGesture is true and useRNGH is ture 1`] = `
238161
<View
239162
style={

src/__tests__/index.test.tsx

-14
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,6 @@ Components.forEach((Component) => {
2424
expect(toJSON()).toMatchSnapshot();
2525
});
2626

27-
it('renders Canvas when svgString is provided', () => {
28-
const { queryByTestId, toJSON } = render(
29-
<Component svg={svg} node={node} />
30-
);
31-
expect(toJSON()).toMatchSnapshot();
32-
expect(queryByTestId('component')).not.toBeNull();
33-
});
34-
35-
it('does not render Canvas when svgString is not provided', () => {
36-
const { queryByTestId, toJSON } = render(<Component />);
37-
expect(toJSON()).toMatchSnapshot();
38-
expect(queryByTestId('component')).toBeNull();
39-
});
40-
4127
it('renders GestureHandler when handleGesture is true and useRNGH is ture', () => {
4228
const { queryByTestId, toJSON } = render(
4329
<Component svg={svg} node={node} useRNGH />

0 commit comments

Comments
 (0)