@blaze-cms/react-page-builder 0.133.0 → 0.134.0-admin-updates.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 (184) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/HOC/withTitle.js +12 -2
  3. package/lib/HOC/withTitle.js.map +1 -1
  4. package/lib/components/Banner/AdSlotRender.js +12 -3
  5. package/lib/components/Banner/AdSlotRender.js.map +1 -1
  6. package/lib/components/Banner/Banner.js +4 -7
  7. package/lib/components/Banner/Banner.js.map +1 -1
  8. package/lib/components/Banner/BannerRender.js +7 -3
  9. package/lib/components/Banner/BannerRender.js.map +1 -1
  10. package/lib/components/Banner/helpers.js +2 -2
  11. package/lib/components/Banner/helpers.js.map +1 -1
  12. package/lib/components/BlazeLink.js +2 -2
  13. package/lib/components/BlazeLink.js.map +1 -1
  14. package/lib/components/Button.js +2 -2
  15. package/lib/components/Button.js.map +1 -1
  16. package/lib/components/Card/CardsContainer.js +2 -2
  17. package/lib/components/Card/CardsContainer.js.map +1 -1
  18. package/lib/components/Card/CardsRender.js +2 -2
  19. package/lib/components/Card/CardsRender.js.map +1 -1
  20. package/lib/components/Card/helpers/filter-query-setup.js +2 -2
  21. package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
  22. package/lib/components/ClickWrapper.js +2 -2
  23. package/lib/components/ClickWrapper.js.map +1 -1
  24. package/lib/components/Code/Code.js +2 -2
  25. package/lib/components/Code/Code.js.map +1 -1
  26. package/lib/components/DataSummary/helpers/build-loop-props-content.js +3 -2
  27. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  28. package/lib/components/DataSummary/helpers/get-link-to-published-content.js +2 -0
  29. package/lib/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  30. package/lib/components/Image/Image.js +2 -2
  31. package/lib/components/Image/Image.js.map +1 -1
  32. package/lib/components/Layout/Layout.js +2 -2
  33. package/lib/components/Layout/Layout.js.map +1 -1
  34. package/lib/components/List/ListBuilder.js +2 -2
  35. package/lib/components/List/ListBuilder.js.map +1 -1
  36. package/lib/components/List/ListFactory.js +2 -2
  37. package/lib/components/List/ListFactory.js.map +1 -1
  38. package/lib/components/List/components/Cards/CardsRender.js +2 -2
  39. package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
  40. package/lib/components/List/components/Full/FullRender.js +2 -2
  41. package/lib/components/List/components/Full/FullRender.js.map +1 -1
  42. package/lib/components/List/components/Full/FullRenderItem.js +2 -2
  43. package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
  44. package/lib/components/List/components/Pagination/ListPagination.js +2 -2
  45. package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
  46. package/lib/components/List/helpers/build-az-url.js +2 -2
  47. package/lib/components/List/helpers/build-az-url.js.map +1 -1
  48. package/lib/components/List/helpers/build-pagination-url.js +2 -2
  49. package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
  50. package/lib/components/SearchFilter/components/Range.js +2 -2
  51. package/lib/components/SearchFilter/components/Range.js.map +1 -1
  52. package/lib/components/SearchFilter/searchFilterReducer.js +2 -2
  53. package/lib/components/SearchFilterSort/helpers/update-sort.js +2 -2
  54. package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  55. package/lib/components/TextBlock/index.js +2 -2
  56. package/lib/components/TextBlock/index.js.map +1 -1
  57. package/lib/components/Video/Video.js +2 -2
  58. package/lib/components/Video/Video.js.map +1 -1
  59. package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js +2 -2
  60. package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
  61. package/lib/helpers/append-images.js +2 -2
  62. package/lib/helpers/build-raw-query-base.js +2 -2
  63. package/lib/helpers/build-raw-query-base.js.map +1 -1
  64. package/lib/helpers/build-raw-query.js +2 -2
  65. package/lib/helpers/build-raw-query.js.map +1 -1
  66. package/lib/helpers/get-banner-data.js +2 -2
  67. package/lib/helpers/get-click-wrapper-options.js +2 -2
  68. package/lib/helpers/get-click-wrapper-options.js.map +1 -1
  69. package/lib/helpers/get-entities-with-banner.js +2 -2
  70. package/lib/helpers/get-entities-with-banner.js.map +1 -1
  71. package/lib/helpers/get-generic-props.js +2 -2
  72. package/lib/helpers/get-generic-props.js.map +1 -1
  73. package/lib/helpers/get-generic-render-variables.js +2 -2
  74. package/lib/helpers/get-generic-render-variables.js.map +1 -1
  75. package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +2 -2
  76. package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
  77. package/lib/helpers/process-data-summary-value.js +2 -2
  78. package/lib/helpers/process-data-summary-value.js.map +1 -1
  79. package/lib/helpers/remove-unwanted-characters.js +2 -2
  80. package/lib/helpers/render-children.js +2 -2
  81. package/lib/helpers/render-children.js.map +1 -1
  82. package/lib/helpers/split-children.js +2 -2
  83. package/lib/helpers/update-childrens-parent.js +2 -2
  84. package/lib/hooks/helpers/append-gtm-classname.js +2 -2
  85. package/lib/hooks/helpers/append-gtm-classname.js.map +1 -1
  86. package/lib/hooks/helpers/buildPBComponents.js +2 -2
  87. package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
  88. package/lib/hooks/helpers/get-lightbox-images.js +2 -2
  89. package/lib/hooks/helpers/get-lightbox-images.js.map +1 -1
  90. package/lib/hooks/helpers/inject-element-banners.js +2 -2
  91. package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
  92. package/lib/hooks/helpers/inject-textblock-banners.js +2 -2
  93. package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
  94. package/lib/utils/get-class-modifiers.js +2 -2
  95. package/lib/utils/get-class-modifiers.js.map +1 -1
  96. package/lib-es/HOC/withTitle.js +11 -2
  97. package/lib-es/HOC/withTitle.js.map +1 -1
  98. package/lib-es/components/Banner/AdSlotRender.js +12 -3
  99. package/lib-es/components/Banner/AdSlotRender.js.map +1 -1
  100. package/lib-es/components/Banner/Banner.js +4 -7
  101. package/lib-es/components/Banner/Banner.js.map +1 -1
  102. package/lib-es/components/Banner/BannerRender.js +8 -4
  103. package/lib-es/components/Banner/BannerRender.js.map +1 -1
  104. package/lib-es/components/Banner/helpers.js +2 -2
  105. package/lib-es/components/BlazeLink.js +2 -2
  106. package/lib-es/components/Button.js +2 -2
  107. package/lib-es/components/Card/CardsContainer.js +2 -2
  108. package/lib-es/components/Card/CardsRender.js +2 -2
  109. package/lib-es/components/Card/helpers/filter-query-setup.js +2 -2
  110. package/lib-es/components/ClickWrapper.js +2 -2
  111. package/lib-es/components/Code/Code.js +2 -2
  112. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js +3 -2
  113. package/lib-es/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  114. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js +2 -1
  115. package/lib-es/components/DataSummary/helpers/get-link-to-published-content.js.map +1 -1
  116. package/lib-es/components/Image/Image.js +2 -2
  117. package/lib-es/components/Layout/Layout.js +2 -2
  118. package/lib-es/components/List/ListBuilder.js +2 -2
  119. package/lib-es/components/List/ListFactory.js +2 -2
  120. package/lib-es/components/List/components/Cards/CardsRender.js +2 -2
  121. package/lib-es/components/List/components/Full/FullRender.js +2 -2
  122. package/lib-es/components/List/components/Full/FullRenderItem.js +2 -2
  123. package/lib-es/components/List/components/Pagination/ListPagination.js +2 -2
  124. package/lib-es/components/List/helpers/build-az-url.js +2 -2
  125. package/lib-es/components/List/helpers/build-pagination-url.js +2 -2
  126. package/lib-es/components/SearchFilter/components/Range.js +2 -2
  127. package/lib-es/components/SearchFilter/searchFilterReducer.js +2 -2
  128. package/lib-es/components/SearchFilterSort/helpers/update-sort.js +2 -2
  129. package/lib-es/components/TextBlock/index.js +2 -2
  130. package/lib-es/components/Video/Video.js +2 -2
  131. package/lib-es/components/Video/providers/JWPlayer/JWPlayerProvider.js +2 -2
  132. package/lib-es/helpers/append-images.js +2 -2
  133. package/lib-es/helpers/build-raw-query-base.js +2 -2
  134. package/lib-es/helpers/build-raw-query.js +2 -2
  135. package/lib-es/helpers/get-banner-data.js +2 -2
  136. package/lib-es/helpers/get-click-wrapper-options.js +2 -2
  137. package/lib-es/helpers/get-entities-with-banner.js +2 -2
  138. package/lib-es/helpers/get-generic-props.js +2 -2
  139. package/lib-es/helpers/get-generic-render-variables.js +2 -2
  140. package/lib-es/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js +2 -2
  141. package/lib-es/helpers/process-data-summary-value.js +2 -2
  142. package/lib-es/helpers/remove-unwanted-characters.js +2 -2
  143. package/lib-es/helpers/render-children.js +2 -2
  144. package/lib-es/helpers/split-children.js +2 -2
  145. package/lib-es/helpers/update-childrens-parent.js +2 -2
  146. package/lib-es/hooks/helpers/append-gtm-classname.js +2 -2
  147. package/lib-es/hooks/helpers/buildPBComponents.js +2 -2
  148. package/lib-es/hooks/helpers/get-lightbox-images.js +2 -2
  149. package/lib-es/hooks/helpers/inject-element-banners.js +2 -2
  150. package/lib-es/hooks/helpers/inject-textblock-banners.js +2 -2
  151. package/lib-es/utils/get-class-modifiers.js +2 -2
  152. package/package.json +11 -11
  153. package/src/HOC/withTitle.js +12 -2
  154. package/src/components/Banner/AdSlotRender.js +9 -5
  155. package/src/components/Banner/Banner.js +9 -11
  156. package/src/components/Banner/BannerRender.js +4 -0
  157. package/src/components/DataSummary/helpers/build-loop-props-content.js +3 -2
  158. package/src/components/DataSummary/helpers/get-link-to-published-content.js +4 -1
  159. package/tests/unit/src/HOC/withTitle.test.js +4 -4
  160. package/tests/unit/src/components/Banner/AdSlotRender.test.js +6 -11
  161. package/tests/unit/src/components/Banner/BannerRender.test.js +4 -0
  162. package/tests/unit/src/components/Banner/__snapshots__/AdSlotRender.test.js.snap +45 -25
  163. package/tests/unit/src/components/Banner/__snapshots__/BannerRender.test.js.snap +8 -3
  164. package/tests/unit/src/components/Button.test.js +4 -0
  165. package/tests/unit/src/components/Card/CardContainer.test.js +4 -0
  166. package/tests/unit/src/components/Carousel/CarouselRender/CarouselRender.test.js +4 -0
  167. package/tests/unit/src/components/Code/Code.test.js +4 -0
  168. package/tests/unit/src/components/Code.test.js +4 -0
  169. package/tests/unit/src/components/DataSummary/DataSummaryTypes/ItemDetailsSummary.test.js +4 -0
  170. package/tests/unit/src/components/DataSummary/DataSummaryTypes/LargeSummary.test.js +4 -0
  171. package/tests/unit/src/components/DataSummary/DataSummaryTypes/ListSummary.test.js +4 -0
  172. package/tests/unit/src/components/DataSummary/DataSummaryTypes/TextSummary.test.js +4 -0
  173. package/tests/unit/src/components/DataSummary/helpers/build-loop-props-content.test.js +41 -0
  174. package/tests/unit/src/components/DataSummary/helpers/get-link-to-published-content.test.js +21 -0
  175. package/tests/unit/src/components/List/components/Cards/CardsRender.test.js +4 -0
  176. package/tests/unit/src/components/List/components/Cards/CardsRenderWrapper.test.js +4 -0
  177. package/tests/unit/src/components/PlaceholderIcon/__snapshots__/index.test.js.snap +72 -0
  178. package/tests/unit/src/components/PlaceholderIcon/index.test.js +20 -0
  179. package/tests/unit/src/components/SearchFilter/components/Checkbox.test.js +4 -0
  180. package/tests/unit/src/components/SearchFilter/components/Select.test.js +4 -0
  181. package/tests/unit/src/components/SearchFilter/components/TextSearch.test.js +4 -0
  182. package/tests/unit/src/components/SearchFilterSort/SearchFilterSort.test.js +4 -0
  183. package/tests/unit/src/components/SocialFollow/SocialFollow.test.js +4 -0
  184. package/tests/unit/src/components/TextBlock/TextBlock.test.js +4 -0
