@hero-design/rn 8.99.0 → 8.99.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +12 -0
- package/es/index.js +14 -5
- package/lib/index.js +14 -5
- package/package.json +1 -1
- package/src/components/Select/MultiSelect/OptionList.tsx +6 -4
- package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +45 -0
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +40 -0
- package/src/components/Select/MultiSelect/__tests__/utils.spec.ts +31 -0
- package/src/components/Select/MultiSelect/index.tsx +3 -2
- package/src/components/Select/MultiSelect/utils.ts +12 -0
- package/src/components/StatusScreens/Empty/__tests__/__snapshots__/index.spec.tsx.snap +120 -0
- package/src/components/StatusScreens/Empty/__tests__/index.spec.tsx +21 -1
- package/src/components/StatusScreens/Empty/index.tsx +1 -1
- package/src/components/StatusScreens/Error/__tests__/__snapshots__/index.spec.tsx.snap +134 -0
- package/src/components/StatusScreens/Error/__tests__/index.spec.tsx +14 -0
- package/src/components/StatusScreens/Error/index.tsx +1 -1
- package/src/components/StatusScreens/Success/__tests__/__snapshots__/index.spec.tsx.snap +134 -0
- package/src/components/StatusScreens/Success/__tests__/index.spec.tsx +13 -0
- package/src/components/StatusScreens/Success/index.tsx +1 -1
- package/stats/8.99.1/rn-stats.html +4842 -0
- package/stats/8.99.2/rn-stats.html +4842 -0
- package/types/components/Select/MultiSelect/utils.d.ts +2 -0
- package/types/components/StatusScreens/Empty/index.d.ts +1 -1
- package/types/components/StatusScreens/Error/index.d.ts +1 -1
- package/types/components/StatusScreens/Success/index.d.ts +1 -1
|
@@ -4,6 +4,7 @@ import renderWithTheme from '../../../../testHelpers/renderWithTheme';
|
|
|
4
4
|
import Error from '..';
|
|
5
5
|
import Image from '../../../Image';
|
|
6
6
|
import Portal from '../../../Portal';
|
|
7
|
+
import Typography from '../../../Typography';
|
|
7
8
|
|
|
8
9
|
const title = `We’re sorry, something went wrong`;
|
|
9
10
|
const description = 'Please try again later';
|
|
@@ -18,6 +19,19 @@ describe('Error', () => {
|
|
|
18
19
|
expect(getByText(description)).toBeTruthy();
|
|
19
20
|
expect(toJSON()).toMatchSnapshot();
|
|
20
21
|
});
|
|
22
|
+
|
|
23
|
+
it('renders title only correctly with title is a React Element', () => {
|
|
24
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
25
|
+
<Error
|
|
26
|
+
title={<Typography.Title>{title}</Typography.Title>}
|
|
27
|
+
description={description}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
expect(getByText(title)).toBeTruthy();
|
|
32
|
+
expect(getByText(description)).toBeTruthy();
|
|
33
|
+
expect(toJSON()).toMatchSnapshot();
|
|
34
|
+
});
|
|
21
35
|
it('renders error screen with image correctly', () => {
|
|
22
36
|
const { toJSON, getByText, getByTestId } = renderWithTheme(
|
|
23
37
|
<Error title={title} description={description} image="path_to_image" />
|
|
@@ -896,6 +896,140 @@ exports[`Success renders title and description as ReactElement correctly 1`] = `
|
|
|
896
896
|
</View>
|
|
897
897
|
`;
|
|
898
898
|
|
|
899
|
+
exports[`Success renders title is a React Element correctly 1`] = `
|
|
900
|
+
<View
|
|
901
|
+
style={
|
|
902
|
+
{
|
|
903
|
+
"flex": 1,
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
>
|
|
907
|
+
<View
|
|
908
|
+
style={
|
|
909
|
+
[
|
|
910
|
+
{
|
|
911
|
+
"backgroundColor": "#f6f6f7",
|
|
912
|
+
"display": "flex",
|
|
913
|
+
"flex": 1,
|
|
914
|
+
"flexDirection": "column",
|
|
915
|
+
},
|
|
916
|
+
undefined,
|
|
917
|
+
]
|
|
918
|
+
}
|
|
919
|
+
themeVariant="in-page"
|
|
920
|
+
>
|
|
921
|
+
<View
|
|
922
|
+
style={
|
|
923
|
+
[
|
|
924
|
+
{
|
|
925
|
+
"alignItems": "center",
|
|
926
|
+
"display": "flex",
|
|
927
|
+
"flex": 1,
|
|
928
|
+
"flexDirection": "column",
|
|
929
|
+
"justifyContent": "center",
|
|
930
|
+
"padding": 24,
|
|
931
|
+
},
|
|
932
|
+
undefined,
|
|
933
|
+
]
|
|
934
|
+
}
|
|
935
|
+
>
|
|
936
|
+
<Text
|
|
937
|
+
allowFontScaling={false}
|
|
938
|
+
style={
|
|
939
|
+
[
|
|
940
|
+
{
|
|
941
|
+
"color": "#001f23",
|
|
942
|
+
"fontFamily": "Saiga-Medium",
|
|
943
|
+
"fontSize": 24,
|
|
944
|
+
"letterSpacing": 0.24,
|
|
945
|
+
"lineHeight": 32,
|
|
946
|
+
},
|
|
947
|
+
[
|
|
948
|
+
{
|
|
949
|
+
"color": "#001f23",
|
|
950
|
+
"marginBottom": 8,
|
|
951
|
+
"textAlign": "center",
|
|
952
|
+
},
|
|
953
|
+
undefined,
|
|
954
|
+
],
|
|
955
|
+
]
|
|
956
|
+
}
|
|
957
|
+
themeIntent="body"
|
|
958
|
+
themeLevel="h4"
|
|
959
|
+
themeTypeface="playful"
|
|
960
|
+
>
|
|
961
|
+
<Text
|
|
962
|
+
allowFontScaling={false}
|
|
963
|
+
style={
|
|
964
|
+
[
|
|
965
|
+
{
|
|
966
|
+
"color": "#001f23",
|
|
967
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
968
|
+
"fontSize": 42,
|
|
969
|
+
"letterSpacing": 0,
|
|
970
|
+
"lineHeight": 50,
|
|
971
|
+
},
|
|
972
|
+
undefined,
|
|
973
|
+
]
|
|
974
|
+
}
|
|
975
|
+
themeIntent="body"
|
|
976
|
+
themeLevel="h1"
|
|
977
|
+
themeTypeface="neutral"
|
|
978
|
+
>
|
|
979
|
+
Two-Factor Authentication
|
|
980
|
+
</Text>
|
|
981
|
+
</Text>
|
|
982
|
+
<Text
|
|
983
|
+
allowFontScaling={false}
|
|
984
|
+
style={
|
|
985
|
+
[
|
|
986
|
+
{
|
|
987
|
+
"color": "#001f23",
|
|
988
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
989
|
+
"fontSize": 16,
|
|
990
|
+
"letterSpacing": 0.48,
|
|
991
|
+
"lineHeight": 24,
|
|
992
|
+
},
|
|
993
|
+
[
|
|
994
|
+
{
|
|
995
|
+
"color": "#4d6265",
|
|
996
|
+
"textAlign": "center",
|
|
997
|
+
},
|
|
998
|
+
undefined,
|
|
999
|
+
],
|
|
1000
|
+
]
|
|
1001
|
+
}
|
|
1002
|
+
themeIntent="body"
|
|
1003
|
+
themeTypeface="neutral"
|
|
1004
|
+
themeVariant="regular"
|
|
1005
|
+
>
|
|
1006
|
+
Protecting your sensitive data is important to us. Verifying your mobile number or using an authenticator app makes it harder for attackers to access personal and sensitive information.
|
|
1007
|
+
</Text>
|
|
1008
|
+
</View>
|
|
1009
|
+
</View>
|
|
1010
|
+
<View
|
|
1011
|
+
pointerEvents="box-none"
|
|
1012
|
+
position="bottom"
|
|
1013
|
+
style={
|
|
1014
|
+
[
|
|
1015
|
+
{
|
|
1016
|
+
"bottom": 0,
|
|
1017
|
+
"elevation": 9999,
|
|
1018
|
+
"flexDirection": "column-reverse",
|
|
1019
|
+
"left": 0,
|
|
1020
|
+
"paddingHorizontal": 24,
|
|
1021
|
+
"paddingVertical": 16,
|
|
1022
|
+
"position": "absolute",
|
|
1023
|
+
"right": 0,
|
|
1024
|
+
"top": 0,
|
|
1025
|
+
},
|
|
1026
|
+
undefined,
|
|
1027
|
+
]
|
|
1028
|
+
}
|
|
1029
|
+
/>
|
|
1030
|
+
</View>
|
|
1031
|
+
`;
|
|
1032
|
+
|
|
899
1033
|
exports[`Success renders title only correctly 1`] = `
|
|
900
1034
|
<View
|
|
901
1035
|
style={
|
|
@@ -20,6 +20,19 @@ describe('Success', () => {
|
|
|
20
20
|
expect(getByText(description)).toBeTruthy();
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
it('renders title is a React Element correctly', () => {
|
|
24
|
+
const { toJSON, getByText } = renderWithTheme(
|
|
25
|
+
<Success
|
|
26
|
+
title={<Typography.Title>{title}</Typography.Title>}
|
|
27
|
+
description={description}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
expect(toJSON()).toMatchSnapshot();
|
|
32
|
+
expect(getByText(title)).toBeTruthy();
|
|
33
|
+
expect(getByText(description)).toBeTruthy();
|
|
34
|
+
});
|
|
35
|
+
|
|
23
36
|
it('renders title and description as ReactElement correctly', () => {
|
|
24
37
|
const clickHereSpy = jest.fn();
|
|
25
38
|
const { toJSON, getByText } = renderWithTheme(
|