@blaze-cms/react-page-builder 0.146.0-core-styles.42 → 0.146.0-node18.0

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 (278) hide show
  1. package/CHANGELOG.md +31 -197
  2. package/lib/HOC/recreateOnNavigation.js.map +1 -1
  3. package/lib/HOC/withTitle.js.map +1 -1
  4. package/lib/application/query/index.js +1 -0
  5. package/lib/application/query/index.js.map +1 -1
  6. package/lib/components/BackToTop/BackToTop.js.map +1 -1
  7. package/lib/components/Banner/AdSlotRender.js +1 -1
  8. package/lib/components/Banner/Banner.js +1 -1
  9. package/lib/components/Banner/BannerRender.js.map +1 -1
  10. package/lib/components/Breadcrumb/Breadcrumb.js +1 -1
  11. package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
  12. package/lib/components/Button.js.map +1 -1
  13. package/lib/components/Card/CardsContainer.js +1 -1
  14. package/lib/components/Card/CardsFactory.js.map +1 -1
  15. package/lib/components/Card/CardsRender.js.map +1 -1
  16. package/lib/components/Carousel/CarouselRender/CarouselRender.js +1 -0
  17. package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
  18. package/lib/components/CarouselWrapper/DefaultCarousel.js.map +1 -1
  19. package/lib/components/ContentGroup/ContentGroupTabs.js +1 -1
  20. package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  21. package/lib/components/ContentGroup/helpers/get-sections-data.js +1 -0
  22. package/lib/components/ContentGroup/helpers/get-sections-data.js.map +1 -1
  23. package/lib/components/DataSummary/DataSummaryRender.js +1 -0
  24. package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
  25. package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js +1 -1
  26. package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js +1 -1
  27. package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js +1 -1
  28. package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js +1 -1
  29. package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js +1 -1
  30. package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
  31. package/lib/components/DateTime/DateTime.js +4 -4
  32. package/lib/components/DateTime/DateTime.js.map +1 -1
  33. package/lib/components/EmailConfirm/EmailConfirm.js +3 -3
  34. package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
  35. package/lib/components/Image/GlobalLightbox/GlobalLightbox.js +2 -2
  36. package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
  37. package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
  38. package/lib/components/Image/Image.js.map +1 -1
  39. package/lib/components/Image/ImageFactory.js +1 -1
  40. package/lib/components/Image/ImageFactory.js.map +1 -1
  41. package/lib/components/ItemList/helpers/get-item-list-ids.js +1 -0
  42. package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -1
  43. package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -1
  44. package/lib/components/Layout/LayoutFactory.js.map +1 -1
  45. package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -1
  46. package/lib/components/List/ListFactory.js.map +1 -1
  47. package/lib/components/List/ListRender.js.map +1 -1
  48. package/lib/components/List/components/Cards/CardsRenderWrapper.js +1 -1
  49. package/lib/components/List/components/Full/FullRender.js +1 -1
  50. package/lib/components/List/components/Full/FullRenderItem.js +1 -1
  51. package/lib/components/List/components/Header/ListHeader.js +1 -0
  52. package/lib/components/List/components/Header/ListHeader.js.map +1 -1
  53. package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
  54. package/lib/components/List/components/Pagination/LoadMore.js +2 -2
  55. package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
  56. package/lib/components/List/helpers/build-query-booster.js +1 -1
  57. package/lib/components/List/helpers/sort-aggs.js.map +1 -1
  58. package/lib/components/Menu/Menu.js.map +1 -1
  59. package/lib/components/MenuItem/MenuItemRender.js.map +1 -1
  60. package/lib/components/ModalAdapter/index.js.map +1 -1
  61. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  62. package/lib/components/SearchContent/SearchContentItems.js +1 -0
  63. package/lib/components/SearchContent/SearchContentItems.js.map +1 -1
  64. package/lib/components/SearchFilter/SearchFilter/FiltersList.js +1 -1
  65. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  66. package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js +1 -0
  67. package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
  68. package/lib/components/SearchFilter/helpers/get-select-options.js +1 -0
  69. package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
  70. package/lib/components/SearchFilter/helpers/parse-filter-value.js +1 -0
  71. package/lib/components/SearchFilter/helpers/parse-filter-value.js.map +1 -1
  72. package/lib/components/SearchFilterSort/SearchFilterSort.js +1 -0
  73. package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  74. package/lib/components/SocialFollow/SocialFollowRender.js +1 -0
  75. package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
  76. package/lib/components/Video/providers/Vimeo/VimeoProvider.js.map +1 -1
  77. package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
  78. package/lib/components/Video/providers/get-provider.js.map +1 -1
  79. package/lib/components/Wrapper.js +2 -2
  80. package/lib/components/Wrapper.js.map +1 -1
  81. package/lib/components/index.js.map +1 -1
  82. package/lib/constants/index.js.map +1 -1
  83. package/lib/helpers/build-query-fields.js +1 -0
  84. package/lib/helpers/build-query-fields.js.map +1 -1
  85. package/lib/helpers/build-search-values-checkbox-select.js +1 -1
  86. package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
  87. package/lib/helpers/check-props-to-use.js +1 -0
  88. package/lib/helpers/check-props-to-use.js.map +1 -1
  89. package/lib/helpers/get-current-offset.js +4 -5
  90. package/lib/helpers/get-current-offset.js.map +1 -1
  91. package/lib/helpers/get-entities-with-banner.js +1 -1
  92. package/lib/helpers/get-wrapped-value-with-link.js +1 -0
  93. package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
  94. package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js +1 -0
  95. package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map +1 -1
  96. package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +1 -1
  97. package/lib/helpers/process-data-summary-value.js +1 -1
  98. package/lib/helpers/remove-unwanted-characters.js +1 -1
  99. package/lib/helpers/remove-unwanted-characters.js.map +1 -1
  100. package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
  101. package/lib/hooks/helpers/get-components-to-insert-by-type.js.map +1 -1
  102. package/lib/hooks/helpers/get-lightbox-images.js +1 -1
  103. package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
  104. package/lib/hooks/use-check-mobile-screen.js.map +1 -1
  105. package/lib/hooks/use-get-entity-schema.js.map +1 -1
  106. package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
  107. package/lib/hooks/use-page-builder.js +1 -1
  108. package/lib/hooks/use-page-builder.js.map +1 -1
  109. package/lib/utils/get-props-to-display-modifiers.js +1 -0
  110. package/lib/utils/get-props-to-display-modifiers.js.map +1 -1
  111. package/lib/variants/Infographic/index.js.map +1 -1
  112. package/lib/variants/LongformGallery/LongformGallery.js +1 -0
  113. package/lib/variants/LongformGallery/LongformGallery.js.map +1 -1
  114. package/lib/variants/LongformGallery/index.js.map +1 -1
  115. package/lib/variants/SlideSummary/index.js.map +1 -1
  116. package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js +1 -0
  117. package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js.map +1 -1
  118. package/lib/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -1
  119. package/lib/variants/ThumbnailCarousel/index.js.map +1 -1
  120. package/lib-es/HOC/recreateOnNavigation.js.map +1 -1
  121. package/lib-es/HOC/withTitle.js.map +1 -1
  122. package/lib-es/components/BackToTop/BackToTop.js.map +1 -1
  123. package/lib-es/components/Banner/BannerRender.js.map +1 -1
  124. package/lib-es/components/Breadcrumb/Breadcrumb.js.map +1 -1
  125. package/lib-es/components/Button.js.map +1 -1
  126. package/lib-es/components/Card/CardsFactory.js.map +1 -1
  127. package/lib-es/components/Card/CardsRender.js.map +1 -1
  128. package/lib-es/components/CarouselWrapper/DefaultCarousel.js.map +1 -1
  129. package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  130. package/lib-es/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
  131. package/lib-es/components/DateTime/DateTime.js +4 -4
  132. package/lib-es/components/DateTime/DateTime.js.map +1 -1
  133. package/lib-es/components/EmailConfirm/EmailConfirm.js +4 -4
  134. package/lib-es/components/EmailConfirm/EmailConfirm.js.map +1 -1
  135. package/lib-es/components/Image/GlobalLightbox/GlobalLightbox.js +3 -3
  136. package/lib-es/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
  137. package/lib-es/components/Image/GlobalLightbox/index.js.map +1 -1
  138. package/lib-es/components/Image/Image.js.map +1 -1
  139. package/lib-es/components/Image/ImageFactory.js.map +1 -1
  140. package/lib-es/components/ItemList/hooks/use-item-list-id.js.map +1 -1
  141. package/lib-es/components/Layout/LayoutFactory.js.map +1 -1
  142. package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -1
  143. package/lib-es/components/List/ListFactory.js.map +1 -1
  144. package/lib-es/components/List/ListRender.js.map +1 -1
  145. package/lib-es/components/List/components/Pagination/ListPagination.js.map +1 -1
  146. package/lib-es/components/List/components/Pagination/LoadMore.js +2 -2
  147. package/lib-es/components/List/components/Pagination/LoadMore.js.map +1 -1
  148. package/lib-es/components/List/helpers/sort-aggs.js.map +1 -1
  149. package/lib-es/components/Menu/Menu.js.map +1 -1
  150. package/lib-es/components/MenuItem/MenuItemRender.js.map +1 -1
  151. package/lib-es/components/ModalAdapter/index.js.map +1 -1
  152. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  153. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  154. package/lib-es/components/Video/providers/Vimeo/VimeoProvider.js.map +1 -1
  155. package/lib-es/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
  156. package/lib-es/components/Video/providers/get-provider.js.map +1 -1
  157. package/lib-es/components/Wrapper.js +2 -2
  158. package/lib-es/components/Wrapper.js.map +1 -1
  159. package/lib-es/components/index.js.map +1 -1
  160. package/lib-es/constants/index.js.map +1 -1
  161. package/lib-es/helpers/build-search-values-checkbox-select.js +1 -1
  162. package/lib-es/helpers/build-search-values-checkbox-select.js.map +1 -1
  163. package/lib-es/helpers/get-current-offset.js +1 -1
  164. package/lib-es/helpers/get-current-offset.js.map +1 -1
  165. package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
  166. package/lib-es/helpers/remove-unwanted-characters.js.map +1 -1
  167. package/lib-es/hooks/helpers/buildPBComponents.js.map +1 -1
  168. package/lib-es/hooks/helpers/get-components-to-insert-by-type.js.map +1 -1
  169. package/lib-es/hooks/helpers/inject-textblock-banners.js.map +1 -1
  170. package/lib-es/hooks/use-check-mobile-screen.js.map +1 -1
  171. package/lib-es/hooks/use-get-entity-schema.js.map +1 -1
  172. package/lib-es/hooks/use-get-image-id-from-relation.js.map +1 -1
  173. package/lib-es/hooks/use-page-builder.js +1 -1
  174. package/lib-es/hooks/use-page-builder.js.map +1 -1
  175. package/lib-es/variants/Infographic/index.js.map +1 -1
  176. package/lib-es/variants/LongformGallery/LongformGallery.js.map +1 -1
  177. package/lib-es/variants/LongformGallery/index.js.map +1 -1
  178. package/lib-es/variants/SlideSummary/index.js.map +1 -1
  179. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -1
  180. package/lib-es/variants/ThumbnailCarousel/index.js.map +1 -1
  181. package/package.json +20 -19
  182. package/src/HOC/recreateOnNavigation.js +3 -3
  183. package/src/HOC/withTitle.js +3 -3
  184. package/src/components/BackToTop/BackToTop.js +5 -8
  185. package/src/components/Banner/BannerRender.js +0 -2
  186. package/src/components/Breadcrumb/Breadcrumb.js +5 -1
  187. package/src/components/Button.js +3 -6
  188. package/src/components/Card/CardsFactory.js +8 -7
  189. package/src/components/Card/CardsRender.js +5 -3
  190. package/src/components/CarouselWrapper/DefaultCarousel.js +20 -26
  191. package/src/components/ContentGroup/ContentGroupTabs.js +4 -7
  192. package/src/components/DataSummary/DataSummaryTypes/index.js +14 -10
  193. package/src/components/DateTime/DateTime.js +4 -4
  194. package/src/components/EmailConfirm/EmailConfirm.js +9 -11
  195. package/src/components/Image/GlobalLightbox/GlobalLightbox.js +7 -9
  196. package/src/components/Image/GlobalLightbox/index.js +2 -2
  197. package/src/components/Image/Image.js +6 -4
  198. package/src/components/Image/ImageFactory.js +5 -5
  199. package/src/components/ItemList/hooks/use-item-list-id.js +10 -13
  200. package/src/components/Layout/LayoutFactory.js +2 -2
  201. package/src/components/Layout/LayoutWithStickyTimer.js +11 -14
  202. package/src/components/List/ListFactory.js +10 -11
  203. package/src/components/List/ListRender.js +6 -1
  204. package/src/components/List/components/Pagination/ListPagination.js +3 -6
  205. package/src/components/List/components/Pagination/LoadMore.js +7 -9
  206. package/src/components/List/helpers/sort-aggs.js +1 -2
  207. package/src/components/Menu/Menu.js +12 -16
  208. package/src/components/MenuItem/MenuItemRender.js +3 -6
  209. package/src/components/ModalAdapter/index.js +2 -2
  210. package/src/components/SearchContent/SearchContent.js +26 -32
  211. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +15 -19
  212. package/src/components/Video/providers/Vimeo/VimeoProvider.js +19 -22
  213. package/src/components/Video/providers/YouTube/YoutubeEmbeded.js +58 -64
  214. package/src/components/Video/providers/get-provider.js +4 -4
  215. package/src/components/Wrapper.js +5 -7
  216. package/src/components/index.js +20 -20
  217. package/src/constants/index.js +2 -1
  218. package/src/helpers/build-search-values-checkbox-select.js +1 -1
  219. package/src/helpers/get-current-offset.js +1 -1
  220. package/src/helpers/get-wrapped-value-with-link.js +1 -1
  221. package/src/helpers/remove-unwanted-characters.js +1 -4
  222. package/src/hooks/helpers/buildPBComponents.js +2 -4
  223. package/src/hooks/helpers/get-components-to-insert-by-type.js +3 -1
  224. package/src/hooks/helpers/inject-textblock-banners.js +2 -8
  225. package/src/hooks/use-check-mobile-screen.js +5 -8
  226. package/src/hooks/use-get-entity-schema.js +5 -1
  227. package/src/hooks/use-get-image-id-from-relation.js +5 -1
  228. package/src/hooks/use-page-builder.js +9 -12
  229. package/src/variants/Infographic/index.js +2 -2
  230. package/src/variants/LongformGallery/LongformGallery.js +2 -8
  231. package/src/variants/LongformGallery/index.js +2 -2
  232. package/src/variants/SlideSummary/index.js +2 -2
  233. package/src/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js +2 -3
  234. package/src/variants/ThumbnailCarousel/index.js +2 -2
  235. package/tests/unit/src/HOC/withTitle.test.js +11 -21
  236. package/tests/unit/src/Layout/Layout.test.js +2 -1
  237. package/tests/unit/src/Layout/helpers/check-if-row-has-columns.test.js +1 -0
  238. package/tests/unit/src/components/Banner/AdSlotRender.test.js +4 -1
  239. package/tests/unit/src/components/Banner/helpers.test.js +34 -7
  240. package/tests/unit/src/components/BlazeLink.test.js +1 -4
  241. package/tests/unit/src/components/Breadcrumb/__snapshots__/Breadcrumb.test.js.snap +18 -0
  242. package/tests/unit/src/components/Card/Card.test.js +17 -4
  243. package/tests/unit/src/components/Card/CardContainer.test.js +7 -1
  244. package/tests/unit/src/components/Card/__snapshots__/Card.test.js.snap +15 -0
  245. package/tests/unit/src/components/Card/__snapshots__/CardContainer.test.js.snap +12 -0
  246. package/tests/unit/src/components/Card/mockData.js +2 -4
  247. package/tests/unit/src/components/Carousel/CarouselRender/CarouselRender.test.js +47 -46
  248. package/tests/unit/src/components/Carousel/CarouselRender/__snapshots__/CarouselRender.test.js.snap +45 -1
  249. package/tests/unit/src/components/Carousel/CarouselRender/mocks.js +0 -0
  250. package/tests/unit/src/components/Carousel/__snapshots__/Carousel.test.js.snap +1 -1
  251. package/tests/unit/src/components/ContentGroup/ContentGroupTabs.test.js +4 -1
  252. package/tests/unit/src/components/ContentGroup/helpers/get-sections-data.test.js +4 -1
  253. package/tests/unit/src/components/DataSummary/__snapshots__/DataSummaryRender.test.js.snap +0 -1
  254. package/tests/unit/src/components/DataSummary/helpers/build-props-to-display-with-content.test.js +5 -1
  255. package/tests/unit/src/components/DataSummary/helpers/get-value-from-array.test.js +4 -1
  256. package/tests/unit/src/components/DataSummary/helpers/strip-summary-props-content.test.js +8 -2
  257. package/tests/unit/src/components/DataSummary/mockData.js +4 -1
  258. package/tests/unit/src/components/Image/ImageFactory.test.js +4 -3
  259. package/tests/unit/src/components/ItemList/ItemListCounter.test.js +2 -1
  260. package/tests/unit/src/components/ItemList/hooks/use-item-list-id.test.js +1 -1
  261. package/tests/unit/src/components/Layout/LayoutFactory.test.js +0 -4
  262. package/tests/unit/src/components/List/components/Cards/CardsRender.test.js +8 -1
  263. package/tests/unit/src/components/List/components/Pagination/Classic.test.js +1 -1
  264. package/tests/unit/src/components/PlaceholderIcon/index.test.js +2 -2
  265. package/tests/unit/src/components/SearchFilter/components/Range.test.js +5 -5
  266. package/tests/unit/src/components/SearchFilter/components/__snapshots__/Range.test.js.snap +175 -190
  267. package/tests/unit/src/components/SearchFilter/helpers/get-select-options.test.js +8 -2
  268. package/tests/unit/src/components/TextBlock/TextBlock.test.js +1 -1
  269. package/tests/unit/src/components/TextBlock/__snapshots__/TextBlock.test.js.snap +12 -0
  270. package/tests/unit/src/helpers/__snapshots__/parse-textBlock.test.js.snap +3 -0
  271. package/tests/unit/src/helpers/build-checkbox-filters.test.js +4 -1
  272. package/tests/unit/src/helpers/get-dictionary-match.test.js +1 -1
  273. package/tests/unit/src/helpers/parse-textBlock.test.js +3 -1
  274. package/tests/unit/src/hooks/use-check-mobile-screen.test.js +3 -2
  275. package/tests/unit/src/hooks/use-get-image-id-from-relation.test.js +3 -3
  276. package/tests/unit/src/hooks/use-get-images.test.js +16 -14
  277. package/tests/unit/src/hooks/use-get-single-entity-schema.test.js +6 -4
  278. package/tests/unit/src/hooks/use-page-builder.test.js +0 -48
