@applicaster/zapp-react-native-ui-components 13.0.0-alpha.7222542422 → 13.0.0-alpha.7223143213

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.
Files changed (137) hide show
  1. package/Components/AppContainer/__tests__/AppContainer.test.js +4 -6
  2. package/Components/AudioPlayer/AudioPlayer.tsx +7 -0
  3. package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
  4. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +54 -111
  5. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +36 -20
  6. package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
  7. package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
  8. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
  9. package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
  10. package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
  11. package/Components/AudioPlayer/__tests__/title.test.js +3 -5
  12. package/Components/AudioPlayer/helpers.tsx +1 -0
  13. package/Components/BaseFocusable/index.ios.ts +1 -1
  14. package/Components/BaseFocusable/index.tsx +2 -3
  15. package/Components/Cell/Cell.tsx +7 -3
  16. package/Components/Cell/CellWithFocusable.tsx +44 -59
  17. package/Components/Cell/__tests__/CellWIthFocusable.test.js +13 -6
  18. package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +46 -48
  19. package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
  20. package/Components/ComponentResolver/__tests__/componentResolver.test.js +16 -22
  21. package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
  22. package/Components/ErrorScreen/index.tsx +6 -6
  23. package/Components/Focusable/Focusable.tsx +1 -0
  24. package/Components/Focusable/Touchable.tsx +19 -20
  25. package/Components/Focusable/index.android.tsx +10 -3
  26. package/Components/FocusableCell/index.tsx +1 -1
  27. package/Components/FocusableGroup/FocusableTvOS.tsx +34 -86
  28. package/Components/FocusableGroup/index.tsx +0 -3
  29. package/Components/FocusableList/index.tsx +1 -0
  30. package/Components/FocusableScrollView/index.tsx +6 -3
  31. package/Components/Layout/TV/NavBarContainer.tsx +14 -19
  32. package/Components/Layout/TV/ScreenContainer.tsx +8 -1
  33. package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +5 -0
  34. package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +2 -1
  35. package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +3 -2
  36. package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +3 -2
  37. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
  38. package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +66 -0
  39. package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +4 -1
  40. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +5 -11
  41. package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
  42. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
  43. package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +1 -1
  44. package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
  45. package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
  46. package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +4 -12
  47. package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +0 -229
  48. package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
  49. package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
  50. package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
  51. package/Components/MasterCell/utils/behaviorProvider.ts +139 -0
  52. package/Components/MasterCell/utils/index.ts +9 -135
  53. package/Components/ModalComponent/Button/index.tsx +6 -6
  54. package/Components/ModalComponent/Header/index.tsx +3 -3
  55. package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
  56. package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
  57. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
  58. package/Components/PlayerContainer/PlayerContainer.tsx +26 -13
  59. package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
  60. package/Components/PlayerImageBackground/index.tsx +1 -1
  61. package/Components/River/ComponentsMap/ComponentsMap.tsx +42 -65
  62. package/Components/River/ComponentsMap/hooks/useLoadingState.ts +78 -51
  63. package/Components/River/RiverFooter.tsx +39 -9
  64. package/Components/River/RiverItem.tsx +37 -2
  65. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +100 -31
  66. package/Components/River/__tests__/__snapshots__/river.test.js.snap +20 -82
  67. package/Components/River/__tests__/componentsMap.test.js +17 -5
  68. package/Components/River/__tests__/river.test.js +75 -40
  69. package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -4
  70. package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
  71. package/Components/RouteManager/__tests__/testId.test.js +8 -6
  72. package/Components/Screen/TV/index.web.tsx +5 -6
  73. package/Components/Screen/hooks.ts +53 -0
  74. package/Components/Screen/index.tsx +16 -42
  75. package/Components/ScreenResolver/__tests__/screenResolver.test.js +91 -70
  76. package/Components/Tabs/Tab.tsx +11 -9
  77. package/Components/TextInputTv/index.tsx +4 -3
  78. package/Components/TrackedView/index.tsx +1 -0
  79. package/Components/Transitioner/AnimationManager.js +15 -15
  80. package/Components/Transitioner/Scene.tsx +53 -24
  81. package/Components/Transitioner/Transitioner.tsx +3 -3
  82. package/Components/Transitioner/__tests__/Scene.test.js +25 -14
  83. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +9 -49
  84. package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +2 -2
  85. package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
  86. package/Components/Transitioner/index.js +8 -4
  87. package/Components/VideoLive/LiveImageManager.ts +27 -1
  88. package/Components/VideoLive/PlayerLiveImageComponent.tsx +36 -24
  89. package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +51 -1
  90. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +1 -5
  91. package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +1 -1
  92. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +44 -30
  93. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +3 -3
  94. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +31 -17
  95. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +4 -5
  96. package/Components/VideoModal/ModalAnimation/utils.ts +2 -2
  97. package/Components/VideoModal/OpaqueLayer.tsx +33 -0
  98. package/Components/VideoModal/PlayerDetails.tsx +9 -6
  99. package/Components/VideoModal/PlayerWrapper.tsx +17 -36
  100. package/Components/VideoModal/VideoModal.tsx +14 -23
  101. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -1
  102. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +0 -90
  103. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
  104. package/Components/VideoModal/hooks/index.ts +7 -0
  105. package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -0
  106. package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
  107. package/Components/VideoModal/hooks/utils/index.ts +33 -0
  108. package/Components/VideoModal/utils.ts +1 -1
  109. package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
  110. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
  111. package/Components/Viewport/__tests__/utils.test.js +5 -4
  112. package/Components/ZappUIComponent/Placeholder.tsx +3 -1
  113. package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
  114. package/Components/ZappUIComponent/index.tsx +3 -16
  115. package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
  116. package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
  117. package/Contexts/ComponentsMapOffsetContext/index.tsx +14 -6
  118. package/Contexts/FocusableGroupContext/withFocusableContext.tsx +4 -10
  119. package/Contexts/HeaderOffsetContext/index.tsx +4 -6
  120. package/Contexts/ScreenContext/index.tsx +6 -12
  121. package/Contexts/ScreenLayoutContext/index.tsx +5 -3
  122. package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
  123. package/Decorators/Navigator/index.tsx +1 -1
  124. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +18 -24
  125. package/Decorators/RiverResolver/index.tsx +6 -8
  126. package/Decorators/ZappPipesDataConnector/__tests__/Hero.js +1 -1
  127. package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
  128. package/Decorators/ZappPipesDataConnector/index.tsx +4 -1
  129. package/package.json +7 -10
  130. package/tsconfig.json +2 -3
  131. package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
  132. package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
  133. package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
  134. package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
  135. package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
  136. package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
  137. 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 { shallow } from "enzyme";