@@ -2,9 +2,14 @@
2
2
 
3
3
  exports[`Banner render component should render 1`] = `
4
4
  <DocumentFragment>
5
- <style />
6
5
  <div
7
- class="ad-slot ad-slot-loading banner-sizeId"
8
- />
6
+ class="banner banner-loading"
7
+ >
8
+ <style />
9
+ <div
10
+ class="ad-slot ad-slot-loading banner-sizeId"
11
+ data-testid="ad-slot"
12
+ />
13
+ </div>
9
14
  </DocumentFragment>
10
15
  `;
@@ -6,6 +6,10 @@ import { act, render, fireEvent, waitFor } from '@testing-library/react';
6
6
  import '@testing-library/jest-dom/extend-expect';
7
7
  import Button from '../../../../src/components/Button';
8
8
 
9
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
10
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ }));
12
+
9
13
  jest.mock('@apollo/client', () => ({
10
14
  ...jest.requireActual('@apollo/client'),
11
15
  useApolloClient: jest.fn(() => ({ resetStore: () => null }))
@@ -8,6 +8,10 @@ import '@testing-library/jest-dom/extend-expect';
8
8
  import CardsContainer from '../../../../../src/components/Card/CardsContainer';
9
9
  import { cardDataMockedOptions } from './mockData';
10
10
 
11
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
12
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
13
+ }));
14
+
11
15
  // eslint-disable-next-line react/prop-types
