@blaze-cms/react-page-builder 0.146.0-core-styles.44 → 0.146.0-node18.1

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 (516) hide show
  1. package/CHANGELOG.md +33 -219
  2. package/lib/BannerContext/index.js +1 -1
  3. package/lib/BannerContext/index.js.map +1 -1
  4. package/lib/HOC/recreateOnNavigation.js.map +1 -1
  5. package/lib/HOC/withInfiniteScroll.js +2 -2
  6. package/lib/HOC/withInfiniteScroll.js.map +1 -1
  7. package/lib/HOC/withTitle.js +1 -1
  8. package/lib/HOC/withTitle.js.map +1 -1
  9. package/lib/application/query/index.js +1 -0
  10. package/lib/application/query/index.js.map +1 -1
  11. package/lib/components/BackToTop/BackToTop.js +1 -1
  12. package/lib/components/BackToTop/BackToTop.js.map +1 -1
  13. package/lib/components/Banner/AdSlotRender.js +2 -2
  14. package/lib/components/Banner/AdSlotRender.js.map +1 -1
  15. package/lib/components/Banner/Banner.js +2 -2
  16. package/lib/components/Banner/Banner.js.map +1 -1
  17. package/lib/components/Banner/BannerRender.js.map +1 -1
  18. package/lib/components/Banner/helpers.js +3 -3
  19. package/lib/components/Banner/helpers.js.map +1 -1
  20. package/lib/components/Banner/index.js +2 -2
  21. package/lib/components/Banner/index.js.map +1 -1
  22. package/lib/components/BlazeLink.js +1 -1
  23. package/lib/components/BlazeLink.js.map +1 -1
  24. package/lib/components/Breadcrumb/Breadcrumb.js +2 -2
  25. package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
  26. package/lib/components/Button.js +1 -1
  27. package/lib/components/Button.js.map +1 -1
  28. package/lib/components/Card/Card.js +1 -1
  29. package/lib/components/Card/Card.js.map +1 -1
  30. package/lib/components/Card/CardsContainer.js +2 -2
  31. package/lib/components/Card/CardsContainer.js.map +1 -1
  32. package/lib/components/Card/CardsFactory.js.map +1 -1
  33. package/lib/components/Card/CardsRender.js +1 -1
  34. package/lib/components/Card/CardsRender.js.map +1 -1
  35. package/lib/components/Carousel/CarouselRender/CarouselRender.js +1 -0
  36. package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
  37. package/lib/components/CarouselWrapper/DefaultCarousel.js +1 -1
  38. package/lib/components/CarouselWrapper/DefaultCarousel.js.map +1 -1
  39. package/lib/components/ClickWrapper.js +1 -1
  40. package/lib/components/ClickWrapper.js.map +1 -1
  41. package/lib/components/Code/Code.js +1 -1
  42. package/lib/components/Code/Code.js.map +1 -1
  43. package/lib/components/Code/ScriptTag.js +1 -1
  44. package/lib/components/Code/ScriptTag.js.map +1 -1
  45. package/lib/components/ContentGroup/ContentGroupTabs.js +2 -2
  46. package/lib/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  47. package/lib/components/ContentGroup/helpers/get-sections-data.js +1 -0
  48. package/lib/components/ContentGroup/helpers/get-sections-data.js.map +1 -1
  49. package/lib/components/DataSummary/DataSummaryFactory.js +1 -1
  50. package/lib/components/DataSummary/DataSummaryFactory.js.map +1 -1
  51. package/lib/components/DataSummary/DataSummaryRender.js +1 -0
  52. package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
  53. package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js +2 -2
  54. package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js.map +1 -1
  55. package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js +2 -2
  56. package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
  57. package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js +2 -2
  58. package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js.map +1 -1
  59. package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js +2 -2
  60. package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js.map +1 -1
  61. package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js +2 -2
  62. package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js.map +1 -1
  63. package/lib/components/DataSummary/DataSummaryTypes/index.js +6 -6
  64. package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
  65. package/lib/components/DateTime/DateTime.js +4 -4
  66. package/lib/components/DateTime/DateTime.js.map +1 -1
  67. package/lib/components/EmailConfirm/EmailConfirm.js +4 -4
  68. package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
  69. package/lib/components/Image/GlobalLightbox/GlobalLightbox.js +3 -3
  70. package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
  71. package/lib/components/Image/GlobalLightbox/index.js +2 -2
  72. package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
  73. package/lib/components/Image/Image.js +1 -1
  74. package/lib/components/Image/Image.js.map +1 -1
  75. package/lib/components/Image/ImageFactory.js +2 -2
  76. package/lib/components/Image/ImageFactory.js.map +1 -1
  77. package/lib/components/Image/Lightbox/Lightbox.js +1 -1
  78. package/lib/components/Image/Lightbox/Lightbox.js.map +1 -1
  79. package/lib/components/ItemList/ItemListButton/ItemListButton.js +1 -1
  80. package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
  81. package/lib/components/ItemList/helpers/get-item-list-ids.js +1 -0
  82. package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -1
  83. package/lib/components/ItemList/helpers/set-param-and-redirect.js +1 -0
  84. package/lib/components/ItemList/helpers/set-param-and-redirect.js.map +1 -1
  85. package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -1
  86. package/lib/components/Layout/LayoutFactory.js +2 -2
  87. package/lib/components/Layout/LayoutFactory.js.map +1 -1
  88. package/lib/components/Layout/LayoutWithStickyTimer.js +1 -1
  89. package/lib/components/Layout/LayoutWithStickyTimer.js.map +1 -1
  90. package/lib/components/LazyImage/index.js +2 -2
  91. package/lib/components/LazyImage/index.js.map +1 -1
  92. package/lib/components/List/ListFactory.js +1 -1
  93. package/lib/components/List/ListFactory.js.map +1 -1
  94. package/lib/components/List/ListRender.js.map +1 -1
  95. package/lib/components/List/components/Cards/CardsRender.js +1 -1
  96. package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
  97. package/lib/components/List/components/Cards/CardsRenderWrapper.js +2 -2
  98. package/lib/components/List/components/Cards/CardsRenderWrapper.js.map +1 -1
  99. package/lib/components/List/components/Full/FullRender.js +2 -2
  100. package/lib/components/List/components/Full/FullRender.js.map +1 -1
  101. package/lib/components/List/components/Full/FullRenderItem.js +2 -2
  102. package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
  103. package/lib/components/List/components/Header/ListHeader.js +1 -0
  104. package/lib/components/List/components/Header/ListHeader.js.map +1 -1
  105. package/lib/components/List/components/Pagination/ListPagination.js +1 -1
  106. package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
  107. package/lib/components/List/components/Pagination/LoadMore.js +2 -2
  108. package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
  109. package/lib/components/List/components/helpers/check-if-should-render-banner.js +0 -1
  110. package/lib/components/List/components/helpers/check-if-should-render-banner.js.map +1 -1
  111. package/lib/components/List/components/helpers/check-if-should-render-gtm.js +0 -1
  112. package/lib/components/List/components/helpers/check-if-should-render-gtm.js.map +1 -1
  113. package/lib/components/List/helpers/build-query-booster.js +2 -1
  114. package/lib/components/List/helpers/build-query-booster.js.map +1 -1
  115. package/lib/components/List/helpers/sort-aggs.js.map +1 -1
  116. package/lib/components/Menu/Menu.js +2 -5
  117. package/lib/components/Menu/Menu.js.map +1 -1
  118. package/lib/components/Menu/MenuContext.js +1 -2
  119. package/lib/components/Menu/MenuContext.js.map +1 -1
  120. package/lib/components/MenuItem/MenuItemRender.js +10 -24
  121. package/lib/components/MenuItem/MenuItemRender.js.map +1 -1
  122. package/lib/components/MenuItem/helpers/index.js +0 -14
  123. package/lib/components/MenuItem/helpers/index.js.map +1 -1
  124. package/lib/components/Modal/Modal.js.map +1 -1
  125. package/lib/components/ModalAdapter/ModalAdapter.js +1 -1
  126. package/lib/components/ModalAdapter/ModalAdapter.js.map +1 -1
  127. package/lib/components/ModalAdapter/index.js +2 -2
  128. package/lib/components/ModalAdapter/index.js.map +1 -1
  129. package/lib/components/SearchContent/SearchContent.js +1 -1
  130. package/lib/components/SearchContent/SearchContent.js.map +1 -1
  131. package/lib/components/SearchContent/SearchContentItems.js +1 -0
  132. package/lib/components/SearchContent/SearchContentItems.js.map +1 -1
  133. package/lib/components/SearchFilter/SearchFilter/FiltersList.js +2 -2
  134. package/lib/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
  135. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +1 -1
  136. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  137. package/lib/components/SearchFilter/SearchFilterContainer.js +1 -2
  138. package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  139. package/lib/components/SearchFilter/components/Checkbox.js +1 -1
  140. package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
  141. package/lib/components/SearchFilter/components/Range.js.map +1 -1
  142. package/lib/components/SearchFilter/components/Select.js.map +1 -1
  143. package/lib/components/SearchFilter/components/TextSearch.js.map +1 -1
  144. package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js +1 -0
  145. package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
  146. package/lib/components/SearchFilter/helpers/get-select-options.js +1 -0
  147. package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
  148. package/lib/components/SearchFilter/helpers/parse-filter-value.js +1 -0
  149. package/lib/components/SearchFilter/helpers/parse-filter-value.js.map +1 -1
  150. package/lib/components/SearchFilterSort/SearchFilterSort.js +1 -0
  151. package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  152. package/lib/components/SocialFollow/SocialFollowRender.js +1 -0
  153. package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
  154. package/lib/components/Video/VideoModal.js +1 -1
  155. package/lib/components/Video/VideoModal.js.map +1 -1
  156. package/lib/components/Video/VideoRender.js +1 -1
  157. package/lib/components/Video/VideoRender.js.map +1 -1
  158. package/lib/components/Video/providers/JWPlayer/JWPlayerController.js +1 -2
  159. package/lib/components/Video/providers/JWPlayer/JWPlayerController.js.map +1 -1
  160. package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js +1 -1
  161. package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
  162. package/lib/components/Video/providers/Vimeo/VimeoProvider.js +2 -2
  163. package/lib/components/Video/providers/Vimeo/VimeoProvider.js.map +1 -1
  164. package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js +1 -1
  165. package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
  166. package/lib/components/Video/providers/get-provider.js +6 -6
  167. package/lib/components/Video/providers/get-provider.js.map +1 -1
  168. package/lib/components/Wrapper.js +2 -2
  169. package/lib/components/Wrapper.js.map +1 -1
  170. package/lib/components/index.js +31 -31
  171. package/lib/components/index.js.map +1 -1
  172. package/lib/constants/index.js.map +1 -1
  173. package/lib/helpers/build-query-fields.js +1 -0
  174. package/lib/helpers/build-query-fields.js.map +1 -1
  175. package/lib/helpers/build-raw-query-stringified.js +1 -0
  176. package/lib/helpers/build-raw-query-stringified.js.map +1 -1
  177. package/lib/helpers/build-search-values-checkbox-select.js +1 -1
  178. package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
  179. package/lib/helpers/check-props-to-use.js +1 -0
  180. package/lib/helpers/check-props-to-use.js.map +1 -1
  181. package/lib/helpers/get-current-offset.js +4 -5
  182. package/lib/helpers/get-current-offset.js.map +1 -1
  183. package/lib/helpers/get-entities-with-banner.js +1 -1
  184. package/lib/helpers/get-generic-render-variables.js +1 -0
  185. package/lib/helpers/get-generic-render-variables.js.map +1 -1
  186. package/lib/helpers/get-wrapped-value-with-link.js +1 -0
  187. package/lib/helpers/get-wrapped-value-with-link.js.map +1 -1
  188. package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js +1 -0
  189. package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map +1 -1
  190. package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +1 -1
  191. package/lib/helpers/parse-TextBlock.js +1 -1
  192. package/lib/helpers/parse-TextBlock.js.map +1 -1
  193. package/lib/helpers/parse-props-to-display.js +1 -1
  194. package/lib/helpers/parse-props-to-display.js.map +1 -1
  195. package/lib/helpers/process-data-summary-value.js +2 -3
  196. package/lib/helpers/process-data-summary-value.js.map +1 -1
  197. package/lib/helpers/remove-unwanted-characters.js +1 -1
  198. package/lib/helpers/remove-unwanted-characters.js.map +1 -1
  199. package/lib/helpers/render-children.js +3 -3
  200. package/lib/helpers/render-children.js.map +1 -1
  201. package/lib/hooks/helpers/StoreImages.js +1 -2
  202. package/lib/hooks/helpers/StoreImages.js.map +1 -1
  203. package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
  204. package/lib/hooks/helpers/get-components-to-insert-by-type.js.map +1 -1
  205. package/lib/hooks/helpers/get-lightbox-images.js +7 -7
  206. package/lib/hooks/helpers/get-lightbox-images.js.map +1 -1
  207. package/lib/hooks/helpers/inject-textblock-banners.js +1 -1
  208. package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
  209. package/lib/hooks/use-check-mobile-screen.js.map +1 -1
  210. package/lib/hooks/use-get-entity-schema.js.map +1 -1
  211. package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
  212. package/lib/hooks/use-page-builder.js +2 -2
  213. package/lib/hooks/use-page-builder.js.map +1 -1
  214. package/lib/hooks/use-portal.js +1 -1
  215. package/lib/hooks/use-portal.js.map +1 -1
  216. package/lib/utils/get-props-to-display-modifiers.js +1 -0
  217. package/lib/utils/get-props-to-display-modifiers.js.map +1 -1
  218. package/lib/variants/FloatingSideButton/index.js.map +1 -1
  219. package/lib/variants/HeroImage/index.js.map +1 -1
  220. package/lib/variants/Infographic/index.js +2 -2
  221. package/lib/variants/Infographic/index.js.map +1 -1
  222. package/lib/variants/LongformGallery/LongformGallery.js +1 -0
  223. package/lib/variants/LongformGallery/LongformGallery.js.map +1 -1
  224. package/lib/variants/LongformGallery/LongformGalleryImage.js.map +1 -1
  225. package/lib/variants/LongformGallery/index.js +2 -2
  226. package/lib/variants/LongformGallery/index.js.map +1 -1
  227. package/lib/variants/LongformRow/index.js.map +1 -1
  228. package/lib/variants/ParallaxImageTextRight/index.js.map +1 -1
  229. package/lib/variants/SlideSummary/index.js +2 -2
  230. package/lib/variants/SlideSummary/index.js.map +1 -1
  231. package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js +1 -0
  232. package/lib/variants/ThumbnailCarousel/ThumbnailCarousel.js.map +1 -1
  233. package/lib/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -1
  234. package/lib/variants/ThumbnailCarousel/index.js +2 -2
  235. package/lib/variants/ThumbnailCarousel/index.js.map +1 -1
  236. package/lib-es/HOC/recreateOnNavigation.js.map +1 -1
  237. package/lib-es/HOC/withTitle.js.map +1 -1
  238. package/lib-es/application/query/index.js.map +1 -1
  239. package/lib-es/components/BackToTop/BackToTop.js.map +1 -1
  240. package/lib-es/components/Banner/AdSlotRender.js.map +1 -1
  241. package/lib-es/components/Banner/Banner.js.map +1 -1
  242. package/lib-es/components/Banner/BannerRender.js.map +1 -1
  243. package/lib-es/components/Banner/helpers.js.map +1 -1
  244. package/lib-es/components/Banner/index.js +1 -1
  245. package/lib-es/components/Banner/index.js.map +1 -1
  246. package/lib-es/components/Breadcrumb/Breadcrumb.js.map +1 -1
  247. package/lib-es/components/Button.js.map +1 -1
  248. package/lib-es/components/Card/Card.js.map +1 -1
  249. package/lib-es/components/Card/CardsFactory.js.map +1 -1
  250. package/lib-es/components/Card/CardsRender.js.map +1 -1
  251. package/lib-es/components/Card/helpers/get-dynamic-grid-classes.js.map +1 -1
  252. package/lib-es/components/CarouselWrapper/DefaultCarousel.js.map +1 -1
  253. package/lib-es/components/CarouselWrapper/SmoothScrollCarousel.js.map +1 -1
  254. package/lib-es/components/ContentGroup/ContentGroupTabs.js.map +1 -1
  255. package/lib-es/components/ContentGroup/helpers/get-active-tab.js.map +1 -1
  256. package/lib-es/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummary.js.map +1 -1
  257. package/lib-es/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js.map +1 -1
  258. package/lib-es/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js.map +1 -1
  259. package/lib-es/components/DataSummary/DataSummaryTypes/index.js +5 -5
  260. package/lib-es/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
  261. package/lib-es/components/DataSummary/helpers/get-link-based-on-value.js.map +1 -1
  262. package/lib-es/components/DataSummary/helpers/get-prop-value.js.map +1 -1
  263. package/lib-es/components/DataSummary/helpers/get-value-from-array.js.map +1 -1
  264. package/lib-es/components/DateTime/DateTime.js +4 -4
  265. package/lib-es/components/DateTime/DateTime.js.map +1 -1
  266. package/lib-es/components/EmailConfirm/EmailConfirm.js +4 -4
  267. package/lib-es/components/EmailConfirm/EmailConfirm.js.map +1 -1
  268. package/lib-es/components/EmailConfirm/mutation.js.map +1 -1
  269. package/lib-es/components/Iframe/Iframe.js.map +1 -1
  270. package/lib-es/components/Image/GlobalLightbox/GlobalLightbox.js +3 -3
  271. package/lib-es/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
  272. package/lib-es/components/Image/GlobalLightbox/NavButton.js.map +1 -1
  273. package/lib-es/components/Image/GlobalLightbox/index.js +1 -1
  274. package/lib-es/components/Image/GlobalLightbox/index.js.map +1 -1
  275. package/lib-es/components/Image/Image.js.map +1 -1
  276. package/lib-es/components/Image/ImageFactory.js.map +1 -1
  277. package/lib-es/components/ItemList/ItemListButton/ItemListButton.js.map +1 -1
  278. package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -1
  279. package/lib-es/components/ItemList/ItemListNew/ItemListNew.js.map +1 -1
  280. package/lib-es/components/ItemList/helpers/get-item-list-id.js.map +1 -1
  281. package/lib-es/components/ItemList/helpers/set-item-list-id.js.map +1 -1
  282. package/lib-es/components/ItemList/hooks/use-item-list-id.js.map +1 -1
  283. package/lib-es/components/Layout/Layout.js.map +1 -1
  284. package/lib-es/components/Layout/LayoutFactory.js +1 -1
  285. package/lib-es/components/Layout/LayoutFactory.js.map +1 -1
  286. package/lib-es/components/Layout/LayoutWithStickyTimer.js.map +1 -1
  287. package/lib-es/components/Layout/helpers/get-styles-to-update.js.map +1 -1
  288. package/lib-es/components/LazyImage/index.js +1 -1
  289. package/lib-es/components/LazyImage/index.js.map +1 -1
  290. package/lib-es/components/List/ListFactory.js.map +1 -1
  291. package/lib-es/components/List/ListRender.js.map +1 -1
  292. package/lib-es/components/List/components/Header/ListHeader.js.map +1 -1
  293. package/lib-es/components/List/components/Pagination/Classic.js.map +1 -1
  294. package/lib-es/components/List/components/Pagination/ListPagination.js.map +1 -1
  295. package/lib-es/components/List/components/Pagination/LoadMore.js +2 -2
  296. package/lib-es/components/List/components/Pagination/LoadMore.js.map +1 -1
  297. package/lib-es/components/List/helpers/build-az-url.js.map +1 -1
  298. package/lib-es/components/List/helpers/build-pagination-items.js.map +1 -1
  299. package/lib-es/components/List/helpers/build-pagination-url.js.map +1 -1
  300. package/lib-es/components/List/helpers/get-az-query-filter.js.map +1 -1
  301. package/lib-es/components/List/helpers/get-list-query.js.map +1 -1
  302. package/lib-es/components/List/helpers/sort-aggs.js.map +1 -1
  303. package/lib-es/components/Loading/Loading.js.map +1 -1
  304. package/lib-es/components/Menu/Menu.js +1 -4
  305. package/lib-es/components/Menu/Menu.js.map +1 -1
  306. package/lib-es/components/Menu/MenuContext.js +1 -2
  307. package/lib-es/components/Menu/MenuContext.js.map +1 -1
  308. package/lib-es/components/MenuItem/MenuItemRender.js +8 -21
  309. package/lib-es/components/MenuItem/MenuItemRender.js.map +1 -1
  310. package/lib-es/components/MenuItem/helpers/index.js +1 -3
  311. package/lib-es/components/MenuItem/helpers/index.js.map +1 -1
  312. package/lib-es/components/MenuItem/helpers/inject-helper-into-template.js.map +1 -1
  313. package/lib-es/components/ModalAdapter/ModalAdapter.js +1 -1
  314. package/lib-es/components/ModalAdapter/ModalAdapter.js.map +1 -1
  315. package/lib-es/components/ModalAdapter/index.js +1 -1
  316. package/lib-es/components/ModalAdapter/index.js.map +1 -1
  317. package/lib-es/components/SearchContent/SearchContent.js.map +1 -1
  318. package/lib-es/components/SearchContent/SearchContentResults.js.map +1 -1
  319. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  320. package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  321. package/lib-es/components/SearchFilter/components/Checkbox.js.map +1 -1
  322. package/lib-es/components/SearchFilter/components/Range.js.map +1 -1
  323. package/lib-es/components/SearchFilter/components/Select.js.map +1 -1
  324. package/lib-es/components/SearchFilter/constants.js.map +1 -1
  325. package/lib-es/components/SearchFilter/helpers/build-list-name-query.js.map +1 -1
  326. package/lib-es/components/SearchFilter/helpers/build-new-url.js.map +1 -1
  327. package/lib-es/components/SearchFilter/helpers/build-url-query.js.map +1 -1
  328. package/lib-es/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -1
  329. package/lib-es/components/SearchFilter/helpers/get-updated-filter-by.js.map +1 -1
  330. package/lib-es/components/SearchFilter/helpers/parse-filter-value.js.map +1 -1
  331. package/lib-es/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  332. package/lib-es/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  333. package/lib-es/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  334. package/lib-es/components/SocialFollow/SFItem.js.map +1 -1
  335. package/lib-es/components/Video/Video.js.map +1 -1
  336. package/lib-es/components/Video/providers/Vimeo/VimeoProvider.js.map +1 -1
  337. package/lib-es/components/Video/providers/Vimeo/helpers/add-extra-params-to-url.js.map +1 -1
  338. package/lib-es/components/Video/providers/YouTube/YouTubeProvider.js.map +1 -1
  339. package/lib-es/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
  340. package/lib-es/components/Video/providers/YouTube/helpers/index.js.map +1 -1
  341. package/lib-es/components/Video/providers/get-provider.js +5 -5
  342. package/lib-es/components/Video/providers/get-provider.js.map +1 -1
  343. package/lib-es/components/Wrapper.js +2 -2
  344. package/lib-es/components/Wrapper.js.map +1 -1
  345. package/lib-es/components/index.js +30 -30
  346. package/lib-es/components/index.js.map +1 -1
  347. package/lib-es/constants/componentsDefaultValues.js.map +1 -1
  348. package/lib-es/constants/index.js.map +1 -1
  349. package/lib-es/helpers/build-az-filter.js.map +1 -1
  350. package/lib-es/helpers/build-filters-query.js.map +1 -1
  351. package/lib-es/helpers/build-inherited-filters.js.map +1 -1
  352. package/lib-es/helpers/build-props-query.js.map +1 -1
  353. package/lib-es/helpers/build-query-fields.js.map +1 -1
  354. package/lib-es/helpers/build-query-key.js.map +1 -1
  355. package/lib-es/helpers/build-raw-query-base.js.map +1 -1
  356. package/lib-es/helpers/build-raw-query-stringified.js.map +1 -1
  357. package/lib-es/helpers/build-search-values-checkbox-select.js +1 -1
  358. package/lib-es/helpers/build-search-values-checkbox-select.js.map +1 -1
  359. package/lib-es/helpers/build-sort-values.js.map +1 -1
  360. package/lib-es/helpers/get-current-offset.js +1 -1
  361. package/lib-es/helpers/get-current-offset.js.map +1 -1
  362. package/lib-es/helpers/get-display-count-data.js.map +1 -1
  363. package/lib-es/helpers/get-entity-data.js.map +1 -1
  364. package/lib-es/helpers/get-extra-az-bits.js.map +1 -1
  365. package/lib-es/helpers/get-inherited-filters.js.map +1 -1
  366. package/lib-es/helpers/get-modifiers.js.map +1 -1
  367. package/lib-es/helpers/get-pagination-index.js.map +1 -1
  368. package/lib-es/helpers/get-query-props.js.map +1 -1
  369. package/lib-es/helpers/get-sort-by-field-name.js.map +1 -1
  370. package/lib-es/helpers/get-wrapped-value-with-link.js.map +1 -1
  371. package/lib-es/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
  372. package/lib-es/helpers/is-filter-entitys-id.js.map +1 -1
  373. package/lib-es/helpers/process-data-summary-value.js +1 -1
  374. package/lib-es/helpers/remove-unwanted-characters.js.map +1 -1
  375. package/lib-es/hooks/helpers/append-gtm-classname.js.map +1 -1
  376. package/lib-es/hooks/helpers/buildPBComponents.js.map +1 -1
  377. package/lib-es/hooks/helpers/get-components-to-insert-by-type.js.map +1 -1
  378. package/lib-es/hooks/helpers/inject-textblock-banners.js +1 -1
  379. package/lib-es/hooks/helpers/inject-textblock-banners.js.map +1 -1
  380. package/lib-es/hooks/helpers/insert-banners.js.map +1 -1
  381. package/lib-es/hooks/helpers/update-targetings.js.map +1 -1
  382. package/lib-es/hooks/use-app-sync-event-hook.js.map +1 -1
  383. package/lib-es/hooks/use-check-mobile-screen.js.map +1 -1
  384. package/lib-es/hooks/use-get-entity-schema.js.map +1 -1
  385. package/lib-es/hooks/use-get-image-id-from-relation.js.map +1 -1
  386. package/lib-es/hooks/use-page-builder.js +1 -1
  387. package/lib-es/hooks/use-page-builder.js.map +1 -1
  388. package/lib-es/utils/component-map.js.map +1 -1
  389. package/lib-es/utils/get-class-modifiers.js.map +1 -1
  390. package/lib-es/utils/variant-handler.js.map +1 -1
  391. package/lib-es/variants/Infographic/index.js +1 -1
  392. package/lib-es/variants/Infographic/index.js.map +1 -1
  393. package/lib-es/variants/Infographic/useInfographic.js.map +1 -1
  394. package/lib-es/variants/LongformGallery/LongformGallery.js.map +1 -1
  395. package/lib-es/variants/LongformGallery/LongformGalleryImage.js.map +1 -1
  396. package/lib-es/variants/LongformGallery/constants.js.map +1 -1
  397. package/lib-es/variants/LongformGallery/index.js +1 -1
  398. package/lib-es/variants/LongformGallery/index.js.map +1 -1
  399. package/lib-es/variants/SlideSummary/index.js +1 -1
  400. package/lib-es/variants/SlideSummary/index.js.map +1 -1
  401. package/lib-es/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js.map +1 -1
  402. package/lib-es/variants/ThumbnailCarousel/index.js +1 -1
  403. package/lib-es/variants/ThumbnailCarousel/index.js.map +1 -1
  404. package/package.json +20 -19
  405. package/src/HOC/recreateOnNavigation.js +3 -3
  406. package/src/HOC/withTitle.js +3 -3
  407. package/src/components/BackToTop/BackToTop.js +5 -8
  408. package/src/components/Banner/BannerRender.js +0 -2
  409. package/src/components/Breadcrumb/Breadcrumb.js +5 -1
  410. package/src/components/Button.js +3 -6
  411. package/src/components/Card/CardsFactory.js +8 -7
  412. package/src/components/Card/CardsRender.js +5 -3
  413. package/src/components/CarouselWrapper/DefaultCarousel.js +20 -26
  414. package/src/components/ContentGroup/ContentGroupTabs.js +4 -7
  415. package/src/components/DataSummary/DataSummaryTypes/index.js +14 -10
  416. package/src/components/DateTime/DateTime.js +4 -4
  417. package/src/components/EmailConfirm/EmailConfirm.js +9 -11
  418. package/src/components/Image/GlobalLightbox/GlobalLightbox.js +7 -9
  419. package/src/components/Image/GlobalLightbox/index.js +2 -2
  420. package/src/components/Image/Image.js +6 -4
  421. package/src/components/Image/ImageFactory.js +5 -5
  422. package/src/components/ItemList/hooks/use-item-list-id.js +10 -13
  423. package/src/components/Layout/LayoutFactory.js +2 -2
  424. package/src/components/Layout/LayoutWithStickyTimer.js +11 -14
  425. package/src/components/List/ListFactory.js +10 -11
  426. package/src/components/List/ListRender.js +6 -1
  427. package/src/components/List/components/Pagination/ListPagination.js +3 -6
  428. package/src/components/List/components/Pagination/LoadMore.js +7 -9
  429. package/src/components/List/helpers/sort-aggs.js +1 -2
  430. package/src/components/Menu/Menu.js +13 -19
  431. package/src/components/Menu/MenuContext.js +1 -1
  432. package/src/components/MenuItem/MenuItemRender.js +9 -30
  433. package/src/components/MenuItem/helpers/index.js +1 -3
  434. package/src/components/ModalAdapter/index.js +2 -2
  435. package/src/components/SearchContent/SearchContent.js +26 -32
  436. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +15 -19
  437. package/src/components/Video/providers/Vimeo/VimeoProvider.js +19 -22
  438. package/src/components/Video/providers/YouTube/YoutubeEmbeded.js +58 -64
  439. package/src/components/Video/providers/get-provider.js +4 -4
  440. package/src/components/Wrapper.js +5 -7
  441. package/src/components/index.js +20 -20
  442. package/src/constants/index.js +2 -1
  443. package/src/helpers/build-search-values-checkbox-select.js +1 -1
  444. package/src/helpers/get-current-offset.js +1 -1
  445. package/src/helpers/get-wrapped-value-with-link.js +1 -1
  446. package/src/helpers/remove-unwanted-characters.js +1 -4
  447. package/src/hooks/helpers/buildPBComponents.js +2 -4
  448. package/src/hooks/helpers/get-components-to-insert-by-type.js +3 -1
  449. package/src/hooks/helpers/inject-textblock-banners.js +2 -8
  450. package/src/hooks/use-check-mobile-screen.js +5 -8
  451. package/src/hooks/use-get-entity-schema.js +5 -1
  452. package/src/hooks/use-get-image-id-from-relation.js +5 -1
  453. package/src/hooks/use-page-builder.js +9 -12
  454. package/src/variants/Infographic/index.js +2 -2
  455. package/src/variants/LongformGallery/LongformGallery.js +2 -8
  456. package/src/variants/LongformGallery/index.js +2 -2
  457. package/src/variants/SlideSummary/index.js +2 -2
  458. package/src/variants/ThumbnailCarousel/ThumbnailImage/ThumbnailImage.js +2 -3
  459. package/src/variants/ThumbnailCarousel/index.js +2 -2
  460. package/tests/unit/src/HOC/withTitle.test.js +11 -21
  461. package/tests/unit/src/Layout/Layout.test.js +2 -1
  462. package/tests/unit/src/Layout/helpers/check-if-row-has-columns.test.js +1 -0
  463. package/tests/unit/src/components/Banner/AdSlotRender.test.js +4 -1
  464. package/tests/unit/src/components/Banner/helpers.test.js +34 -7
  465. package/tests/unit/src/components/BlazeLink.test.js +1 -4
  466. package/tests/unit/src/components/Breadcrumb/__snapshots__/Breadcrumb.test.js.snap +18 -0
  467. package/tests/unit/src/components/Card/Card.test.js +17 -4
  468. package/tests/unit/src/components/Card/CardContainer.test.js +7 -1
  469. package/tests/unit/src/components/Card/__snapshots__/Card.test.js.snap +15 -0
  470. package/tests/unit/src/components/Card/__snapshots__/CardContainer.test.js.snap +12 -0
  471. package/tests/unit/src/components/Card/mockData.js +2 -4
  472. package/tests/unit/src/components/Carousel/CarouselRender/CarouselRender.test.js +47 -46
  473. package/tests/unit/src/components/Carousel/CarouselRender/__snapshots__/CarouselRender.test.js.snap +45 -1
  474. package/tests/unit/src/components/Carousel/CarouselRender/mocks.js +0 -0
  475. package/tests/unit/src/components/Carousel/__snapshots__/Carousel.test.js.snap +1 -1
  476. package/tests/unit/src/components/ContentGroup/ContentGroupTabs.test.js +4 -1
  477. package/tests/unit/src/components/ContentGroup/helpers/get-sections-data.test.js +4 -1
  478. package/tests/unit/src/components/DataSummary/__snapshots__/DataSummaryRender.test.js.snap +0 -1
  479. package/tests/unit/src/components/DataSummary/helpers/build-props-to-display-with-content.test.js +5 -1
  480. package/tests/unit/src/components/DataSummary/helpers/get-value-from-array.test.js +4 -1
  481. package/tests/unit/src/components/DataSummary/helpers/strip-summary-props-content.test.js +8 -2
  482. package/tests/unit/src/components/DataSummary/mockData.js +4 -1
  483. package/tests/unit/src/components/Image/ImageFactory.test.js +4 -3
  484. package/tests/unit/src/components/ItemList/ItemListCounter.test.js +2 -1
  485. package/tests/unit/src/components/ItemList/hooks/use-item-list-id.test.js +1 -1
  486. package/tests/unit/src/components/Layout/LayoutFactory.test.js +0 -4
  487. package/tests/unit/src/components/List/components/Cards/CardsRender.test.js +8 -1
  488. package/tests/unit/src/components/List/components/Pagination/Classic.test.js +1 -1
  489. package/tests/unit/src/components/PlaceholderIcon/index.test.js +2 -2
  490. package/tests/unit/src/components/SearchFilter/components/Range.test.js +5 -5
  491. package/tests/unit/src/components/SearchFilter/components/__snapshots__/Range.test.js.snap +175 -190
  492. package/tests/unit/src/components/SearchFilter/helpers/get-select-options.test.js +8 -2
  493. package/tests/unit/src/components/TextBlock/TextBlock.test.js +1 -1
  494. package/tests/unit/src/components/TextBlock/__snapshots__/TextBlock.test.js.snap +12 -0
  495. package/tests/unit/src/helpers/__snapshots__/parse-textBlock.test.js.snap +1 -13
  496. package/tests/unit/src/helpers/build-checkbox-filters.test.js +4 -1
  497. package/tests/unit/src/helpers/get-dictionary-match.test.js +1 -1
  498. package/tests/unit/src/helpers/parse-textBlock.test.js +4 -2
  499. package/tests/unit/src/hooks/use-check-mobile-screen.test.js +3 -2
  500. package/tests/unit/src/hooks/use-get-image-id-from-relation.test.js +3 -3
  501. package/tests/unit/src/hooks/use-get-images.test.js +16 -14
  502. package/tests/unit/src/hooks/use-get-single-entity-schema.test.js +6 -4
  503. package/lib/components/MenuItem/helpers/has-active-child.js +0 -19
  504. package/lib/components/MenuItem/helpers/has-active-child.js.map +0 -1
  505. package/lib/components/MenuItem/helpers/isUrlPathMatch.js +0 -18
  506. package/lib/components/MenuItem/helpers/isUrlPathMatch.js.map +0 -1
  507. package/lib-es/components/MenuItem/helpers/has-active-child.js +0 -5
  508. package/lib-es/components/MenuItem/helpers/has-active-child.js.map +0 -1
  509. package/lib-es/components/MenuItem/helpers/isUrlPathMatch.js +0 -8
  510. package/lib-es/components/MenuItem/helpers/isUrlPathMatch.js.map +0 -1
  511. package/src/components/MenuItem/helpers/has-active-child.js +0 -10
  512. package/src/components/MenuItem/helpers/isUrlPathMatch.js +0 -10
  513. package/tests/unit/src/components/MenuItem/helpers/constants.js +0 -73
  514. package/tests/unit/src/components/MenuItem/helpers/has-active-child.test.js +0 -35
  515. package/tests/unit/src/components/MenuItem/helpers/is-url-path-match.test.js +0 -53
  516. package/tests/unit/src/hooks/use-page-builder.test.js +0 -48
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import React from 'react';
5
5
  import { render, act, waitFor } from '@testing-library/react';
