@applicaster/zapp-react-native-ui-components 13.0.0-alpha.7663846546 → 13.0.0-alpha.7807341867
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/Components/AppContainer/__tests__/AppContainer.test.js +4 -6
- package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +54 -111
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +36 -20
- package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
- package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
- package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
- package/Components/AudioPlayer/__tests__/title.test.js +3 -5
- package/Components/BaseFocusable/index.tsx +1 -2
- package/Components/Cell/Cell.tsx +1 -0
- package/Components/Cell/CellWithFocusable.tsx +1 -0
- package/Components/Cell/TvOSCellComponent.tsx +20 -22
- package/Components/Cell/index.js +3 -1
- package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +46 -48
- package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
- package/Components/ComponentResolver/__tests__/componentResolver.test.js +16 -22
- package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
- package/Components/ErrorScreen/index.tsx +6 -6
- package/Components/Focusable/Focusable.tsx +1 -0
- package/Components/Focusable/FocusableTvOS.tsx +5 -1
- package/Components/Focusable/index.android.tsx +10 -3
- package/Components/FocusableList/index.tsx +26 -9
- package/Components/FocusableScrollView/index.tsx +43 -13
- package/Components/Layout/TV/NavBarContainer.tsx +19 -23
- package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -2
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +3 -2
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
- package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
- package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +4 -12
- package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +0 -229
- package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
- package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
- package/Components/ModalComponent/Button/index.tsx +6 -6
- package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
- package/Components/PlayerContainer/PlayerContainer.tsx +8 -8
- package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
- package/Components/PlayerImageBackground/index.tsx +23 -3
- package/Components/River/TV/index.tsx +6 -1
- package/Components/River/__tests__/__snapshots__/river.test.js.snap +20 -82
- package/Components/River/__tests__/river.test.js +75 -40
- package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -4
- package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
- package/Components/RouteManager/__tests__/testId.test.js +8 -6
- package/Components/Screen/index.tsx +4 -4
- package/Components/ScreenResolver/__tests__/screenResolver.test.js +91 -70
- package/Components/Tabs/Tab.tsx +5 -3
- package/Components/TextInputTv/index.tsx +2 -1
- package/Components/Transitioner/Scene.tsx +1 -1
- package/Components/Transitioner/Transitioner.tsx +3 -3
- package/Components/Transitioner/__tests__/Scene.test.js +25 -14
- package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +12 -68
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +2 -2
- package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
- package/Components/VideoLive/PlayerLiveImageComponent.tsx +3 -3
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +11 -11
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +7 -7
- package/Components/VideoModal/PlayerDetails.tsx +9 -6
- package/Components/VideoModal/PlayerWrapper.tsx +2 -2
- package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
- package/Components/Viewport/__tests__/utils.test.js +5 -4
- package/Components/ZappUIComponent/Placeholder.tsx +3 -1
- package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
- package/Components/ZappUIComponent/index.tsx +3 -16
- package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
- package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
- package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
- package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
- package/Decorators/Navigator/index.tsx +1 -1
- package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +18 -24
- package/Decorators/RiverResolver/index.tsx +1 -1
- package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
- package/package.json +7 -7
- package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
- package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
- package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
- package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
- package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
- package/Decorators/RiverResolver/__tests__/__snapshots__/riverResolver.test.tsx.snap +0 -28
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, Text } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { render } from "@testing-library/react-native";
|
|
4
|
+
import { AppContainer } from "../index";
|
|
5
5
|
|
|
6
6
|
const styles = {
|
|
7
7
|
iphone: {
|
|
@@ -15,11 +15,9 @@ jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
|
|
|
15
15
|
})),
|
|
16
16
|
}));
|
|
17
17
|
|
|
18
|
-
const { AppContainer } = require("../index");
|
|
19
|
-
|
|
20
18
|
describe("<AppContainer />", () => {
|
|
21
19
|
it("renders correctly", () => {
|
|
22
|
-
const
|
|
20
|
+
const { toJSON } = render(
|
|
23
21
|
<AppContainer styles={styles}>
|
|
24
22
|
<View>
|
|
25
23
|
<Text>I'm an app</Text>
|
|
@@ -27,6 +25,6 @@ describe("<AppContainer />", () => {
|
|
|
27
25
|
</AppContainer>
|
|
28
26
|
);
|
|
29
27
|
|
|
30
|
-
expect(
|
|
28
|
+
expect(toJSON()).toMatchSnapshot();
|
|
31
29
|
});
|
|
32
30
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
import { Runtime } from "../Runtime";
|
|
6
5
|
|
|
@@ -18,14 +17,12 @@ const RuntimeProps = (isRTL) => ({
|
|
|
18
17
|
|
|
19
18
|
describe("<Runtime />", () => {
|
|
20
19
|
it("RTL renders correctly", () => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
expect(shallowToJson(wrapper)).toMatchSnapshot();
|
|
20
|
+
const { toJSON } = render(<Runtime {...RuntimeProps(true)} />);
|
|
21
|
+
expect(toJSON()).toMatchSnapshot();
|
|
24
22
|
});
|
|
25
23
|
|
|
26
24
|
it("LTR renders correctly", () => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
expect(shallowToJson(wrapper)).toMatchSnapshot();
|
|
25
|
+
const { toJSON } = render(<Runtime {...RuntimeProps(false)} />);
|
|
26
|
+
expect(toJSON()).toMatchSnapshot();
|
|
30
27
|
});
|
|
31
28
|
});
|
|
@@ -1,123 +1,66 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<AudioPlayer /> renders correctly 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
4
|
+
<View
|
|
5
|
+
pointerEvents="none"
|
|
6
|
+
style={
|
|
6
7
|
{
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"backgroundColor": "black",
|
|
10
|
-
"backgroundImage": "https://example.com",
|
|
11
|
-
"channelIcon": "https://example.com",
|
|
12
|
-
"isRTL": true,
|
|
13
|
-
"magicBackground": false,
|
|
14
|
-
"runTimeFontFamily": undefined,
|
|
15
|
-
"runTimeFontSize": undefined,
|
|
16
|
-
"summaryColor": "white",
|
|
17
|
-
"summaryFontFamily": undefined,
|
|
18
|
-
"summaryFontSize": undefined,
|
|
19
|
-
"titleColor": "white",
|
|
20
|
-
"titleFontFamily": undefined,
|
|
21
|
-
"titleFontSize": undefined,
|
|
8
|
+
"backgroundColor": "transparent",
|
|
9
|
+
"overflow": "hidden",
|
|
22
10
|
}
|
|
23
11
|
}
|
|
24
|
-
style={{}}
|
|
25
12
|
>
|
|
26
|
-
<
|
|
27
|
-
|
|
13
|
+
<View
|
|
14
|
+
collapsable={false}
|
|
15
|
+
style={
|
|
28
16
|
{
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"backgroundImage": "https://example.com",
|
|
33
|
-
"channelIcon": "https://example.com",
|
|
34
|
-
"isRTL": true,
|
|
35
|
-
"magicBackground": false,
|
|
36
|
-
"runTimeFontFamily": undefined,
|
|
37
|
-
"runTimeFontSize": undefined,
|
|
38
|
-
"summaryColor": "white",
|
|
39
|
-
"summaryFontFamily": undefined,
|
|
40
|
-
"summaryFontSize": undefined,
|
|
41
|
-
"titleColor": "white",
|
|
42
|
-
"titleFontFamily": undefined,
|
|
43
|
-
"titleFontSize": undefined,
|
|
17
|
+
"backgroundColor": "transparent",
|
|
18
|
+
"opacity": 0,
|
|
19
|
+
"overflow": "hidden",
|
|
44
20
|
}
|
|
45
21
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"backgroundColor": "black",
|
|
54
|
-
"backgroundImage": "https://example.com",
|
|
55
|
-
"channelIcon": "https://example.com",
|
|
56
|
-
"isRTL": true,
|
|
57
|
-
"magicBackground": false,
|
|
58
|
-
"runTimeFontFamily": undefined,
|
|
59
|
-
"runTimeFontSize": undefined,
|
|
60
|
-
"summaryColor": "white",
|
|
61
|
-
"summaryFontFamily": undefined,
|
|
62
|
-
"summaryFontSize": undefined,
|
|
63
|
-
"titleColor": "white",
|
|
64
|
-
"titleFontFamily": undefined,
|
|
65
|
-
"titleFontSize": undefined,
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
title="tittle"
|
|
69
|
-
/>
|
|
70
|
-
<Summary
|
|
71
|
-
config={
|
|
72
|
-
{
|
|
73
|
-
"artworkAspectRatio": "1:1",
|
|
74
|
-
"audioPlayerBackgroundImageQuery": "",
|
|
75
|
-
"backgroundColor": "black",
|
|
76
|
-
"backgroundImage": "https://example.com",
|
|
77
|
-
"channelIcon": "https://example.com",
|
|
78
|
-
"isRTL": true,
|
|
79
|
-
"magicBackground": false,
|
|
80
|
-
"runTimeFontFamily": undefined,
|
|
81
|
-
"runTimeFontSize": undefined,
|
|
82
|
-
"summaryColor": "white",
|
|
83
|
-
"summaryFontFamily": undefined,
|
|
84
|
-
"summaryFontSize": undefined,
|
|
85
|
-
"titleColor": "white",
|
|
86
|
-
"titleFontFamily": undefined,
|
|
87
|
-
"titleFontSize": undefined,
|
|
22
|
+
>
|
|
23
|
+
<View
|
|
24
|
+
accessibilityIgnoresInvertColors={true}
|
|
25
|
+
style={
|
|
26
|
+
{
|
|
27
|
+
"flex": 1,
|
|
28
|
+
}
|
|
88
29
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</
|
|
30
|
+
>
|
|
31
|
+
<Image
|
|
32
|
+
resizeMode="cover"
|
|
33
|
+
source={
|
|
34
|
+
{
|
|
35
|
+
"uri": "https://example.com",
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
style={
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
"bottom": 0,
|
|
42
|
+
"left": 0,
|
|
43
|
+
"position": "absolute",
|
|
44
|
+
"right": 0,
|
|
45
|
+
"top": 0,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"height": undefined,
|
|
49
|
+
"width": undefined,
|
|
50
|
+
},
|
|
51
|
+
undefined,
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
<View
|
|
56
|
+
style={
|
|
57
|
+
{
|
|
58
|
+
"backgroundColor": "transparent",
|
|
59
|
+
"overflow": "hidden",
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
</View>
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
123
66
|
`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<AudioPlayerLayout
|
|
3
|
+
exports[`<AudioPlayerLayout /> renders correctly 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
pointerEvents="none"
|
|
6
6
|
style={
|
|
@@ -10,32 +10,48 @@ exports[`<AudioPlayerLayout /> renders correctly 1`] = `
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
>
|
|
13
|
-
<
|
|
13
|
+
<View
|
|
14
|
+
collapsable={false}
|
|
14
15
|
style={
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
"opacity": 0,
|
|
22
|
-
},
|
|
23
|
-
]
|
|
16
|
+
{
|
|
17
|
+
"backgroundColor": "transparent",
|
|
18
|
+
"opacity": 0,
|
|
19
|
+
"overflow": "hidden",
|
|
20
|
+
}
|
|
24
21
|
}
|
|
25
22
|
>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
source={
|
|
29
|
-
{
|
|
30
|
-
"uri": "https://example.com",
|
|
31
|
-
}
|
|
32
|
-
}
|
|
23
|
+
<View
|
|
24
|
+
accessibilityIgnoresInvertColors={true}
|
|
33
25
|
style={
|
|
34
26
|
{
|
|
35
27
|
"flex": 1,
|
|
36
28
|
}
|
|
37
29
|
}
|
|
38
30
|
>
|
|
31
|
+
<Image
|
|
32
|
+
resizeMode="cover"
|
|
33
|
+
source={
|
|
34
|
+
{
|
|
35
|
+
"uri": "https://example.com",
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
style={
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
"bottom": 0,
|
|
42
|
+
"left": 0,
|
|
43
|
+
"position": "absolute",
|
|
44
|
+
"right": 0,
|
|
45
|
+
"top": 0,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"height": undefined,
|
|
49
|
+
"width": undefined,
|
|
50
|
+
},
|
|
51
|
+
undefined,
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
39
55
|
<View
|
|
40
56
|
style={
|
|
41
57
|
{
|
|
@@ -44,7 +60,7 @@ exports[`<AudioPlayerLayout /> renders correctly 1`] = `
|
|
|
44
60
|
}
|
|
45
61
|
}
|
|
46
62
|
/>
|
|
47
|
-
</
|
|
48
|
-
</
|
|
63
|
+
</View>
|
|
64
|
+
</View>
|
|
49
65
|
</View>
|
|
50
66
|
`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
import { Artwork } from "../Artwork";
|
|
6
5
|
|
|
@@ -16,9 +15,8 @@ const artWorkProps = {
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
describe("<Artwork />", () => {
|
|
19
|
-
const wrapper = shallow(<Artwork {...artWorkProps} />);
|
|
20
|
-
|
|
21
18
|
it("renders correctly", () => {
|
|
22
|
-
|
|
19
|
+
const { toJSON } = render(<Artwork {...artWorkProps} />);
|
|
20
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
21
|
});
|
|
24
22
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
import { AudioPlayer } from "../AudioPlayer";
|
|
6
5
|
|
|
@@ -47,9 +46,8 @@ const audioPlayerProps = {
|
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
describe("<AudioPlayer />", () => {
|
|
50
|
-
const wrapper = shallow(<AudioPlayer {...audioPlayerProps} />);
|
|
51
|
-
|
|
52
49
|
it("renders correctly", () => {
|
|
53
|
-
|
|
50
|
+
const { toJSON } = render(<AudioPlayer {...audioPlayerProps} />);
|
|
51
|
+
expect(toJSON()).toMatchSnapshot();
|
|
54
52
|
});
|
|
55
53
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
import { AudioPlayerLayout } from "../AudioPlayerLayout";
|
|
6
5
|
|
|
@@ -16,12 +15,12 @@ const audioPlayerLayoutProps = {
|
|
|
16
15
|
children: [],
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
describe("<AudioPlayerLayout />", () => {
|
|
22
|
-
const wrapper = shallow(<AudioPlayerLayout {...audioPlayerLayoutProps} />);
|
|
23
|
-
|
|
18
|
+
describe("<AudioPlayerLayout />", () => {
|
|
24
19
|
it("renders correctly", () => {
|
|
25
|
-
|
|
20
|
+
const { toJSON } = render(
|
|
21
|
+
<AudioPlayerLayout {...audioPlayerLayoutProps} />
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
expect(toJSON()).toMatchSnapshot();
|
|
26
25
|
});
|
|
27
26
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
import { Channel } from "../Channel";
|
|
6
5
|
|
|
@@ -16,9 +15,8 @@ const channelProps = {
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
describe("<Channel />", () => {
|
|
19
|
-
const wrapper = shallow(<Channel {...channelProps} />);
|
|
20
|
-
|
|
21
18
|
it("renders correctly", () => {
|
|
22
|
-
|
|
19
|
+
const { toJSON } = render(<Channel {...channelProps} />);
|
|
20
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
21
|
});
|
|
24
22
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
import { Summary } from "../Summary";
|
|
6
5
|
|
|
@@ -16,9 +15,8 @@ const summaryProps = {
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
describe("<Summary />", () => {
|
|
19
|
-
const wrapper = shallow(<Summary {...summaryProps} />);
|
|
20
|
-
|
|
21
18
|
it("renders correctly", () => {
|
|
22
|
-
|
|
19
|
+
const { toJSON } = render(<Summary {...summaryProps} />);
|
|
20
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
21
|
});
|
|
24
22
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
2
|
+
import { render } from "@testing-library/react-native";
|
|
4
3
|
|
|
5
4
|
import { Title } from "../Title";
|
|
6
5
|
|
|
@@ -16,9 +15,8 @@ const titleProps = {
|
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
describe("<Title />", () => {
|
|
19
|
-
const wrapper = shallow(<Title {...titleProps} />);
|
|
20
|
-
|
|
21
18
|
it("renders correctly", () => {
|
|
22
|
-
|
|
19
|
+
const { toJSON } = render(<Title {...titleProps} />);
|
|
20
|
+
expect(toJSON()).toMatchSnapshot();
|
|
23
21
|
});
|
|
24
22
|
});
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
BoundingRect,
|
|
7
7
|
} from "./BaseFocusable.interface";
|
|
8
8
|
|
|
9
|
-
import { createReactRef } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
10
9
|
import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
|
|
11
10
|
import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
12
11
|
|
|
@@ -45,7 +44,7 @@ export class BaseFocusable<
|
|
|
45
44
|
focused: initialFocus || false,
|
|
46
45
|
};
|
|
47
46
|
|
|
48
|
-
this.ref =
|
|
47
|
+
this.ref = React.createRef();
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
componentDidMount() {
|
package/Components/Cell/Cell.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import * as R from "ramda";
|
|
3
3
|
import { View, StyleSheet } from "react-native";
|
|
4
4
|
|
|
5
|
-
import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable";
|
|
5
|
+
import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable/FocusableTvOS";
|
|
6
6
|
import { FocusableCell } from "@applicaster/zapp-react-native-ui-components/Components/FocusableCell";
|
|
7
7
|
import { getItemType } from "@applicaster/zapp-react-native-utils/navigationUtils";
|
|
8
8
|
import { SCREEN_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/itemTypes";
|
|
@@ -65,6 +65,7 @@ type Props = {
|
|
|
65
65
|
isFocusable: boolean;
|
|
66
66
|
shouldUpdate: boolean;
|
|
67
67
|
behavior: Behavior;
|
|
68
|
+
componentsMapOffset: number;
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
type State = {
|
|
@@ -179,6 +180,7 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
179
180
|
groupId,
|
|
180
181
|
component,
|
|
181
182
|
index,
|
|
183
|
+
componentsMapOffset,
|
|
182
184
|
} = this.props;
|
|
183
185
|
|
|
184
186
|
this.setScreenLayout(componentAnchorPointY, screenLayout);
|
|
@@ -193,13 +195,11 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
193
195
|
const extraAnchorPointYOffset =
|
|
194
196
|
screenLayout?.extraAnchorPointYOffset || 0;
|
|
195
197
|
|
|
196
|
-
const marginTop = screenLayout?.screenMarginTop || 0;
|
|
197
|
-
|
|
198
198
|
const totalOffset =
|
|
199
199
|
headerOffset +
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
(componentAnchorPointY || 0) +
|
|
201
|
+
extraAnchorPointYOffset -
|
|
202
|
+
componentsMapOffset || 0;
|
|
203
203
|
|
|
204
204
|
mainOffsetUpdater?.(
|
|
205
205
|
{ tag: this.target },
|
|
@@ -247,7 +247,7 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
247
247
|
|
|
248
248
|
const focusableId = R.join("-", [component?.id, id, index]);
|
|
249
249
|
|
|
250
|
-
const handleFocus = (arg1: any, index
|
|
250
|
+
const handleFocus = (arg1: any, index?: number) => {
|
|
251
251
|
const focusFn = onFocus || noop;
|
|
252
252
|
focusFn(arg1, index);
|
|
253
253
|
|
|
@@ -280,7 +280,7 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
280
280
|
<View onLayout={this.onLayout} style={styles.container}>
|
|
281
281
|
<Focusable
|
|
282
282
|
id={focusableId}
|
|
283
|
-
groupId={groupId || component?.id}
|
|
283
|
+
groupId={String(groupId || component?.id)}
|
|
284
284
|
onFocus={handleFocus}
|
|
285
285
|
onBlur={onBlur || this.onBlur}
|
|
286
286
|
isParallaxDisabled={this.layout?.width > 1740}
|
|
@@ -292,20 +292,18 @@ export class TvOSCellComponent extends React.Component<Props, State> {
|
|
|
292
292
|
style={baseCellStyles}
|
|
293
293
|
isFocusable={isFocusable}
|
|
294
294
|
>
|
|
295
|
-
{(focused) =>
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
);
|
|
308
|
-
}}
|
|
295
|
+
{(focused) => (
|
|
296
|
+
<FocusableCell
|
|
297
|
+
{...{
|
|
298
|
+
index,
|
|
299
|
+
CellRenderer,
|
|
300
|
+
item,
|
|
301
|
+
focused: !!(this.props.focused || selectedCell || focused),
|
|
302
|
+
scrollTo: this.scrollTo,
|
|
303
|
+
behavior,
|
|
304
|
+
}}
|
|
305
|
+
/>
|
|
306
|
+
)}
|
|
309
307
|
</Focusable>
|
|
310
308
|
</View>
|
|
311
309
|
);
|
package/Components/Cell/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { ScreenScrollingContext } from "../../Contexts/ScreenScrollingContext";
|
|
|
11
11
|
|
|
12
12
|
import { ScreenLayoutContextConsumer } from "../../Contexts/ScreenLayoutContext";
|
|
13
13
|
import { createContext } from "@applicaster/zapp-react-native-utils/reactUtils/createContext";
|
|
14
|
+
import { withComponentsMapOffsetContextConsumer } from "../../Contexts/ComponentsMapOffsetContext";
|
|
14
15
|
|
|
15
16
|
// TODO | Gallery QB | Extract this
|
|
16
17
|
export const ScrollInterceptorContext = createContext(
|
|
@@ -30,5 +31,6 @@ export const Cell = R.compose(
|
|
|
30
31
|
RiverOffsetContext.withConsumer,
|
|
31
32
|
HorizontalScrollContext.withConsumer,
|
|
32
33
|
withConsumer,
|
|
33
|
-
ScreenLayoutContextConsumer
|
|
34
|
+
ScreenLayoutContextConsumer,
|
|
35
|
+
withComponentsMapOffsetContextConsumer
|
|
34
36
|
)(Component);
|