@capillarytech/creatives-library 7.12.27 → 7.12.28
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/v2Containers/SmsTrai/Create/actions.js +9 -1
- package/v2Containers/SmsTrai/Create/index.js +9 -1
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +2739 -0
- package/v2Containers/SmsTrai/Create/tests/index.test.js +13 -1
- package/v2Containers/SmsTrai/Create/tests/mockData.js +32 -0
|
@@ -22,6 +22,7 @@ describe('Creatives SmsTraiCreate test/>', () => {
|
|
|
22
22
|
const clearCreateResponse = jest.fn();
|
|
23
23
|
const createSMSTRAITemplates = jest.fn();
|
|
24
24
|
const checkDuplicatesInDb = jest.fn();
|
|
25
|
+
const doneCheckingDuplicates = jest.fn();
|
|
25
26
|
const onCreateComplete = jest.fn();
|
|
26
27
|
const onShowTemplates = jest.fn();
|
|
27
28
|
const setAttribute = jest.fn();
|
|
@@ -29,7 +30,7 @@ describe('Creatives SmsTraiCreate test/>', () => {
|
|
|
29
30
|
beforeEach(() => {
|
|
30
31
|
renderedComponent = mountWithIntl(
|
|
31
32
|
<SmsTraiCreate
|
|
32
|
-
actions={{ clearCreateResponse, createSMSTRAITemplates, checkDuplicatesInDb }}
|
|
33
|
+
actions={{ clearCreateResponse, createSMSTRAITemplates, checkDuplicatesInDb, doneCheckingDuplicates }}
|
|
33
34
|
onCreateComplete={onCreateComplete}
|
|
34
35
|
onShowTemplates={onShowTemplates}
|
|
35
36
|
traiSms={traiSms}
|
|
@@ -74,4 +75,15 @@ describe('Creatives SmsTraiCreate test/>', () => {
|
|
|
74
75
|
renderedComponent.update();
|
|
75
76
|
expect(renderedComponent).toMatchSnapshot();
|
|
76
77
|
});
|
|
78
|
+
|
|
79
|
+
it('done button should be disabled if blank data is passed and orginal state should be maintained', async () => {
|
|
80
|
+
renderHelper(mockData.checkDuplicateDoneData);
|
|
81
|
+
const dropZone = renderedComponent.find('Dropzone').props();
|
|
82
|
+
await dropZone.onDrop([file]);
|
|
83
|
+
renderedComponent.update();
|
|
84
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
85
|
+
expect(renderedComponent.find('button.done-button').props().disabled).toBe(
|
|
86
|
+
true,
|
|
87
|
+
);
|
|
88
|
+
});
|
|
77
89
|
});
|
|
@@ -7,6 +7,38 @@ export const mockData = {
|
|
|
7
7
|
type: 'text/csv',
|
|
8
8
|
name: 'test.csv',
|
|
9
9
|
},
|
|
10
|
+
checkDuplicateDoneData: [
|
|
11
|
+
[
|
|
12
|
+
'TEMPLATE ID',
|
|
13
|
+
'TELEMARKETER',
|
|
14
|
+
'TEMPLATE NAME',
|
|
15
|
+
'TYPE',
|
|
16
|
+
'SENDER ID',
|
|
17
|
+
'CATEGORY',
|
|
18
|
+
'REGISTERED DLT',
|
|
19
|
+
'REQUESTED ON',
|
|
20
|
+
'STATUS DATE',
|
|
21
|
+
'APPROVAL STATUS',
|
|
22
|
+
'STATUS',
|
|
23
|
+
'TEMPLATE MESSAGE',
|
|
24
|
+
'CONSENT TYPE',
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"",
|
|
28
|
+
'--',
|
|
29
|
+
'CAP71871_12',
|
|
30
|
+
'Service-Explicit',
|
|
31
|
+
'VISHMM',
|
|
32
|
+
'--',
|
|
33
|
+
'Vodafone Idea',
|
|
34
|
+
'07/10/20 17:52',
|
|
35
|
+
'13/10/20 21:55',
|
|
36
|
+
'Approved',
|
|
37
|
+
'Active',
|
|
38
|
+
'DUSSEHRA DEALS@VISHAL\n\nBUY1GET1 FREE\n{#var#}\n{#var#}\n{#var#}\n{#var#}\n+\n{#var#}\n{#var#}\n{#var#}\nTC',
|
|
39
|
+
'Explicit',
|
|
40
|
+
],
|
|
41
|
+
],
|
|
10
42
|
contents: [
|
|
11
43
|
[
|
|
12
44
|
'TEMPLATE ID',
|