4
- import { shallowToJson } from "enzyme-to-json";
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 wrapper = shallow(
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(shallowToJson(wrapper)).toMatchSnapshot();
28
+ expect(toJSON()).toMatchSnapshot();
31
29
  });
32
30
  });
@@ -24,6 +24,7 @@ type Props = {
24
24
  audio_player_rtl?: boolean;
25
25
  magic_background?: boolean;
26
26
  audio_player_background_image_query?: string;
27
+ audio_player_background_image_default_color?: string;
27
28
  start_time?: string;
28
29
  end_time?: string;
29
30
  };
@@ -35,6 +36,7 @@ type Props = {
35
36
  audio_player_rtl?: string;
36
37
  magic_background?: string;
37
38
  audio_player_background_image_query?: string;
39
+ audio_player_background_image_default_color?: string;
38
40
  audio_player_background_image?: string;
39
41
  audio_player_artwork_aspect_ratio?: string;
40
42
  lg_tv_audio_player_title_font_family?: string;
@@ -80,6 +82,10 @@ export function AudioPlayer(props: Props) {
80
82
  "audio_player_background_image_query"
81
83
  );
82
84
 
85
+ const audioPlayerBackgroundImageDefaultColor = getProp(
86
+ "audio_player_background_image_default_color"
87
+ );
88
+
83
89
  const isRTL = rtlFlag === "1" || rtlFlag === "true" || rtlFlag === true;
84
90
 
85
91
  const titleFontFamily = getProp(
@@ -158,6 +164,7 @@ export function AudioPlayer(props: Props) {
158
164
  channelIcon,
159
165
  magicBackground,
160
166
  audioPlayerBackgroundImageQuery,
167
+ audioPlayerBackgroundImageDefaultColor,
161
168
  };
162
169
  }, [getProp]);