@@ -14,6 +14,9 @@ exports[`TextBlock component With wrapper flag should render with wrapper and le
14
14
  <a
15
15
  aria-label="link"
16
16
  href="/"
17
+ />
18
+ <a
19
+ href="/"
17
20
  >
18
21
  link
19
22
  </a>
@@ -37,6 +40,9 @@ exports[`TextBlock component With wrapper flag should render with wrapper and le
37
40
  <a
38
41
  aria-label="link"
39
42
  href="/"
43
+ />
44
+ <a
45
+ href="/"
40
46
  >
41
47
  link
42
48
  </a>
@@ -60,6 +66,9 @@ exports[`TextBlock component should match snapshot 1`] = `
60
66
  <a
61
67
  aria-label="link"
62
68
  href="/"
69
+ />
70
+ <a
71
+ href="/"
63
72
  >
64
73
  link
65
74
  </a>
@@ -80,6 +89,9 @@ exports[`TextBlock component should not render wrapper if no modifier 1`] = `
80
89
  <a
81
90
  aria-label="link"
82
91
  href="/"
92
+ />
93
+ <a
94
+ href="/"
83
95
  >
84
96
  link
85
97
  </a>
@@ -7,6 +7,9 @@ exports[`Parse textBlock it should match snapshot 1`] = `
7
7
  <a
8
8
  aria-label="link"
9
9
  href="/"
10
+ />
11
+ <a
12
+ href="/"
10
13
  >
11
14
  link
12
15
  </a>
@@ -8,7 +8,10 @@ describe('buildCheckboxFilters helper', () => {
8
8
  });
9
9
 
10
10
  it('should handle new array filters', () => {
11
- const checkboxFilters = [['filterName', 'not'], ['secondFilter', 'on']];
11
+ const checkboxFilters = [
12
+ ['filterName', 'not'],
13
+ ['secondFilter', 'on']
14
+ ];
12
15
  const result = buildCheckboxFilters(checkboxFilters);
13
16
  expect(result).toEqual([{ match: { filterName: false } }, { match: { secondFilter: true } }]);
14
17
  });
@@ -1,5 +1,5 @@
1
1
  import '@testing-library/jest-dom/extend-expect';
2
- import getDictionaryMatch from '.../../../src/helpers/get-dictionary-match';
2
+ import getDictionaryMatch from '../../../../src/helpers/get-dictionary-match';
3
3
 
4
4
  describe('get dictionary match', () => {
5
5
  const gridStringMock = getDictionaryMatch(3);
@@ -14,7 +14,9 @@ describe('Parse textBlock', () => {
14
14
 
15
15
  beforeAll(() => {
16
16
  const parsedTextBlock = parseTextBlock({ html, LinkWrapper: BlazeLink });
17
- expectedMarkup = () => <>{parsedTextBlock}</>;
17
+ expectedMarkup = () => {
18
+ parsedTextBlock;
19
+ };
18
20
  });
19
21
 
20
22
  test('it should match snapshot', () => {
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import { renderHook } from '@testing-library/react-hooks';
4
+ import { renderHook } from '@testing-library/react';
5
5
  import { useCheckMobileScreen } from '../../../../src/hooks';
6
-
6
+ // TODO fix breaking test
7
7
  describe('Check Mobile Screen hook', () => {
8
8
  it('should server render will always be mobile', () => {
9
9
  global.innerWidth = undefined;
@@ -29,6 +29,7 @@ describe('Check Mobile Screen hook', () => {
29
29
  resizeCheck(screenSize, isMobile);
30
30
  });
31
31
  });
32
+
32
33
  function resizeCheck(screenSize, isMobile) {
33
34
  const { result, rerender } = renderHook(() => useCheckMobileScreen());
34
35
  rerender();
@@ -2,7 +2,7 @@
2
2
  * @jest-environment jsdom
3
3
  */
4
4
  import React from 'react';
5
- import { renderHook } from '@testing-library/react-hooks';
5
+ import { renderHook } from '@testing-library/react';
6
6
  import { MockedProvider } from '@apollo/client/testing';
7
7
 
8
8
  import useGetImageIdFromRelation from '../../../../src/hooks/use-get-image-id-from-relation';
@@ -76,7 +76,7 @@ describe('useGetImageIdFromRelation', () => {
76
76
  });
77
77
 
78
78
  function renderCustomHook() {
79
- const { result, waitForNextUpdate } = renderHook(
79
+ const { result } = renderHook(
80
80
  () =>
81
81
  useGetImageIdFromRelation(
82
82
  mockProps.id,
@@ -88,5 +88,5 @@ function renderCustomHook() {
88
88
  { wrapper }
89
89
  );
90
90
 
91
- return { result, waitForNextUpdate };
91
+ return { result };
92
92
  }
@@ -4,7 +4,7 @@
4
4
  import React from 'react';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
6
  import { MockedProvider } from '@apollo/client/testing';
7
- import { renderHook, act } from '@testing-library/react-hooks';
7
+ import { renderHook, waitFor } from '@testing-library/react';
8
8
  import { useGetImages } from '../../../../src/hooks';
9
9
  import { getFiles, getFileById } from '../../../../src/application/query';
10
10
 
@@ -69,25 +69,23 @@ describe('UseGetImages hook', () => {
69
69
  <MockedProvider mocks={ARRAY_MOCK}>{children}</MockedProvider>
70
70
  );
71
71
 
72
- it('should be a function', () => {
73
- expect(typeof useGetImages).toEqual('function');
74
- });
75
-
76
72
  it('should return expected value (id is an array)', async () => {
77
73
  const wrapper = ({ children }) => (
78
74
  <MockedProvider mocks={ARRAY_MOCK}>{children}</MockedProvider>
79
75
  );
80
76
  const ids = [id1, id2];
81
77
  const hasMultipleIds = true;
82
- const { result, waitForNextUpdate } = renderHook(() => useGetImages(ids, hasMultipleIds), {
78
+ const { result } = renderHook(() => useGetImages(ids, hasMultipleIds), {
83
79
  wrapper
84
80
  });
85
81
 
86
82
  expect(result.current.loading).toEqual(true);
87
83
 
88
- await act(() => waitForNextUpdate());
84
+ await waitFor(() => {
85
+ const { loading } = result.current;
86
+ expect(loading).toBe(false);
87
+ });
89
88
 
90
- expect(result.current.loading).toEqual(false);
91
89
  expect(result.current).toEqual({
92
90
  data: {
93
91
  getFiles: resultData
@@ -98,15 +96,17 @@ describe('UseGetImages hook', () => {
98
96
  });
99
97
 
100
98
  it('should return expected value (id is an array) when id is string', async () => {
101
- const { result, waitForNextUpdate } = renderHook(() => useGetImages(id1, true), {
99
+ const { result } = renderHook(() => useGetImages(id1, true), {
102
100
  wrapper: arrayWrapper
103
101
  });
104
102
 
105
103
  expect(result.current.loading).toEqual(true);
106
104
 
107
- await act(() => waitForNextUpdate());
105
+ await waitFor(() => {
106
+ const { loading } = result.current;
107
+ expect(loading).toBe(false);
108
+ });
108
109
 
109
- expect(result.current.loading).toEqual(false);
110
110
  expect(result.current).toEqual({
111
111
  data: {
112
112
  getFiles: [resultData[0]]
@@ -145,15 +145,17 @@ describe('UseGetImages hook', () => {
145
145
  <MockedProvider mocks={STRING_MOCK}>{children}</MockedProvider>
146
146
  );
147
147
 
148
- const { result, waitForNextUpdate } = renderHook(() => useGetImages(id1), {
148
+ const { result } = renderHook(() => useGetImages(id1), {
149
149
  wrapper
150
150
  });
151
151
 
152
152
  expect(result.current.loading).toEqual(true);
153
153
 
154
- await act(() => waitForNextUpdate());
154
+ await waitFor(() => {
155
+ const { loading } = result.current;
156
+ expect(loading).toBe(false);
157
+ });
155
158
 
156
- expect(result.current.loading).toEqual(false);
157
159
  expect(result.current).toEqual({
158
160
  data: {
159
161
  getFile: resultData[0]
@@ -2,7 +2,7 @@
2
2
  * @jest-environment jsdom
3
3
  */
4
4
  import React from 'react';
5
- import { renderHook, act } from '@testing-library/react-hooks';
5
+ import { renderHook, waitFor } from '@testing-library/react';
6
6
  import { MockedProvider } from '@apollo/client/testing';
7
7
  import { useGetSingleEntitySchema } from '../../../../src/hooks';
8
8
  import { getSingleEntitySchema } from '../../../../src/application/query';
@@ -47,13 +47,15 @@ const wrapper = ({ children }) => (
47
47
 
48
48
  describe('useGetSingleEntitySchema hook', () => {
49
49
  it('should return a single schema object', async () => {
50
- const { result, waitForNextUpdate } = renderHook(() => useGetSingleEntitySchema('page'), {
50
+ const { result } = renderHook(() => useGetSingleEntitySchema('page'), {
51
51
  wrapper
52
52
  });
53
53
 
54
- await act(() => waitForNextUpdate());
54
+ await waitFor(() => {
55
+ const { loading } = result.current;
56
+ expect(loading).toBe(false);
57
+ });
55
58
 
56
- expect(result.current.loading).toEqual(false);
57
59
  expect(result.current).toEqual({
58
60
  data: {
59
61
  getEntitySchema: mockQueryResults
@@ -1,48 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- import React from 'react';
5
- import '@testing-library/jest-dom/extend-expect';
6
- import PropTypes from 'prop-types';
7
- import { shallow } from 'enzyme';
8
- import { usePageBuilder } from '../../../../src/hooks';
9
- import { PAGE_BUILDER_MOCK } from '../../../helpers/mocks';
10
-
11
- const Mock = ({ data = null }) => {
12
- const child = usePageBuilder(data);
13
-
14
- return <div>{child}</div>;
15
- };
16
-
17
- Mock.propTypes = {
18
- data: PropTypes.array
19
- };
20
-
21
- Mock.defaultProps = {
22
- data: null
23
- };
24
-
25
- describe('Build Page hook', () => {
26
- const defaultPage = shallow(<Mock data={PAGE_BUILDER_MOCK} />);
27
-
28
- it('should be defined', () => {
29
- expect(usePageBuilder).toBeDefined();
30
- });
31
-
32
- describe('should always return an Array', () => {
33
- const isArray = data => Array.isArray(data);
34
-
35
- it('should return an Array with data', () => {
36
- const hasChild = defaultPage.props().children;
37
-
38
- expect(isArray(hasChild)).toBeTruthy();
39
- });
40
-
41
- it('should return Array with empty data', () => {
42
- const pageWithoutData = shallow(<Mock />);
43
- const hasNoChild = pageWithoutData.props().children;
44
-
45
- expect(isArray(hasNoChild)).toBeTruthy();
46
- });
47
- });
48
- });