@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.
- package/CHANGELOG.md +39 -0
- package/lib/components/List/ListRender.js +3 -3
- package/lib/components/List/ListRender.js.map +1 -1
- package/lib/components/List/components/Header/ListHeader.js +4 -4
- package/lib/components/List/components/Header/ListHeader.js.map +1 -1
- package/lib/components/TextBlock/index.js +8 -8
- package/lib/components/TextBlock/index.js.map +1 -1
- package/lib/constants/index.js +6 -2
- package/lib/constants/index.js.map +1 -1
- package/lib/helpers/index.js +8 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/parse-TextBlock.js +65 -0
- package/lib/helpers/parse-TextBlock.js.map +1 -0
- package/lib-es/components/List/ListRender.js +3 -3
- package/lib-es/components/List/ListRender.js.map +1 -1
- package/lib-es/components/List/components/Header/ListHeader.js +4 -4
- package/lib-es/components/List/components/Header/ListHeader.js.map +1 -1
- package/lib-es/components/TextBlock/index.js +7 -7
- package/lib-es/components/TextBlock/index.js.map +1 -1
- package/lib-es/constants/index.js +3 -1
- package/lib-es/constants/index.js.map +1 -1
- package/lib-es/helpers/index.js +1 -0
- package/lib-es/helpers/index.js.map +1 -1
- package/lib-es/helpers/parse-TextBlock.js +34 -0
- package/lib-es/helpers/parse-TextBlock.js.map +1 -0
- package/package.json +3 -4
- package/src/components/List/ListRender.js +3 -5
- package/src/components/List/components/Header/ListHeader.js +4 -4
- package/src/components/TextBlock/index.js +6 -6
- package/src/constants/index.js +6 -1
- package/src/helpers/index.js +1 -0
- package/src/helpers/parse-TextBlock.js +29 -0
- package/tests/unit/src/components/List/ListRender.test.js +1 -1
- package/tests/unit/src/components/List/components/Header/ListHeader.test.js +1 -1
- package/tests/unit/src/components/SearchFilter/components/Range.test.js +18 -0
- package/tests/unit/src/components/SearchFilter/components/__snapshots__/Range.test.js.snap +52 -2
- package/tests/unit/src/components/TextBlock/TextBlock.test.js +3 -4
- package/tests/unit/src/components/TextBlock/__snapshots__/TextBlock.test.js.snap +44 -12
- package/tests/unit/src/helpers/__snapshots__/parse-textBlock.test.js.snap +14 -0
- 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
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
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,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
|
+
});
|