@capillarytech/creatives-library 7.14.29 → 7.14.30
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/services/tests/api.test.js +70 -13
- package/v2Components/CapWhatsappCTA/tests/index.test.js +16 -0
- package/v2Containers/Whatsapp/index.js +1 -1
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +15441 -3048
- package/v2Containers/Whatsapp/tests/actions.test.js +41 -0
- package/v2Containers/Whatsapp/tests/index.test.js +3 -0
- package/v2Containers/Whatsapp/tests/mockData.js +8 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as types from '../constants';
|
|
2
|
+
import * as actions from '../actions';
|
|
3
|
+
|
|
4
|
+
describe('Test whatsapp actions', () => {
|
|
5
|
+
it('has a type of TEMPLATE_CREATE_REQUEST action', () => {
|
|
6
|
+
const payload = {
|
|
7
|
+
name: 'template_name',
|
|
8
|
+
versions: {
|
|
9
|
+
base: {
|
|
10
|
+
content: {
|
|
11
|
+
whatsapp: {
|
|
12
|
+
category: 'TRANSACTIONAL',
|
|
13
|
+
languages: [
|
|
14
|
+
{
|
|
15
|
+
language: 'en',
|
|
16
|
+
content: 'gupshup template message',
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
mediaType: 'TEXT',
|
|
20
|
+
varMapped: {},
|
|
21
|
+
templateEditor: false,
|
|
22
|
+
accountId: '2000222347',
|
|
23
|
+
accessToken: 'DTpZEh4VK',
|
|
24
|
+
hostName: 'gupshupwhatsappbulk',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
type: 'WHATSAPP',
|
|
30
|
+
};
|
|
31
|
+
const expected = {
|
|
32
|
+
type: types.TEMPLATE_CREATE_REQUEST,
|
|
33
|
+
gupshupMediaFile: undefined,
|
|
34
|
+
payload,
|
|
35
|
+
callback: undefined,
|
|
36
|
+
};
|
|
37
|
+
expect(
|
|
38
|
+
actions.createWhatsappTemplate(undefined, payload, undefined),
|
|
39
|
+
).toStrictEqual(expected);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -31,6 +31,7 @@ describe('Creatives Whatsapp test1/>', () => {
|
|
|
31
31
|
const accountData1 = mockData.accountData1;
|
|
32
32
|
const accountData2 = mockData.accountData2;
|
|
33
33
|
const accountData3 = mockData.accountData3;
|
|
34
|
+
const accountData4 = mockData.accountData4;
|
|
34
35
|
|
|
35
36
|
const renderHelper = (args, isFullMode = true, accData = accountData1) => {
|
|
36
37
|
renderedComponent = mountWithIntl(
|
|
@@ -69,6 +70,8 @@ describe('Creatives Whatsapp test1/>', () => {
|
|
|
69
70
|
expect(renderedComponent).toMatchSnapshot();
|
|
70
71
|
renderHelper({}, true, accountData3);
|
|
71
72
|
expect(renderedComponent).toMatchSnapshot();
|
|
73
|
+
renderHelper({}, true, accountData4);
|
|
74
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
72
75
|
renderHelper({}, true, {});
|
|
73
76
|
expect(renderedComponent).toMatchSnapshot();
|
|
74
77
|
});
|
|
@@ -20,6 +20,14 @@ export const mockData = {
|
|
|
20
20
|
test: 'test',
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
|
+
accountData4: {
|
|
24
|
+
selectedWhatsappAccount: {
|
|
25
|
+
name: 'gupshup_test',
|
|
26
|
+
sourceAccountIdentifier: '2000222347',
|
|
27
|
+
configs: { accessToken: 'DTpZEh4VK' },
|
|
28
|
+
hostName: 'gupshupwhatsappbulk',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
23
31
|
editData1: {
|
|
24
32
|
templateDetails: {
|
|
25
33
|
_id: '62034b4683c75608cf2404ec',
|