@applicaster/zapp-react-native-ui-components 13.0.0-rc.13 → 13.0.0-rc.131

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 (212) hide show
  1. package/Components/AppContainer/__tests__/AppContainer.test.js +4 -6
  2. package/Components/AppContainer/__tests__/__snapshots__/AppContainer.test.js.snap +1 -1
  3. package/Components/AudioPlayer/AudioPlayer.tsx +5 -9
  4. package/Components/AudioPlayer/AudioPlayerLayout.tsx +6 -7
  5. package/Components/AudioPlayer/__tests__/Runtime.test.js +5 -8
  6. package/Components/AudioPlayer/__tests__/__snapshots__/Runtime.test.js.snap +4 -4
  7. package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +3 -3
  8. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayer.test.js.snap +56 -113
  9. package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +39 -23
  10. package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +3 -3
  11. package/Components/AudioPlayer/__tests__/__snapshots__/summary.test.js.snap +2 -2
  12. package/Components/AudioPlayer/__tests__/__snapshots__/title.test.js.snap +2 -2
  13. package/Components/AudioPlayer/__tests__/artWork.test.js +3 -5
  14. package/Components/AudioPlayer/__tests__/audioPlayer.test.js +3 -5
  15. package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +7 -8
  16. package/Components/AudioPlayer/__tests__/channel.test.js +3 -5
  17. package/Components/AudioPlayer/__tests__/summary.test.js +3 -5
  18. package/Components/AudioPlayer/__tests__/title.test.js +3 -5
  19. package/Components/AudioPlayer/helpers.tsx +1 -2
  20. package/Components/BaseFocusable/index.ios.ts +1 -1
  21. package/Components/BaseFocusable/index.tsx +67 -31
  22. package/Components/Cell/Cell.tsx +14 -14
  23. package/Components/Cell/CellWithFocusable.tsx +50 -59
  24. package/Components/Cell/CellWrapper.tsx +18 -0
  25. package/Components/Cell/TvOSCellComponent.tsx +20 -26
  26. package/Components/Cell/__tests__/CellWIthFocusable.test.js +13 -6
  27. package/Components/Cell/index.js +3 -1
  28. package/Components/Cell/styles.ts +17 -0
  29. package/Components/CellRendererResolver/__tests__/cellRendererResolver.test.js +50 -50
  30. package/Components/CellRendererResolver/index.ts +2 -1
  31. package/Components/ComponentResolver/__tests__/__snapshots__/componentResolver.test.js.snap +1 -42
  32. package/Components/ComponentResolver/__tests__/componentResolver.test.js +26 -30
  33. package/Components/ContentScreen/__tests__/contentScreen.test.js +3 -3
  34. package/Components/DisplayState/__tests__/__snapshots__/displayState.test.js.snap +2 -2
  35. package/Components/ErrorScreen/index.tsx +14 -6
  36. package/Components/Focusable/Focusable.tsx +1 -54
  37. package/Components/Focusable/FocusableTvOS.tsx +6 -2
  38. package/Components/Focusable/Touchable.tsx +19 -20
  39. package/Components/Focusable/index.android.tsx +10 -3
  40. package/Components/FocusableCell/index.tsx +1 -1
  41. package/Components/FocusableGroup/FocusableTvOS.tsx +34 -86
  42. package/Components/FocusableGroup/index.tsx +0 -3
  43. package/Components/FocusableList/index.tsx +26 -10
  44. package/Components/FocusableScrollView/index.tsx +43 -13
  45. package/Components/GeneralContentScreen/GeneralContentScreen.tsx +3 -0
  46. package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +9 -0
  47. package/Components/GeneralContentScreen/utils/useCurationAPI.ts +5 -3
  48. package/Components/GeneralContentScreen/utils/useEventAlerts.ts +30 -0
  49. package/Components/HandlePlayable/HandlePlayable.tsx +21 -27
  50. package/Components/Layout/TV/LayoutBackground.tsx +28 -0
  51. package/Components/Layout/TV/NavBarContainer.tsx +19 -23
  52. package/Components/Layout/TV/ScreenContainer.tsx +8 -2
  53. package/Components/Layout/TV/ScreenLayoutContextProvider.tsx +5 -0
  54. package/Components/Layout/TV/__tests__/ScreenContainer.test.tsx +3 -1
  55. package/Components/Layout/TV/__tests__/__snapshots__/LayoutContainer.test.tsx.snap +1 -1
  56. package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +6 -5
  57. package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +12 -11
  58. package/Components/Layout/TV/__tests__/__snapshots__/index.test.tsx.snap +15 -10
  59. package/Components/Layout/TV/__tests__/index.test.tsx +14 -4
  60. package/Components/Layout/TV/index.tsx +6 -20
  61. package/Components/Layout/TV/index.web.tsx +4 -1
  62. package/Components/MasterCell/DefaultComponents/ActionButton.tsx +2 -3
  63. package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +66 -0
  64. package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +4 -1
  65. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +10 -15
  66. package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +11 -7
  67. package/Components/MasterCell/DefaultComponents/ImageBorderContainer/__tests__/index.test.ts +93 -0
  68. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +2 -2
  69. package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +3 -3
  70. package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +1 -1
  71. package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
  72. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/const.ts +3 -0
  73. package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/index.ts +6 -6
  74. package/Components/MasterCell/SharedUI/CollapsibleTextContainer/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  75. package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +2 -8
  76. package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +180 -180
  77. package/Components/MasterCell/__tests__/__snapshots__/elementMapper.test.js.snap +11 -19
  78. package/Components/MasterCell/__tests__/__snapshots__/masterCell.test.js.snap +6 -235
  79. package/Components/MasterCell/__tests__/elementMapper.test.js +18 -5
  80. package/Components/MasterCell/__tests__/masterCell.test.js +26 -26
  81. package/Components/MasterCell/hooks/useAsyncRendering/MasterCellAsyncRenderManager.ts +2 -2
  82. package/Components/MasterCell/hooks/useAsyncRendering/index.ts +2 -2
  83. package/Components/MasterCell/utils/behaviorProvider.ts +136 -0
  84. package/Components/MasterCell/utils/index.ts +9 -135
  85. package/Components/ModalComponent/BottomSheetModalContent.tsx +66 -54
  86. package/Components/ModalComponent/Button/Item.tsx +6 -5
  87. package/Components/ModalComponent/Button/assets.ts +1 -1
  88. package/Components/ModalComponent/Button/index.tsx +45 -62
  89. package/Components/ModalComponent/Header/index.tsx +12 -11
  90. package/Components/ModalComponent/utils.ts +55 -7
  91. package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +2 -2
  92. package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +2 -2
  93. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -5
  94. package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +7 -7
  95. package/Components/OfflineHandler/__tests__/index.test.tsx +28 -25
  96. package/Components/OfflineHandler/utils/index.ts +1 -1
  97. package/Components/PlayerContainer/PlayerContainer.tsx +49 -29
  98. package/Components/PlayerContainer/PlayerContainerContext.tsx +9 -0
  99. package/Components/PlayerContainer/ProgramInfo/index.tsx +2 -2
  100. package/Components/PlayerImageBackground/index.tsx +1 -1
  101. package/Components/River/ComponentsMap/ComponentsMap.tsx +53 -68
  102. package/Components/River/ComponentsMap/hooks/useLoadingState.ts +78 -51
  103. package/Components/River/RefreshControl.tsx +1 -1
  104. package/Components/River/RiverFooter.tsx +39 -9
  105. package/Components/River/RiverItem.tsx +43 -3
  106. package/Components/River/TV/index.tsx +6 -1
  107. package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +121 -46
  108. package/Components/River/__tests__/__snapshots__/river.test.js.snap +21 -83
  109. package/Components/River/__tests__/componentsMap.test.js +64 -17
  110. package/Components/River/__tests__/river.test.js +75 -40
  111. package/Components/RouteManager/TestId.tsx +1 -5
  112. package/Components/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +11 -5
  113. package/Components/RouteManager/__tests__/routeManager.test.js +29 -14
  114. package/Components/RouteManager/__tests__/testId.test.js +4 -6
  115. package/Components/Screen/TV/__tests__/index.web.test.tsx +26 -0
  116. package/Components/Screen/TV/index.web.tsx +5 -6
  117. package/Components/Screen/__tests__/Screen.test.tsx +53 -31
  118. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +6 -6
  119. package/Components/Screen/hooks.ts +53 -0
  120. package/Components/Screen/index.tsx +16 -42
  121. package/Components/ScreenResolver/__tests__/screenResolver.test.js +95 -70
  122. package/Components/Tabs/Tab.tsx +12 -9
  123. package/Components/TextInputTv/__tests__/TextInputTv.test.js +42 -42
  124. package/Components/TextInputTv/__tests__/__snapshots__/TextInputTv.test.js.snap +7 -0
  125. package/Components/TextInputTv/index.tsx +6 -5
  126. package/Components/TopMarginApplicator/TopMarginApplicator.tsx +2 -3
  127. package/Components/Touchable/__tests__/__snapshots__/touchable.test.tsx.snap +2 -2
  128. package/Components/TrackedView/index.tsx +1 -0
  129. package/Components/Transitioner/AnimationManager.js +15 -15
  130. package/Components/Transitioner/Scene.tsx +53 -24
  131. package/Components/Transitioner/Transitioner.tsx +3 -3
  132. package/Components/Transitioner/__tests__/Scene.test.js +25 -14
  133. package/Components/Transitioner/__tests__/__snapshots__/AnimationManager.test.js.snap +26 -26
  134. package/Components/Transitioner/__tests__/__snapshots__/Scene.test.js.snap +10 -50
  135. package/Components/Transitioner/__tests__/__snapshots__/config.test.js.snap +20 -20
  136. package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +4 -4
  137. package/Components/Transitioner/__tests__/transitioner.test.js +13 -4
  138. package/Components/Transitioner/index.js +8 -4
  139. package/Components/VideoLive/LiveImageManager.ts +27 -1
  140. package/Components/VideoLive/PlayerLiveImageComponent.tsx +36 -24
  141. package/Components/VideoLive/__tests__/PlayerLiveImageComponent.test.tsx +63 -8
  142. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +6 -10
  143. package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +1 -1
  144. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +51 -31
  145. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +8 -4
  146. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +48 -23
  147. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +16 -15
  148. package/Components/VideoModal/ModalAnimation/__tests__/getMoveUpValue.test.ts +108 -0
  149. package/Components/VideoModal/ModalAnimation/const.ts +5 -0
  150. package/Components/VideoModal/ModalAnimation/index.ts +4 -1
  151. package/Components/VideoModal/ModalAnimation/useModalAnimationContext.ts +6 -0
  152. package/Components/VideoModal/ModalAnimation/utils.ts +32 -2
  153. package/Components/VideoModal/OpaqueLayer.tsx +33 -0
  154. package/Components/VideoModal/PlayerDetails.tsx +18 -10
  155. package/Components/VideoModal/PlayerWrapper.tsx +51 -57
  156. package/Components/VideoModal/VideoModal.tsx +17 -11
  157. package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +5 -2
  158. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +13 -10
  159. package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +2 -40
  160. package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +66 -156
  161. package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +89 -0
  162. package/Components/VideoModal/hooks/index.ts +7 -0
  163. package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +49 -0
  164. package/Components/VideoModal/hooks/utils/__tests__/showDetails.test.ts +91 -0
  165. package/Components/VideoModal/hooks/utils/index.ts +33 -0
  166. package/Components/VideoModal/utils.ts +6 -9
  167. package/Components/Viewport/ViewportAware/__tests__/__snapshots__/viewportAware.test.js.snap +24 -36
  168. package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +12 -18
  169. package/Components/Viewport/ViewportTracker/__tests__/__snapshots__/viewportTracker.test.js.snap +1 -1
  170. package/Components/Viewport/__tests__/utils.test.js +5 -4
  171. package/Components/ZappUIComponent/Placeholder.tsx +3 -1
  172. package/Components/ZappUIComponent/__tests__/{ZappUIComponent.test.js → ZappUIComponent.test.tsx} +26 -10
  173. package/Components/ZappUIComponent/index.tsx +4 -17
  174. package/Components/default-cell-renderer/__tests__/defaultCellRenderer.test.tsx +20 -17
  175. package/Components/default-cell-renderer/viewTrees/tv/DefaultCell/__tests__/DefaultCell.test.tsx +15 -11
  176. package/Contexts/ComponentsMapOffsetContext/index.tsx +49 -0
  177. package/Contexts/ConfigutaionContext/__tests__/__snapshots__/ConfigurationProvider.test.tsx.snap +1 -1
  178. package/Contexts/FocusableGroupContext/withFocusableContext.tsx +4 -10
  179. package/Contexts/HeaderOffsetContext/index.tsx +4 -6
  180. package/Contexts/ScreenContext/index.tsx +6 -12
  181. package/Contexts/ScreenLayoutContext/index.tsx +5 -3
  182. package/Decorators/Navigator/__tests__/navigator.test.js +16 -16
  183. package/Decorators/Navigator/index.tsx +1 -1
  184. package/Decorators/RiverFeedLoader/__tests__/__snapshots__/riverFeedLoader.test.tsx.snap +77 -77
  185. package/Decorators/RiverFeedLoader/__tests__/riverFeedLoader.test.tsx +34 -39
  186. package/Decorators/RiverFeedLoader/__tests__/utils.test.ts +0 -9
  187. package/Decorators/RiverFeedLoader/index.tsx +1 -1
  188. package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +39 -0
  189. package/Decorators/RiverFeedLoader/utils/index.ts +29 -0
  190. package/Decorators/RiverFeedLoader/utils/usePipesContexts.ts +40 -0
  191. package/Decorators/RiverResolver/__tests__/riverResolver.test.tsx +27 -27
  192. package/Decorators/RiverResolver/index.tsx +6 -8
  193. package/Decorators/ZappPipesDataConnector/__tests__/Hero.js +1 -1
  194. package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +29 -22
  195. package/Decorators/ZappPipesDataConnector/index.tsx +7 -3
  196. package/package.json +13 -11
  197. package/tsconfig.json +2 -3
  198. package/.babelrc +0 -8
  199. package/Components/Cell/CellStyles/FallbackCellStyle/index.js +0 -157
  200. package/Components/Cell/CellStyles/Hero/index.js +0 -111
  201. package/Components/Cell/CellStyles/ScreenSelector/index.js +0 -68
  202. package/Components/Cell/CellStyles/cellStylesResolver.ts +0 -19
  203. package/Components/Cell/CellStyles/colors.js +0 -40
  204. package/Components/Cell/CellStyles/index.js +0 -15
  205. package/Components/CellRendererResolver/__tests__/__snapshots__/cellRendererResolver.test.js.snap +0 -53
  206. package/Components/RouteManager/__tests__/__snapshots__/testId.test.js.snap +0 -17
  207. package/Components/ScreenResolver/__tests__/__snapshots__/screenResolver.test.js.snap +0 -17
  208. package/Components/ZappUIComponent/__tests__/__snapshots__/ZappUIComponent.test.js.snap +0 -91
  209. package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +0 -338
  210. package/Decorators/Navigator/__tests__/__snapshots__/navigator.test.js.snap +0 -18
  211. package/Decorators/RiverFeedLoader/utils.ts +0 -100
  212. 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
  });