12
16
  jest.mock('../../../../../src/components/LazyImage', () => () => null);
13
17
 
@@ -7,6 +7,10 @@ import { shallow } from 'enzyme';
7
7
  import CarouselImage from '../../../../../../src/components/Carousel/CarouselImage';
8
8
  import CarouselRender from '../../../../../../src/components/Carousel/CarouselRender';
9
9
 
10
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
11
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
12
+ }));
13
+
10
14
  const getMockedProps = overrides => ({
11
15
  imageIds: ['test-id', 'test-altText', 'test-caption'],
12
16
  displayCount: true,
@@ -5,6 +5,10 @@ import React from 'react';
5
5
  import { render } from '@blaze-cms/tools/test-helpers/test-functions';
6
6
  import Code from '../../../../../src/components/Code/Code';
7
7
 
8
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
9
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
10
+ }));
11
+
8
12
  jest.mock('../../../../../src/components/Code/ScriptTag', () => () => (
9
13
  <span data-testid="scriptTag" />
10
14
  ));
@@ -4,6 +4,10 @@
4
4
  import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
5
  import Code from '../../../../src/components/Code';
6
6
 
7
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
8
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
9
+ }));
10
+
7
11
  const props = {
8
12
  code: '<p>Lorem ipsum</p>',
9
13
  parent: {
@@ -6,6 +6,10 @@ import '@testing-library/jest-dom/extend-expect';
6
6
  import ItemDetailsSummary from '../../../../../../src/components/DataSummary/DataSummaryTypes/ItemDetailsSummary';
7
7
  import { propsDataSummary } from '../mockData';
8
8
 
9
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
10
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ }));
12
+
9
13
  describe('ItemDetailsSummary component', () => {
10
14
  it('should render without throwing an error and match snapshot', () => {
11
15
  const { asFragment } = render(ItemDetailsSummary, propsDataSummary);
@@ -6,6 +6,10 @@ import '@testing-library/jest-dom/extend-expect';
6
6
  import LargeSummary from '../../../../../../src/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummary';
7
7
  import { propsDataSummary } from '../mockData';
8
8
 
9
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
10
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ }));
12
+
9
13
  describe('LargeSummary component', () => {
10
14
  it('should render without throwing an error and match snapshot', () => {
11
15
  const { asFragment } = render(LargeSummary, propsDataSummary);
@@ -6,6 +6,10 @@ import ListSummary from '../../../../../../src/components/DataSummary/DataSummar
6
6
  import { propsDataSummary } from '../mockData';
7
7
  import '@testing-library/jest-dom/extend-expect';
8
8
 
9
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
10
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ }));
12
+
9
13
  describe('ListSummary component', () => {
10
14
  it('should render without throwing an error and match snapshot', () => {
11
15
  const { asFragment } = render(ListSummary, propsDataSummary);
@@ -6,6 +6,10 @@ import TextSummary from '../../../../../../src/components/DataSummary/DataSummar
6
6
  import { propsDataSummary } from '../mockData';
7
7
  import '@testing-library/jest-dom/extend-expect';
8
8
 
9
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
10
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ }));
12
+
9
13
  describe('TextSummary component', () => {
10
14
  it('should render without throwing an error and match snapshot', () => {
11
15
  const { asFragment } = render(TextSummary, propsDataSummary);
@@ -90,4 +90,45 @@ describe('buildLoopPropsContent helper function', () => {
90
90
  });
91
91
  expect.hasAssertions();
92
92
  });
93
+
94
+ it('should nested items with urls', () => {
95
+ const data = {
96
+ nestedLoopProp: [
97
+ {
98
+ nestedValue: 'abc',
99
+ url: 'http://blazecms.app/abc'
100
+ },
101
+ {
102
+ nestedValue: '123',
103
+ url: 'http://blazecms.app/123'
104
+ },
105
+ {
106
+ nestedValue: 'no url',
107
+ url: null
108
+ }
109
+ ]
110
+ };
111
+ const withUrl = buildLoopPropsContent(
112
+ mockedLoopProps,
113
+ [
114
+ {
115
+ bold: false,
116
+ enableLink: true,
117
+ label: '',
118
+ modifier: '',
119
+ prefix: '',
120
+ propertiesToDisplay: ['nestedLoopProp.nestedValue'],
121
+ shouldStrip: true
122
+ }
123
+ ],
124
+ 0,
125
+ data
126
+ );
127
+
128
+ withUrl.forEach(([, value, url], index) => {
129
+ expect(value).toEqual(data.nestedLoopProp[index].nestedValue);
130
+ expect(url).toEqual(data.nestedLoopProp[index].url || '');
131
+ });
132
+ expect.hasAssertions();
133
+ });
93
134
  });
@@ -38,4 +38,25 @@ describe('get link to published content', () => {
38
38
  const result = getLinkToPublishedContent(publishedKey, props);
39
39
  expect(result).toEqual('');
40
40
  });
41
+
42
+ it('should return url from the currentValue', () => {
43
+ const currentValue = { url: 'currentValueUrl' };
44
+ const props = { content: [content] };
45
+ const result = getLinkToPublishedContent(publishedKey, props, currentValue);
46
+ expect(result).toEqual(currentValue.url);
47
+ });
48
+
49
+ it('should return url from the currentValue even if falsey', () => {
50
+ const currentValue = { url: null };
51
+ const props = { content: [content] };
52
+ const result = getLinkToPublishedContent(publishedKey, props, currentValue);
53
+ expect(result).toEqual(currentValue.url);
54
+ });
55
+
56
+ it('should not return url from the currentValue if not set', () => {
57
+ const currentValue = {};
58
+ const props = { content: [content] };
59
+ const result = getLinkToPublishedContent(publishedKey, props, currentValue);
60
+ expect(result).toEqual(content.url);
61
+ });
41
62
  });
@@ -6,6 +6,10 @@ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
6
6
  import CardsRender from '../../../../../../../src/components/List/components/Cards';
7
7
  import { MOCKED_LIST_OPTIONS } from '../mocks';
8
8
 
9
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
10
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ }));
12
+
9
13
  jest.mock('../../../../../../../src/hooks', () => ({
10
14
  useGetImages: jest.fn(() => ({ data: {}, loading: false }))
11
15
  }));
