@blaze-cms/react-page-builder 0.114.0 → 0.115.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 (40) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/lib/components/List/ListRender.js +3 -3
  3. package/lib/components/List/ListRender.js.map +1 -1
  4. package/lib/components/List/components/Header/ListHeader.js +4 -4
  5. package/lib/components/List/components/Header/ListHeader.js.map +1 -1
  6. package/lib/components/TextBlock/index.js +8 -8
  7. package/lib/components/TextBlock/index.js.map +1 -1
  8. package/lib/constants/index.js +6 -2
  9. package/lib/constants/index.js.map +1 -1
  10. package/lib/helpers/index.js +8 -0
  11. package/lib/helpers/index.js.map +1 -1
  12. package/lib/helpers/parse-TextBlock.js +65 -0
  13. package/lib/helpers/parse-TextBlock.js.map +1 -0
  14. package/lib-es/components/List/ListRender.js +3 -3
  15. package/lib-es/components/List/ListRender.js.map +1 -1
  16. package/lib-es/components/List/components/Header/ListHeader.js +4 -4
  17. package/lib-es/components/List/components/Header/ListHeader.js.map +1 -1
  18. package/lib-es/components/TextBlock/index.js +7 -7
  19. package/lib-es/components/TextBlock/index.js.map +1 -1
  20. package/lib-es/constants/index.js +3 -1
  21. package/lib-es/constants/index.js.map +1 -1
  22. package/lib-es/helpers/index.js +1 -0
  23. package/lib-es/helpers/index.js.map +1 -1
  24. package/lib-es/helpers/parse-TextBlock.js +34 -0
  25. package/lib-es/helpers/parse-TextBlock.js.map +1 -0
  26. package/package.json +3 -4
  27. package/src/components/List/ListRender.js +3 -5
  28. package/src/components/List/components/Header/ListHeader.js +4 -4
  29. package/src/components/TextBlock/index.js +6 -6
  30. package/src/constants/index.js +6 -1
  31. package/src/helpers/index.js +1 -0
  32. package/src/helpers/parse-TextBlock.js +29 -0
  33. package/tests/unit/src/components/List/ListRender.test.js +1 -1
  34. package/tests/unit/src/components/List/components/Header/ListHeader.test.js +1 -1
  35. package/tests/unit/src/components/SearchFilter/components/Range.test.js +18 -0
  36. package/tests/unit/src/components/SearchFilter/components/__snapshots__/Range.test.js.snap +52 -2
  37. package/tests/unit/src/components/TextBlock/TextBlock.test.js +3 -4
  38. package/tests/unit/src/components/TextBlock/__snapshots__/TextBlock.test.js.snap +44 -12
  39. package/tests/unit/src/helpers/__snapshots__/parse-textBlock.test.js.snap +14 -0
  40. package/tests/unit/src/helpers/parse-textBlock.test.js +26 -0
@@ -6,9 +6,17 @@ exports[`TextBlock component With wrapper flag should render with wrapper and le
6
6
  class="page-content mocked-modifier"
7
7
  >
8
8
 
9
- <h1>
10
- Lorem
11
- </h1>
9
+ <section>
10
+ <h1>
11
+ Lorem ipsum
12
+ </h1>
13
+
14
+ <a
15
+ href="/"
16
+ >
17
+ link
18
+ </a>
19
+ </section>
12
20
 
13
21
  </div>
14
22
  </DocumentFragment>
@@ -20,9 +28,17 @@ exports[`TextBlock component With wrapper flag should render with wrapper and le
20
28
  class="page-content "
21
29
  >
22
30
 
23
- <h1>
24
- Lorem
25
- </h1>
31
+ <section>
32
+ <h1>
33
+ Lorem ipsum
34
+ </h1>
35
+
36
+ <a
37
+ href="/"
38
+ >
39
+ link
40
+ </a>
41
+ </section>
26
42
 
27
43
  </div>
28
44
  </DocumentFragment>
@@ -34,9 +50,17 @@ exports[`TextBlock component should match snapshot 1`] = `
34
50
  class=" mocked-modifier"
35
51
  >
36
52
 
37
- <h1>
38
- Lorem
39
- </h1>
53
+ <section>
54
+ <h1>
55
+ Lorem ipsum
56
+ </h1>
57
+
58
+ <a
59
+ href="/"
60
+ >
61
+ link
62
+ </a>
63
+ </section>
40
64
 
41
65
  </div>
42
66
  </DocumentFragment>
@@ -45,9 +69,17 @@ exports[`TextBlock component should match snapshot 1`] = `
45
69
  exports[`TextBlock component should not render wrapper if no modifier 1`] = `
46
70
  <DocumentFragment>
47
71
 
48
- <h1>
49
- Lorem
50
- </h1>
72
+ <section>
73
+ <h1>
74
+ Lorem ipsum
75
+ </h1>
76
+
77
+ <a
78
+ href="/"
79
+ >
80
+ link
81
+ </a>
82
+ </section>
51
83
 
52
84
  </DocumentFragment>
53
85
  `;
@@ -0,0 +1,14 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Parse textBlock it should match snapshot 1`] = `
4
+ <DocumentFragment>
5
+ <p>
6
+ lorem ipsum
7
+ <a
8
+ href="/"
9
+ >
10
+ link
11
+ </a>
12
+ </p>
13
+ </DocumentFragment>
14
+ `;
@@ -0,0 +1,26 @@
1
+ import '@testing-library/jest-dom/extend-expect';
2
+ import React from 'react';
3
+ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
4
+ import parseTextBlock from '../../../../src/helpers/parse-TextBlock';
5
+ import BlazeLink from '../../../../src/components/BlazeLink';
6
+
7
+ describe('Parse textBlock', () => {
8
+ const html = "<p>lorem ipsum <a href='/'>link</a></p>";
9
+
10
+ let expectedMarkup;
11
+
12
+ beforeAll(() => {
13
+ const parsedTextBlock = parseTextBlock({ html, LinkWrapper: BlazeLink });
14
+ expectedMarkup = () => <>{parsedTextBlock}</>;
15
+ });
16
+
17
+ test('it should match snapshot', () => {
18
+ const { asFragment } = render(expectedMarkup);
19
+ expect(asFragment()).toMatchSnapshot();
20
+ });
21
+
22
+ test('it should include a link tag', () => {
23
+ const { container } = render(expectedMarkup);
24
+ expect(container).toContainHTML("<a href='/'>link</a>");
25
+ });
26
+ });