6
-
6
+ import { useRouter } from 'next/router';
7
7
  import '@testing-library/jest-dom/extend-expect';
8
8
  import CardsContainer from '../../../../../src/components/Card/CardsContainer';
9
9
  import { cardDataMockedOptions } from './mockData';
@@ -12,6 +12,11 @@ jest.mock('@blaze-cms/utils-handlebars', () => ({
12
12
  useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
13
13
  }));
14
14
 
15
+ jest.mock('react', () => ({
16
+ ...jest.requireActual('react'),
17
+ useContext: () => ({ itemId: 'contextItemId', isPreview: false })
18
+ }));
19
+
15
20
  // eslint-disable-next-line react/prop-types
16
21
  jest.mock('../../../../../src/components/LazyImage', () => () => null);
17
22
 
@@ -30,6 +35,7 @@ const renderComponent = async props => {
30
35
  };
31
36
 
32
37
  describe('CardsContainer component', () => {
38
+ useRouter();
33
39
  it('should render without throwing error and match snapshot', async () => {
34
40
  const { asFragment } = await renderComponent({
35
41
  ...cardDataMockedOptions,
@@ -38,6 +38,9 @@ exports[`Card component should not render alternative headline if alternativePre
38
38
  <a
39
39
  aria-label="mock name"
40
40
  href="/mockurl"
41
+ />
42
+ <a
43
+ href="/mockurl"
41
44
  >
42
45
  mock name
43
46
  </a>
@@ -109,6 +112,9 @@ exports[`Card component should not render alternative headline if displayCategor
109
112
  <a
110
113
  aria-label="mock name"
111
114
  href="/mockurl"
115
+ />
116
+ <a
117
+ href="/mockurl"
112
118
  >
113
119
  mock name
114
120
  </a>
@@ -187,6 +193,9 @@ exports[`Card component should not render preHeader if alternativeHeadline is no
187
193
  <a
188
194
  aria-label="mock name"
189
195
  href="/mockurl"
196
+ />
197
+ <a
198
+ href="/mockurl"
190
199
  >
191
200
  mock name
192
201
  </a>
@@ -263,6 +272,9 @@ exports[`Card component should render customPreheader and alternativeHeadline in
263
272
  <a
264
273
  aria-label="Alternative headline"
265
274
  href="/mockurl"
275
+ />
276
+ <a
277
+ href="/mockurl"
266
278
  >
267
279
  Alternative headline
268
280
  </a>
@@ -424,6 +436,9 @@ exports[`Card component should render without throwing an error and match snapsh
424
436
  <a
425
437
  aria-label="mock name"
426
438
  href="/mockurl"
439
+ />
440
+ <a
441
+ href="/mockurl"
427
442
  >
428
443
  mock name
429
444
  </a>
@@ -43,6 +43,9 @@ exports[`CardsContainer component should render with carousel if option is enabl
43
43
  <a
44
44
  aria-label="Swan 78"
45
45
  href="/nautors-swan/swan-78"
46
+ />
47
+ <a
48
+ href="/nautors-swan/swan-78"
46
49
  >
47
50
  Swan 78
48
51
  </a>
@@ -82,6 +85,9 @@ exports[`CardsContainer component should render with carousel if option is enabl
82
85
  <a
83
86
  aria-label="Swan 98"
84
87
  href="/nautors-swan/swan-98"
88
+ />
89
+ <a
90
+ href="/nautors-swan/swan-98"
85
91
  >
86
92
  Swan 98
87
93
  </a>
@@ -135,6 +141,9 @@ exports[`CardsContainer component should render without throwing error and match
135
141
  <a
136
142
  aria-label="Swan 78"
137
143
  href="/nautors-swan/swan-78"
144
+ />
145
+ <a
146
+ href="/nautors-swan/swan-78"
138
147
  >
139
148
  Swan 78
140
149
  </a>
@@ -174,6 +183,9 @@ exports[`CardsContainer component should render without throwing error and match
174
183
  <a
175
184
  aria-label="Swan 98"
176
185
  href="/nautors-swan/swan-98"
186
+ />
187
+ <a
188
+ href="/nautors-swan/swan-98"
177
189
  >
178
190
  Swan 98
179
191
  </a>
@@ -4,8 +4,7 @@ const cardDataMockedOptions = {
4
4
  name: 'Swan 78',
5
5
  url: '/nautors-swan/swan-78',
6
6
  image: {
7
- url:
8
- 'https://cdn-events.boatinternational.com/files/2020/04/2506afd0-879a-11ea-aab3-6d01477a82d7-180807_esk_0267.jpg',
7
+ url: 'https://cdn-events.boatinternational.com/files/2020/04/2506afd0-879a-11ea-aab3-6d01477a82d7-180807_esk_0267.jpg',
9
8
  data: {
10
9
  altText: 'Swan 78 | Exterior',
11
10
  caption: ''
@@ -25,8 +24,7 @@ const cardDataMockedOptions = {
25
24
  url: '/nautors-swan/swan-98',
26
25
  arrowSize: 14,
27
26
  image: {
28
- url:
29
- 'https://cdn-events.boatinternational.com/files/2020/04/2f8c4030-879c-11ea-aab3-6d01477a82d7-Swan 98 - 1.jpg',
27
+ url: 'https://cdn-events.boatinternational.com/files/2020/04/2f8c4030-879c-11ea-aab3-6d01477a82d7-Swan 98 - 1.jpg',
30
28
  data: {
31
29
  altText: 'Swan 98 | Exterior',
32
30
  caption: ''
@@ -3,71 +3,72 @@
3
3
  */
4
4
  import React from 'react';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
- import { shallow } from 'enzyme';
7
- import CarouselImage from '../../../../../../src/components/Carousel/CarouselImage';
6
+ import { useRouter } from 'next/router';
7
+ import { render, waitFor } from '@testing-library/react';
8
+ import { MockedRoot } from '@blaze-cms/tools/test-helpers/test-functions';
9
+ import { MOCK_BASIC, MOCK_RELATION } from '../../Image/mocks';
8
10
  import CarouselRender from '../../../../../../src/components/Carousel/CarouselRender';
9
-
11
+ // TODO fix test breaking
10
12
  jest.mock('@blaze-cms/utils-handlebars', () => ({
11
- useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
13
+ useStringTemplate: jest.fn((_, [title]) => ({ loadig: false, data: [title] }))
14
+ }));
15
+
16
+ jest.mock('react', () => ({
17
+ ...jest.requireActual('react'),
18
+ useContext: () => ({ isPreview: false })
12
19
  }));
13
20
 
14
- const mockedProps = {
21
+ const getMockedProps = overrides => ({
15
22
  imageIds: ['test-id', 'test-altText', 'test-caption'],
16
23
  displayCount: true,
17
24
  enableLightbox: true,
18
25
  toggleModal: jest.fn(),
19
26
  handleSelectedImage: jest.fn(),
20
- shouldDisplayCount: true,
21
- shouldDisplayCaption: true,
22
- direction: {
23
- next: true,
24
- back: false
25
- },
26
- handleNavigation: jest.fn()
27
- };
27
+ ...overrides
28
+ });
28
29
 
29
30
  describe('CarouselRender component', () => {
30
- let wrapper;
31
+ const router = useRouter();
32
+ const mockedProps = getMockedProps();
31
33
 
32
- beforeAll(() => {
33
- wrapper = shallow(<CarouselRender.WrappedComponent {...mockedProps} />);
34
- });
35
-
36
- it('should be defined and render without throwing error', () => {
37
- expect(CarouselRender).toBeDefined();
38
- expect(typeof CarouselRender).toEqual('function');
39
- });
34
+ it('should render one image button if there is one image to display', async () => {
35
+ const overrides = { imageIds: ['test1'] };
36
+ const { getByText } = render(
37
+ <MockedRoot mocks={MOCK_BASIC}>
38
+ <CarouselRender {...mockedProps} {...overrides} />
39
+ </MockedRoot>
40
+ );
40
41
 
41
- it('should match snapshot', async () => {
42
- const component = shallow(<CarouselRender {...mockedProps} />);
43
- expect(component).toMatchSnapshot();
42
+ await waitFor(() => {
43
+ expect(getByText('1 image')).toBeInTheDocument();
44
+ });
44
45
  });
45
46
 
46
- it('should render number count if there are images to display and show count is enabled', () => {
47
- expect(wrapper.find('p').length).toEqual(1);
48
- });
47
+ it('should render n images button if there is more than one image to display', async () => {
48
+ const overrides = { imageIds: ['test-id', 'test-id-2'] };
49
+ const { getByText } = render(
50
+ <MockedRoot mocks={MOCK_RELATION}>
51
+ <CarouselRender {...mockedProps} {...overrides} />
52
+ </MockedRoot>
53
+ );
49
54
 
50
- it('should render the right amount of images to display', () => {
51
- expect(wrapper.find(CarouselImage).length).toEqual(3);
55
+ await waitFor(() => {
56
+ expect(getByText('2 images')).toBeInTheDocument();
57
+ });
52
58
  });
53
59
 
54
- it('should not render number count if display count is disabled', () => {
55
- const overrides = { shouldDisplayCount: false };
56
- const wrapperCountDisabled = shallow(
57
- <CarouselRender.WrappedComponent {...mockedProps} {...overrides} />
60
+ it('should not render number count if display count is disabled', async () => {
61
+ const overrides = { displayCount: false };
62
+ const { asFragment, container } = render(
63
+ <MockedRoot mocks={MOCK_BASIC}>
64
+ <CarouselRender {...mockedProps} {...overrides} />
65
+ </MockedRoot>
58
66
  );
59
- expect(wrapperCountDisabled.find('p').length).toEqual(0);
60
- });
61
-
62
- it('should not display number count after clicking previous image', () => {
63
- const wrapperPrevClick = shallow(<CarouselRender.WrappedComponent {...mockedProps} />);
64
- wrapperPrevClick.find('div.carousel__button--previous').simulate('click');
65
- expect(mockedProps.handleNavigation).toHaveBeenCalledWith(mockedProps.direction.back);
66
- });
67
67
 
68
- it('should not display number count after clicking next image', () => {
69
- const wrapperNextClick = shallow(<CarouselRender.WrappedComponent {...mockedProps} />);
70
- wrapperNextClick.find('div.carousel__button--next').simulate('click');
71
- expect(mockedProps.handleNavigation).toHaveBeenCalledWith(mockedProps.direction.next);
68
+ await waitFor(() => {
69
+ const countDisplay = container.querySelector('p');
70
+ expect(countDisplay).toBe(null);
71
+ expect(asFragment()).toMatchSnapshot();
72
+ });
72
73
  });
73
74
  });
@@ -1,3 +1,47 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`CarouselRender component should match snapshot 1`] = `ShallowWrapper {}`;
3
+ exports[`CarouselRender component should not render number count if display count is disabled 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="carousel"
7
+ >
8
+ <div>
9
+ <div
10
+ class="carousel__button carousel__button--previous"
11
+ role="button"
12
+ >
13
+ <div
14
+ class="arrow arrow--left"
15
+ />
16
+ </div>
17
+ <div
18
+ class="carousel__list"
19
+ >
20
+ <div
21
+ class="carousel__slide"
22
+ >
23
+ <div />
24
+ </div>
25
+ <div
26
+ class="carousel__slide"
27
+ >
28
+ <div />
29
+ </div>
30
+ <div
31
+ class="carousel__slide"
32
+ >
33
+ <div />
34
+ </div>
35
+ </div>
36
+ <div
37
+ class="carousel__button carousel__button--next"
38
+ role="button"
39
+ >
40
+ <div
41
+ class="arrow arrow--right"
42
+ />
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </DocumentFragment>
47
+ `;
@@ -21,7 +21,7 @@ exports[`Carousel component should render carousel and match snapshot 1`] = `
21
21
  <div
22
22
  class="carousel__slide"
23
23
  >
24
- <span />
24
+ <div />
25
25
  </div>
26
26
  </div>
27
27
  <div
@@ -13,7 +13,10 @@ const mockedProps = {
13
13
  name: 'testTabs',
14
14
  contentType: 'tab',
15
15
  groupSections: [<div>section one</div>, <div>section two</div>],
16
- sectionsData: [['section-one', 'sectionOne'], ['section-two', 'sectionTwo']]
16
+ sectionsData: [
17
+ ['section-one', 'sectionOne'],
18
+ ['section-two', 'sectionTwo']
19
+ ]
17
20
  };
18
21
 
19
22
  describe('ContentGroupTabs component', () => {
@@ -15,7 +15,10 @@ describe('getSectionsData helper', () => {
15
15
  it('should return section name and label', () => {
16
16
  const match = getSectionsData(mockedSections);
17
17
 
18
- expect(match).toEqual([['nameone', 'labelonne'], ['nameTwo', 'labelTwo']]);
18
+ expect(match).toEqual([
19
+ ['nameone', 'labelonne'],
20
+ ['nameTwo', 'labelTwo']
21
+ ]);
19
22
  });
20
23
 
21
24
  it('should return section name and label propertly formated when spaces are present', () => {
@@ -4,7 +4,6 @@ exports[`DataSummaryRender component should render without throwing an error 1`]
4
4
  <div
5
5
  className="stats"
6
6
  >
7
-
8
7
  <div
9
8
  className="stats__wrapper"
10
9
  >
@@ -7,7 +7,11 @@ const mockerPropsObj = {
7
7
  id: 'f6a84af0-d956-11e9-b283-ffc6056b4ee9',
8
8
  metaDescription: '',
9
9
  name: 'Page2',
10
- tags: [{ name: 'name1', id: '1' }, { name: 'name2', id: '2' }, { name: 'name3', id: '3' }],
10
+ tags: [
11
+ { name: 'name1', id: '1' },
12
+ { name: 'name2', id: '2' },
13
+ { name: 'name3', id: '3' }
14
+ ],
11
15
  url: '/test2'
12
16
  };
13
17
 
@@ -19,7 +19,10 @@ describe('build props to display func', () => {
19
19
  });
20
20
 
21
21
  it('should return object with correct data', () => {
22
- const arrMultiple = [{ id: 'id1', url: 'url1' }, { id: 'id2', url: 'url2' }];
22
+ const arrMultiple = [
23
+ { id: 'id1', url: 'url1' },
24
+ { id: 'id2', url: 'url2' }
25
+ ];
23
26
  const resultMultiple = getValueFromArray(key, arrMultiple, prefix, suffix);
24
27
 
25
28
  expect(resultMultiple).toHaveLength(2);
@@ -4,8 +4,14 @@ import stripSummaryPropsContent from '../../../../../../src/components/DataSumma
4
4
  describe('strip summary props content', () => {
5
5
  const stripTrue = [{ shouldStrip: true }];
6
6
  const stripFalse = [{ shouldStrip: false }];
7
- const mockedData = [['Props', '| meta | description |', ''], ['Props', 'meta', '']];
8
- const expectedResult = [['Props', 'meta | description', ''], ['Props', 'meta', '']];
7
+ const mockedData = [
8
+ ['Props', '| meta | description |', ''],
9
+ ['Props', 'meta', '']
10
+ ];
11
+ const expectedResult = [
12
+ ['Props', 'meta | description', ''],
13
+ ['Props', 'meta', '']
14
+ ];
9
15
 
10
16
  const result = stripSummaryPropsContent(stripTrue, mockedData);
11
17
 
@@ -3,7 +3,10 @@ import { generateSingleItemQuery } from '../../../../../src/application/query';
3
3
  const propsDataSummary = {
4
4
  elementTitle: 'test-title',
5
5
  modifier: 'mod',
6
- summaryPropsWithContent: [['first', 'something', '', ''], ['second', 'other thing', '', '']],
6
+ summaryPropsWithContent: [
7
+ ['first', 'something', '', ''],
8
+ ['second', 'other thing', '', '']
9
+ ],
7
10
  propsToDisplayModifiers: []
8
11
  };
9
12
 
@@ -73,9 +73,10 @@ describe('ImageFactory component', () => {
73
73
  });
74
74
 
75
75
  it('should render image', async () => {
76
- const { asFragment } = await setupTest({}, MOCK_BASIC);
77
-
78
- await waitFor(() => expect(asFragment()).toBeDefined(), options);
76
+ const { asFragment, container } = await setupTest({ imageId: 'test-id' }, MOCK_BASIC);
77
+ await waitFor(() => {
78
+ expect(container.childNodes.length).toBe(1);
79
+ });
79
80
  expect(asFragment()).toMatchSnapshot();
80
81
  });
81
82
 
@@ -44,7 +44,6 @@ const mocks = [
44
44
  ];
45
45
 
46
46
  const buttonRole = 'button';
47
- const router = useRouter();
48
47
 
49
48
  describe('ItemListCounter component', () => {
50
49
  beforeEach(() => {
@@ -52,6 +51,8 @@ describe('ItemListCounter component', () => {
52
51
  });
53
52
 
54
53
  it('should display listItem count and route to url', async () => {
54
+ const router = useRouter(); // Move the useRouter call here
55
+
55
56
  const { asFragment, getByRole, getByText } = render(
56
57
  <MockedProvider mocks={mocks}>
57
58
  <ItemListCounter {...props} />
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import { renderHook, act } from '@testing-library/react-hooks';
4
+ import { renderHook, act } from '@testing-library/react';
5
5
  import useItemListId from '../../../../../../src/components/ItemList/hooks/use-item-list-id';
6
6
  import getItemListId from '../../../../../../src/components/ItemList/helpers/get-item-list-id';
7
7
 
@@ -23,10 +23,6 @@ const testId = 'child-test-id';
23
23
  describe('LayoutFactoriy component', () => {
24
24
  const props = { someProps: true, children: <div data-testid={testId} /> };
25
25
 
26
- it('should be defined', () => {
27
- expect(Layout).toBeDefined();
28
- });
29
-
30
26
  it('should render Layout component', () => {
31
27
  const { getByTestId } = render(<Layout {...props} />);
32
28
  expect(getByTestId(defaultComponentTestId)).toBeDefined();
@@ -2,19 +2,26 @@
2
2
  * @jest-environment jsdom
3
3
  */
4
4
  import '@testing-library/jest-dom/extend-expect';
5
+ import { useRouter } from 'next/router';
5
6
  import { render } from '@blaze-cms/tools/test-helpers/test-functions';
6
7
  import CardsRender from '../../../../../../../src/components/List/components/Cards';
7
8
  import { MOCKED_LIST_OPTIONS } from '../mocks';
8
9
 
9
10
  jest.mock('@blaze-cms/utils-handlebars', () => ({
10
- useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ useStringTemplate: jest.fn((_, [title]) => ({ loadig: false, data: [title] }))
11
12
  }));
12
13
 
13
14
  jest.mock('../../../../../../../src/hooks', () => ({
14
15
  useGetImages: jest.fn(() => ({ data: {}, loading: false }))
15
16
  }));
16
17
 
18
+ jest.mock('react', () => ({
19
+ ...jest.requireActual('react'),
20
+ useContext: () => ({ itemId: 'contextItemId', isPreview: false })
21
+ }));
22
+
17
23
  describe('CardsRender component', () => {
24
+ useRouter();
18
25
  it('should render based on listData received', async () => {
19
26
  const { asFragment } = await render(CardsRender, MOCKED_LIST_OPTIONS);
20
27
  expect(asFragment()).toMatchSnapshot();
@@ -15,7 +15,7 @@ const mockedOptions = {
15
15
 
16
16
  describe('Classic pagination component', () => {
17
17
  it('should render based on props passed', async () => {
18
- const { asFragment } = await render(Classic, { ...mockedOptions, isInfinite: true });
18
+ const { asFragment } = render(Classic, { ...mockedOptions, isInfinite: true });
19
19
  expect(asFragment()).toMatchSnapshot();
20
20
  });
21
21
  });
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
5
 
6
- import PlaceholderIcon from '../../../../../../blaze-plugin-page-builder-ui/src/components/EditorView/PlaceholderIcon';
7
- import { CardIcon } from '../../../../../../blaze-plugin-page-builder-ui/src/Icons';
6
+ import { CardIcon } from '@blaze-cms/plugin-page-builder-ui/src/Icons';
7
+ import PlaceholderIcon from '@blaze-cms/plugin-page-builder-ui/src/components/EditorView/PlaceholderIcon';
8
8
 
9
9
  const mockedProps = {
10
10
  type: 'card',
@@ -38,14 +38,14 @@ describe('Range component', () => {
38
38
  const component = await getMockedProvider(Range, {
39
39
  props: { ...getMockedProps() }
40
40
  });
41
- expect(component.toJSON()).toMatchSnapshot();
41
+ expect(component).toMatchSnapshot();
42
42
  });
43
43
 
44
44
  it('should match snapshot with interval', async () => {
45
45
  const component = await getMockedProvider(Range, {
46
46
  props: { ...getMockedProps({ rangeInterval: 5 }) }
47
47
  });
48
- expect(component.toJSON()).toMatchSnapshot();
48
+ expect(component).toMatchSnapshot();
49
49
  });
50
50
 
51
51
  it('should match snapshot large values formatted correctly', async () => {
@@ -69,7 +69,7 @@ describe('Range component', () => {
69
69
  const component = await getMockedProvider(Range, {
70
70
  props: { ...mockedProps }
71
71
  });
72
- expect(component.toJSON()).toMatchSnapshot();
72
+ expect(component).toMatchSnapshot();
73
73
  });
74
74
 
75
75
  it('should match snapshot with interval and rounded min & max values', async () => {
@@ -93,7 +93,7 @@ describe('Range component', () => {
93
93
  const component = await getMockedProvider(Range, {
94
94
  props: { ...mockedProps }
95
95
  });
96
- expect(component.toJSON()).toMatchSnapshot();
96
+ expect(component).toMatchSnapshot();
97
97
  });
98
98
 
99
99
  it('should match snapshot with adjusted min & max values based on interval', async () => {
@@ -117,6 +117,6 @@ describe('Range component', () => {
117
117
  const component = await getMockedProvider(Range, {
118
118
  props: { ...mockedProps }
119
119
  });
120
- expect(component.toJSON()).toMatchSnapshot();
120
+ expect(component).toMatchSnapshot();
121
121
  });
122
122
  });