@capillarytech/creatives-library 7.12.3 → 7.12.5
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/package.json +1 -1
- package/v2Components/TemplatePreview/index.js +30 -32
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -2
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +1 -1
- package/v2Containers/Rcs/constants.js +2 -1
- package/v2Containers/Rcs/index.js +39 -39
- package/v2Containers/Rcs/sagas.js +3 -3
- package/v2Containers/Templates/index.js +1 -0
- package/v2Containers/Whatsapp/constants.js +287 -0
- package/v2Containers/Whatsapp/index.js +35 -23
- package/v2Containers/Whatsapp/index.scss +3 -2
- package/v2Containers/Whatsapp/messages.js +284 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35570 -1687
- package/v2Containers/Whatsapp/tests/index.test.js +13 -0
- package/v2Containers/Whatsapp/tests/utils.test.js +15 -8
- package/v2Containers/mockdata.js +1173 -1143
- package/v2Components/CallTaskPreview/tests/__snapshots__/index.test.js.snap +0 -30
|
@@ -98,6 +98,15 @@ describe('Creatives Whatsapp test/>', () => {
|
|
|
98
98
|
expect(renderedComponent).toMatchSnapshot();
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
+
it('template language change', () => {
|
|
102
|
+
renderHelper({});
|
|
103
|
+
renderedComponent
|
|
104
|
+
.find('CapSelect#select-whatsapp-language')
|
|
105
|
+
.props()
|
|
106
|
+
.onChange('en');
|
|
107
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
108
|
+
});
|
|
109
|
+
|
|
101
110
|
it('template message', () => {
|
|
102
111
|
renderHelper({});
|
|
103
112
|
const templateMessageRenderHelper = (val) => {
|
|
@@ -160,6 +169,10 @@ describe('Creatives Whatsapp test/>', () => {
|
|
|
160
169
|
.find('CapSelect#select-whatsapp-category')
|
|
161
170
|
.props()
|
|
162
171
|
.onChange('APPOINTMENT_UPDATE');
|
|
172
|
+
renderedComponent
|
|
173
|
+
.find('CapSelect#select-whatsapp-language')
|
|
174
|
+
.props()
|
|
175
|
+
.onChange('en');
|
|
163
176
|
event = { target: { value: 'Hi {{1}}' } };
|
|
164
177
|
renderedComponent
|
|
165
178
|
.find('TextArea#whatsapp-create-template-message-input')
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getWhatsappContent,
|
|
3
|
+
getWhatsappStatus,
|
|
4
|
+
getWhatsappCategory,
|
|
5
|
+
} from '../utils';
|
|
2
6
|
import mockdata from '../../mockdata';
|
|
3
7
|
|
|
4
8
|
const {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
getWhatsappCategoryOutput,
|
|
9
|
+
whatsappPreviewTemplateData,
|
|
10
|
+
getWhatsappStatusOutput,
|
|
11
|
+
getWhatsappCategoryOutput,
|
|
9
12
|
} = mockdata;
|
|
10
13
|
|
|
11
14
|
describe('Test utils', () => {
|
|
12
15
|
it('test getWhatsappContent', () => {
|
|
13
|
-
expect(getWhatsappContent(
|
|
16
|
+
expect(getWhatsappContent(whatsappPreviewTemplateData)).toMatchSnapshot();
|
|
14
17
|
});
|
|
15
18
|
|
|
16
19
|
it('test getWhatsappContent for preview', () => {
|
|
17
|
-
expect(
|
|
20
|
+
expect(
|
|
21
|
+
getWhatsappContent(whatsappPreviewTemplateData, true),
|
|
22
|
+
).toMatchSnapshot();
|
|
18
23
|
});
|
|
19
24
|
|
|
20
25
|
it('test getWhatsappStatus', () => {
|
|
@@ -22,6 +27,8 @@ describe('Test utils', () => {
|
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
it('test getWhatsappCategory', () => {
|
|
25
|
-
expect(getWhatsappCategory('ALERT_UPDATE')).toEqual(
|
|
30
|
+
expect(getWhatsappCategory('ALERT_UPDATE')).toEqual(
|
|
31
|
+
getWhatsappCategoryOutput,
|
|
32
|
+
);
|
|
26
33
|
});
|
|
27
34
|
});
|