@@ -3,7 +3,7 @@
3
3
  exports[`<AppContainer /> renders correctly 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
6
+ {
7
7
  "backgroundColor": "rgba(255, 255, 255, 1)",
8
8
  "flex": 1,
9
9
  }
@@ -22,8 +22,7 @@ type Props = {
22
22
  audio_player_title_color?: string;
23
23
  audio_player_summary_color?: string;
24
24
  audio_player_rtl?: boolean;
25
- magic_background?: boolean;
26
- audio_player_background_image_query?: string;
25
+ audio_player_background_image_default_color?: string;
27
26
  start_time?: string;
28
27
  end_time?: string;
29
28
  };
@@ -33,8 +32,7 @@ type Props = {
33
32
  audio_player_title_color?: string;
34
33
  audio_player_summary_color?: string;
35
34
  audio_player_rtl?: string;
36
- magic_background?: string;
37
- audio_player_background_image_query?: string;
35
+ audio_player_background_image_default_color?: string;
38
36
  audio_player_background_image?: string;
39
37
  audio_player_artwork_aspect_ratio?: string;
40
38
  lg_tv_audio_player_title_font_family?: string;
@@ -74,10 +72,9 @@ export function AudioPlayer(props: Props) {
74
72
  const artworkAspectRatio = getProp("audio_player_artwork_aspect_ratio");
75
73
  const channelIcon = getProp("audio_player_channel_icon");
76
74
  const rtlFlag = getProp("audio_player_rtl");
77
- const magicBackground = getProp("magic_background");
78
75
 
79
- const audioPlayerBackgroundImageQuery = getProp(
80
- "audio_player_background_image_query"
76
+ const audioPlayerBackgroundImageDefaultColor = getProp(
77
+ "audio_player_background_image_default_color"
81
78
  );
82
79
 
83
80
  const isRTL = rtlFlag === "1" || rtlFlag === "true" || rtlFlag === true;
@@ -156,8 +153,7 @@ export function AudioPlayer(props: Props) {
156
153
  runTimeFontSize,
157
154
  artworkAspectRatio,
158
155
  channelIcon,
159
- magicBackground,
160
- audioPlayerBackgroundImageQuery,
156
+ audioPlayerBackgroundImageDefaultColor,
161
157
  };
162
158
  }, [getProp]);
163
159
 
@@ -32,7 +32,7 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
32
32
 
33
33
  const { isRTL, backgroundColor, backgroundImage } = config;
34
34
 
35
- const backgroundImg = { uri: backgroundImage };
35
+ const backgroundImageSource = { uri: backgroundImage };
36
36
 
37
37
  const backgroundColorStyle = backgroundImage
38
38
  ? "transparent"
@@ -103,9 +103,8 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
103
103
  justifyContent: "center",
104
104
  },
105
105
  android_tv: {
106
- position: "absolute",
107
- width: 1920,
108
- height: 1080,
106
+ width: "100%",
107
+ height: "100%",
109
108
  alignItems: "center",
110
109
  justifyContent: "center",
111
110
  },
@@ -146,9 +145,9 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
146
145
  },
147
146
  });
148
147
 
149
- const audioPlayerLayoutTV = backgroundImg?.uri ? (
148
+ const audioPlayerLayoutTV = backgroundImageSource?.uri ? (
150
149
  <ImageBackground
151
- source={backgroundImg}
150
+ source={backgroundImageSource}
152
151
  style={backgroundImgStyles}
153
152
  resizeMode="cover"
154
153
  >
@@ -178,7 +177,7 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
178
177
  ]}
179
178
  >
180
179
  <ImageBackground
181
- source={backgroundImg}
180
+ source={backgroundImageSource}
182
181
  style={backgroundImgStyles}
183
182
  resizeMode="cover"
184
183
  >
@@ -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
  });
@@ -3,7 +3,7 @@
3
3
  exports[`<Runtime /> LTR renders correctly 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
6
+ {
7
7
  "height": 40,
8
8
  "justifyContent": "flex-start",
9
9
  "width": 600,
@@ -12,7 +12,7 @@ exports[`<Runtime /> LTR renders correctly 1`] = `
12
12
  >
13
13
  <Text
14
14
  style={
15
- Object {
15
+ {
16
16
  "alignItems": "flex-end",
17
17
  "color": "white",
18
18
  "flexDirection": "row",
@@ -32,7 +32,7 @@ exports[`<Runtime /> LTR renders correctly 1`] = `
32
32
  exports[`<Runtime /> RTL renders correctly 1`] = `
33
33
  <View
34
34
  style={
35
- Object {
35
+ {
36
36
  "height": 40,
37
37
  "justifyContent": "flex-end",
38
38
  "width": 600,
@@ -41,7 +41,7 @@ exports[`<Runtime /> RTL renders correctly 1`] = `
41
41
  >
42
42
  <Text
43
43
  style={
44
- Object {
44
+ {
45
45
  "alignItems": "flex-start",
46
46
  "color": "white",
47
47
  "flexDirection": "row-reverse",
@@ -3,7 +3,7 @@
3
3
  exports[`<Artwork /> renders correctly 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
6
+ {
7
7
  "marginHorizontal": 24,
8
8
  }
9
9
  }
@@ -12,12 +12,12 @@ exports[`<Artwork /> renders correctly 1`] = `
12
12
  fadeDuration={0}
13
13
  resizeMode="cover"
14
14
  source={
15
- Object {
15
+ {
16
16
  "uri": "https://example.com",
17
17
  }
18
18
  }
19
19
  style={
20
- Object {
20
+ {
21
21
  "height": 400,
22
22
  "width": 400,
23
23
  }
@@ -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={
6
- Object {
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,
4
+ <View
5
+ pointerEvents="none"
6
+ style={
7
+ {
8
+ "backgroundColor": "transparent",
9
+ "overflow": "hidden",
22
10
  }
23
11
  }
24
- style={Object {}}
25
12
  >
26
- <Channel
27
- config={
28
- Object {
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,
13
+ <View
14
+ collapsable={false}
15
+ style={
16
+ {
17
+ "backgroundColor": "transparent",
18
+ "opacity": 0,
19
+ "overflow": "hidden",
44
20
  }
45
21
  }
46
- srcImage="https://example.com"
47
- />
48
- <Title
49
- config={
50
- Object {
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,
22
+ >
23
+ <View
24
+ accessibilityIgnoresInvertColors={true}
25
+ style={
26
+ {
27
+ "flex": 1,
28
+ }
66
29
  }
67
- }
68
- title="tittle"
69
- />
70
- <Summary
71
- config={
72
- Object {
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,
88
- }
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
- Object {
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,50 +1,66 @@
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={
7
- Object {
7
+ {
8
8
  "backgroundColor": "transparent",
9
9
  "overflow": "hidden",
10
10
  }
11
11
  }
12
12
  >
13
- <ForwardRef(AnimatedComponentWrapper)
13
+ <View
14
+ collapsable={false}
14
15
  style={
15
- Array [
16
- Object {
17
- "backgroundColor": "transparent",
18
- "overflow": "hidden",
19
- },
20
- Object {
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
- Object {
30
- "uri": "https://example.com",
31
- }
32
- }
23
+ <View
24
+ accessibilityIgnoresInvertColors={true}
33
25
  style={
34
- Object {
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
- Object {
57
+ {
42
58
  "backgroundColor": "transparent",
43
59
  "overflow": "hidden",
44
60
  }
45
61
  }
46
62
  />
47
- </ImageBackground>
48
- </ForwardRef(AnimatedComponentWrapper)>
63
+ </View>
64
+ </View>
49
65
  </View>
50
66
  `;
@@ -3,7 +3,7 @@
3
3
  exports[`<Channel /> renders correctly 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
6
+ {
7
7
  "height": 72,
8
8
  "marginBottom": 30,
9
9
  "width": 128,
@@ -13,12 +13,12 @@ exports[`<Channel /> renders correctly 1`] = `
13
13
  <Image
14
14
  fadeDuration={0}
15
15
  source={
16
- Object {
16
+ {
17
17
  "uri": "https://example.com",
18
18
  }
19
19
  }
20
20
  style={
21
- Object {
21
+ {
22
22
  "height": 72,
23
23
  "width": 128,
24
24
  }
@@ -3,7 +3,7 @@
3
3
  exports[`<Summary /> renders correctly 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
6
+ {
7
7
  "height": 80,
8
8
  "marginBottom": 30,
9
9
  "width": 600,
@@ -13,7 +13,7 @@ exports[`<Summary /> renders correctly 1`] = `
13
13
  <Text
14
14
  numberOfLines={2}
15
15
  style={
16
- Object {
16
+ {
17
17
  "color": "white",
18
18
  "fontFamily": null,
19
19
  "fontSize": 20,
@@ -3,7 +3,7 @@
3
3
  exports[`<Title /> renders correctly 1`] = `
4
4
  <View
5
5
  style={
6
- Object {
6
+ {
7
7
  "height": 100,
8
8
  "marginBottom": 12,
9
9
  "width": 600,
@@ -13,7 +13,7 @@ exports[`<Title /> renders correctly 1`] = `
13
13
  <Text
14
14
  numberOfLines={2}
15
15
  style={
16
- Object {
16
+ {
17
17
  "color": "white",
18
18
  "fontFamily": null,
19
19
  "fontSize": 38,
@@ -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
  });