@@ -7,6 +7,10 @@ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
7
7
  import CardsRenderWrapper from '../../../../../../../src/components/List/components/Cards/CardsRenderWrapper';
8
8
  import { MOCKED_LIST_OPTIONS } from '../mocks';
9
9
 
10
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
11
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
12
+ }));
13
+
10
14
  jest.mock('../../../../../../../src/components/List/components/Cards/CardsRenderItem', () =>
11
15
  jest.fn().mockImplementation(({ id }) => <div>{id}</div>)
12
16
  );
@@ -0,0 +1,72 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Placeholder component should render PlaceholderIcon 1`] = `
4
+ <DocumentFragment>
5
+ <div
6
+ class="editor-view__placeholder"
7
+ data-testid="placeholder-icon"
8
+ >
9
+ <svg
10
+ height="25px"
11
+ version="1.1"
12
+ viewBox="0 0 16 16"
13
+ width="25px"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ >
16
+ <title>
17
+ card
18
+ </title>
19
+ <g
20
+ fill="none"
21
+ fill-rule="evenodd"
22
+ id="Icons"
23
+ stroke="none"
24
+ stroke-width="1"
25
+ >
26
+ <g
27
+ id="card"
28
+ transform="translate(-261.000000, -216.000000)"
29
+ >
30
+ <g
31
+ transform="translate(261.000000, 216.000000)"
32
+ >
33
+ <path
34
+ d="M15,1 L15,9.53124644 L14.998,9.531 L14.9986024,7.67959976 L11.4210663,4.62547112 L7.4590683,8.08893259 C7.08560181,8.77082265 6.07591438,8.77082265 5.51715851,8.27688661 L3.50145721,6.5 L1,8.77 L1,7.323 L2.58011188,5.9054667 C3.10161735,5.44445974 3.91799869,5.41372594 4.47882094,5.81326531 L4.59488493,5.9054667 L6.4402744,7.56106172 L10.4252459,3.98593625 C10.9840017,3.49200022 11.8812631,3.49200022 12.4400189,3.98593625 L14.9986024,6.28137475 L14.998,1 Z M6.14778213,2.60821539 C6.69719001,2.60821539 7.14257312,3.0379169 7.14257312,3.56798059 C7.14257312,4.09804429 6.69719002,4.52774581 6.14778213,4.52774581 C5.88422964,4.52580316 5.6316942,4.42547921 5.44313851,4.24781429 C5.25594548,4.06784498 5.15142164,3.82293899 5.15297371,3.56798059 C5.15297371,3.0379169 5.59837425,2.60821539 6.14778213,2.60821539 Z"
35
+ fill="#63779C"
36
+ fill-rule="nonzero"
37
+ id="Combined-Shape"
38
+ />
39
+ <path
40
+ d="M3,13 C3,12.7238576 3.22385763,12.5 3.5,12.5 L12.5,12.5 C12.7761424,12.5 13,12.7238576 13,13 C13,13.2761424 12.7761424,13.5 12.5,13.5 L3.5,13.5 C3.22385763,13.5 3,13.2761424 3,13 Z"
41
+ fill="#899BBC"
42
+ fill-rule="nonzero"
43
+ id="Shape"
44
+ />
45
+ <rect
46
+ height="15"
47
+ id="Rectangle"
48
+ rx="2"
49
+ stroke="#899BBC"
50
+ width="15"
51
+ x="0.5"
52
+ y="0.5"
53
+ />
54
+ <line
55
+ id="Line-2"
56
+ stroke="#63779C"
57
+ stroke-linecap="square"
58
+ x1="0.5"
59
+ x2="15.5"
60
+ y1="10.5"
61
+ y2="10.5"
62
+ />
63
+ </g>
64
+ </g>
65
+ </g>
66
+ </svg>
67
+ <span>
68
+ card
69
+ </span>
70
+ </div>
71
+ </DocumentFragment>
72
+ `;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
+
6
+ import PlaceholderIcon from '../../../../../../blaze-plugin-page-builder-ui/src/components/EditorView/PlaceholderIcon';
7
+ import { CardIcon } from '../../../../../../blaze-plugin-page-builder-ui/src/components/EditorView/Icons';
8
+
9
+ const mockedProps = {
10
+ type: 'card',
11
+ icon: CardIcon
12
+ };
13
+
14
+ describe('Placeholder component', () => {
15
+ it('should render PlaceholderIcon', () => {
16
+ const { asFragment, getByTestId } = render(PlaceholderIcon, mockedProps);
17
+ expect(getByTestId('placeholder-icon')).toBeDefined();
18
+ expect(asFragment()).toMatchSnapshot();
19
+ });
20
+ });
@@ -5,6 +5,10 @@ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
6
  import { Checkbox } from '../../../../../../src/components/SearchFilter/components';
7
7
 
8
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
9
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
10
+ }));
11
+
8
12
  jest.mock('next/router', () => ({
9
13
  useRouter: jest.fn(() => ({ asPath: 'test-url' }))
10
14
  }));
@@ -7,6 +7,10 @@ import '@testing-library/jest-dom/extend-expect';
7
7
  import { SelectFilter } from '../../../../../../src/components/SearchFilter/components';
8
8
  import { DEFAULT_OPTION } from '../../../../../../src/components/SearchFilter/constants';
9
9
 
10
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
11
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
12
+ }));
13
+
10
14
  jest.mock('next/router', () => ({
11
15
  useRouter: jest.fn(() => ({ asPath: 'test-url' }))
12
16
  }));
@@ -6,6 +6,10 @@ import { screen } from '@testing-library/react';
6
6
  import '@testing-library/jest-dom/extend-expect';
7
7
  import { TextSearch } from '../../../../../../src/components/SearchFilter/components';
8
8
 
9
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
10
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
11
+ }));
12
+
9
13
  jest.mock('next/router', () => ({
10
14
  useRouter: jest.fn(() => ({ asPath: 'test-url' }))
11
15
  }));
@@ -5,6 +5,10 @@ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
6
  import SearchFilterSort from '../../../../../src/components/SearchFilterSort/SearchFilterSort';
7
7
 
8
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
9
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
10
+ }));
11
+
8
12
  jest.mock('next/router', () => ({
9
13
  useRouter: jest.fn(() => ({ asPath: 'test-url' }))
10
14
  }));
@@ -5,6 +5,10 @@ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
5
5
  import '@testing-library/jest-dom/extend-expect';
6
6
  import SocialFollow from '../../../../../src/components/SocialFollow';
7
7
 
8
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
9
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
10
+ }));
11
+
8
12
  const MOCKED_SOCIAL_NETWORKS = {
9
13
  facebook: 'facebook value',
10
14
  twitter: 'twitter value'
@@ -5,6 +5,10 @@ import '@testing-library/jest-dom/extend-expect';
5
5
  import { render } from '@blaze-cms/tools/test-helpers/test-functions';
6
6
  import TextBlock from '../../../../../src/components/TextBlock';
7
7
 
8
+ jest.mock('@blaze-cms/utils-handlebars', () => ({
9
+ useStringTemplate: jest.fn((parent, [title]) => ({ loadig: false, data: [title] }))
10
+ }));
11
+
8
12
  const { setEnvs, deleteEnvs } = require('@blaze-cms/tools/test-helpers/test-files/test-env');
9
13
 
10
14
  const getMockedProps = overrides => ({