163
170
 
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
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 wrapper = shallow(<Runtime {...RuntimeProps(true)} />);
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 wrapper = shallow(<Runtime {...RuntimeProps(false)} />);
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
- <AudioPlayerLayout
5
- config={
4
+ <View
5
+ pointerEvents="none"
6
+ style={
6
7
  {
7
- "artworkAspectRatio": "1:1",
8
- "audioPlayerBackgroundImageQuery": "",
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
- <Channel
27
- config={
13
+ <View
14
+ collapsable={false}
15
+ style={
28
16
  {
29
- "artworkAspectRatio": "1:1",
30
- "audioPlayerBackgroundImageQuery": "",
31
- "backgroundColor": "black",
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
- srcImage="https://example.com"
47
- />
48
- <Title
49
- config={
50
- {
51
- "artworkAspectRatio": "1:1",
52
- "audioPlayerBackgroundImageQuery": "",
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
- summary="Summary"
91
- />
92
- <Runtime
93
- audio_player_artwork_aspect_ratio="1:1"
94
- audio_player_background_color="black"
95
- audio_player_background_image="https://example.com"
96
- audio_player_channel_icon="https://example.com"
97
- audio_player_rtl={true}
98
- audio_player_summary_color="white"
99
- audio_player_title_color="white"
100
- config={
101
- {
102
- "artworkAspectRatio": "1:1",
103
- "audioPlayerBackgroundImageQuery": "",
104
- "backgroundColor": "black",
105
- "backgroundImage": "https://example.com",
106
- "channelIcon": "https://example.com",
107
- "isRTL": true,
108
- "magicBackground": false,
109
- "runTimeFontFamily": undefined,
110
- "runTimeFontSize": undefined,
111
- "summaryColor": "white",
112
- "summaryFontFamily": undefined,
113
- "summaryFontSize": undefined,
114
- "titleColor": "white",
115
- "titleFontFamily": undefined,
116
- "titleFontSize": undefined,
117
- }
118
- }
119
- end_time="11:11"
120
- start_time="10:10"
121
- />
122
- </AudioPlayerLayout>
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 /> renders correctly 1`] = `
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
- <ForwardRef(AnimatedComponentWrapper)
13
+ <View
14
+ collapsable={false}
14
15
  style={
15
- [
16
- {
17
- "backgroundColor": "transparent",
18
- "overflow": "hidden",
19
- },
20
- {
21
- "opacity": 0,
22
- },
23
- ]
16
+ {
17
+ "backgroundColor": "transparent",
18
+ "opacity": 0,
19
+ "overflow": "hidden",
20
+ }
24
21
  }
25
22
  >
26
- <ImageBackground
27
- resizeMode="cover"
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
- </ImageBackground>
48
- </ForwardRef(AnimatedComponentWrapper)>
63
+ </View>
64
+ </View>
49
65
  </View>
50
66
  `;
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import { shallow } from "enzyme";
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
- expect(shallowToJson(wrapper)).toMatchSnapshot();
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 { shallow } from "enzyme";
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
- expect(shallowToJson(wrapper)).toMatchSnapshot();
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 { shallow } from "enzyme";
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
- jest.useFakeTimers();
20
-
21
- describe("<AudioPlayerLayout />", () => {
22
- const wrapper = shallow(<AudioPlayerLayout {...audioPlayerLayoutProps} />);
23
-
18
+ describe("<AudioPlayerLayout />", () => {
24
19
  it("renders correctly", () => {
25
- expect(shallowToJson(wrapper)).toMatchSnapshot();
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 { shallow } from "enzyme";
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
- expect(shallowToJson(wrapper)).toMatchSnapshot();
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 { shallow } from "enzyme";
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
- expect(shallowToJson(wrapper)).toMatchSnapshot();
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 { shallow } from "enzyme";
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
- expect(shallowToJson(wrapper)).toMatchSnapshot();
19
+ const { toJSON } = render(<Title {...titleProps} />);
20
+ expect(toJSON()).toMatchSnapshot();
23
21
  });
24
22
  });
@@ -6,6 +6,7 @@ const defaults = {
6
6
  audio_player_rtl: false,
7
7
  magic_background: false,
8
8
  audio_player_background_image_query: "",
9
+ audio_player_background_image_default_color: "",
9
10
  };
10
11
 
11
12
  export function getPropertyFromEntryOrConfig({ entry, plugin_configuration }) {
@@ -25,7 +25,7 @@ type Props = {
25
25
  };
26
26
 
27
27
  export class BaseFocusable<
28
- T extends Props = Props
28
+ T extends Props = Props,
29
29
  > extends BaseFocusableInterface<T> {
30
30
  constructor(props) {
31
31
  super(props);
@@ -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
 
@@ -35,7 +34,7 @@ type Props = {
35
34
  };
36
35
 
37
36
  export class BaseFocusable<
38
- T extends Props = Props
37
+ T extends Props = Props,
39
38
  > extends BaseFocusableInterface<T> {
40
39
  constructor(props) {
41
40
  super(props);
@@ -45,7 +44,7 @@ export class BaseFocusable<
45
44
  focused: initialFocus || false,
46
45
  };
47
46
 
48
- this.ref = createReactRef();
47
+ this.ref = React.createRef();
49
48
  }
50
49
 
51
50
  componentDidMount() {
@@ -274,10 +274,14 @@ export class CellComponent extends React.Component<Props, State> {
274
274
  if (isFocused) {
275
275
  const accessibilityManager = AccessibilityManager.getInstance();
276
276
 
277
+ const accessibilityTitle =
278
+ item?.extensions?.accessibility?.label || item?.title || "";
279
+
280
+ const accessibilityHint =
281
+ item?.extensions?.accessibility?.hint || "";
282
+
277
283
  accessibilityManager.readText({
278
- text: String(
279
- item.extensions?.accessibility?.label || item.title
280
- ),
284
+ text: `${accessibilityTitle} ${accessibilityHint}`,
281
285
  });
282
286
  }
283
287