@capillarytech/creatives-library 8.0.113 → 8.0.114-alpha.1
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/containers/App/test/saga.test.js +1 -1
- package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +1 -1
- package/containers/Assets/Gallery/tests/actions.test.js +2 -3
- package/containers/Assets/Gallery/tests/reducer.test.js +7 -7
- package/containers/Assets/Gallery/tests/saga.test.js +9 -9
- package/containers/Dashboard/test/saga.test.js +1 -1
- package/containers/Ebill/test/saga.test.js +1 -1
- package/containers/Email/test/saga.test.js +33 -33
- package/containers/LanguageProvider/tests/actions.test.js +1 -1
- package/containers/LanguageProvider/tests/reducer.test.js +2 -2
- package/containers/LanguageProvider/tests/selectors.test.js +1 -1
- package/containers/Line/Create/tests/saga.test.js +2 -9
- package/containers/Line/Edit/test/saga.test.js +10 -14
- package/containers/MobilePush/Create/test/saga.test.js +2 -2
- package/containers/MobilePush/Edit/tests/saga.test.js +14 -14
- package/containers/Sms/Create/test/saga.test.js +4 -5
- package/containers/Sms/Edit/test/saga.test.js +1 -1
- package/containers/Templates/test/saga.test.js +14 -17
- package/containers/WeChat/MapTemplates/test/saga.test.js +9 -13
- package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +1 -1
- package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +1 -1
- package/package.json +1 -1
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +8 -9
- package/utils/commonUtils.js +359 -3
- package/utils/tagValidations.js +20 -5
- package/utils/tests/authWrapper.test.js +2 -2
- package/utils/tests/cdnTransformation.test.js +16 -15
- package/utils/tests/commonUtil.test.js +474 -171
- package/utils/tests/tagValidations.test.js +89 -2
- package/v2Components/CapVideoUpload/tests/index.test.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +1 -2
- package/v2Components/ErrorInfoNote/ErrorTypeRenderer.js +127 -0
- package/v2Components/ErrorInfoNote/ErrorTypeRenderer.test.js +147 -0
- package/v2Components/ErrorInfoNote/index.js +114 -46
- package/v2Components/ErrorInfoNote/messages.js +25 -0
- package/v2Components/ErrorInfoNote/style.scss +14 -1
- package/v2Components/ErrorInfoNote/utils.js +38 -0
- package/v2Components/ErrorInfoNote/utils.test.js +156 -0
- package/v2Components/FormBuilder/index.js +204 -127
- package/v2Components/FormBuilder/messages.js +1 -1
- package/v2Components/MarketingObjective/test/index.test.js +1 -1
- package/v2Components/NavigationBar/tests/saga.test.js +2 -3
- package/v2Containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +1 -1
- package/v2Containers/Assets/Gallery/tests/actions.test.js +2 -3
- package/v2Containers/Assets/Gallery/tests/reducer.test.js +7 -7
- package/v2Containers/Assets/Gallery/tests/saga.test.js +2 -2
- package/v2Containers/BeeEditor/test/saga.test.js +1 -1
- package/v2Containers/CallTask/test/saga.test.js +1 -1
- package/v2Containers/Cap/reducer.js +4 -4
- package/v2Containers/Cap/tests/actions.test.js +1 -1
- package/v2Containers/Cap/tests/reducer.test.js +11 -11
- package/v2Containers/Cap/tests/saga.test.js +1 -1
- package/v2Containers/Cap/tests/selectors.test.js +3 -3
- package/v2Containers/CapFacebookPreview/tests/saga.test.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +23 -3
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +3 -1
- package/v2Containers/CreativesContainer/constants.js +4 -1
- package/v2Containers/CreativesContainer/index.js +44 -19
- package/v2Containers/CreativesContainer/messages.js +4 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +21 -3
- package/v2Containers/Ebill/index.js +3 -3
- package/v2Containers/Ebill/test/saga.test.js +1 -1
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +4 -4
- package/v2Containers/Email/tests/actions.test.js +1 -1
- package/v2Containers/Email/tests/reducer.test.js +2 -2
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +1 -1
- package/v2Containers/FTP/test/saga.test.js +1 -1
- package/v2Containers/Facebook/test/saga.test.js +7 -7
- package/v2Containers/InApp/index.js +123 -50
- package/v2Containers/InApp/tests/action.test.js +7 -7
- package/v2Containers/InApp/tests/index.test.js +2 -4
- package/v2Containers/InApp/tests/reducer.test.js +175 -89
- package/v2Containers/InApp/tests/sagas.test.js +1 -1
- package/v2Containers/InApp/tests/utils.test.js +41 -0
- package/v2Containers/InApp/utils.js +37 -0
- package/v2Containers/LanguageProvider/tests/actions.test.js +1 -1
- package/v2Containers/LanguageProvider/tests/reducer.test.js +3 -3
- package/v2Containers/LanguageProvider/tests/saga.test.js +2 -2
- package/v2Containers/LanguageProvider/tests/selectors.test.js +1 -1
- package/v2Containers/Line/Container/ImageCarousel/tests/utils.test.js +3 -3
- package/v2Containers/Line/Container/Sticker/tests/utils.test.js +6 -6
- package/v2Containers/MobilePush/Create/index.js +24 -20
- package/v2Containers/MobilePush/Create/test/saga.test.js +2 -2
- package/v2Containers/MobilePush/Edit/index.js +6 -2
- package/v2Containers/MobilePush/Edit/test/saga.test.js +14 -14
- package/v2Containers/MobilepushWrapper/index.js +2 -0
- package/v2Containers/Rcs/tests/saga.test.js +1 -1
- package/v2Containers/Sms/Create/index.js +1 -0
- package/v2Containers/Sms/Create/test/saga.test.js +1 -1
- package/v2Containers/Sms/Edit/index.js +2 -0
- package/v2Containers/Sms/Edit/test/saga.test.js +5 -5
- package/v2Containers/SmsTrai/Create/tests/saga.test.js +1 -1
- package/v2Containers/SmsTrai/Create/tests/selectors.test.js +1 -1
- package/v2Containers/SmsWrapper/index.js +2 -0
- package/v2Containers/TagList/tests/TagList.test.js +1 -3
- package/v2Containers/TagList/tests/utils.test.js +3 -3
- package/v2Containers/Templates/tests/actions.test.js +1 -1
- package/v2Containers/Templates/tests/reducer.test.js +8 -8
- package/v2Containers/Templates/tests/sagas.test.js +2 -4
- package/v2Containers/WeChat/MapTemplates/test/saga.test.js +9 -13
- package/v2Containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +1 -1
- package/v2Containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +1 -1
- package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +9 -9
- package/v2Containers/Whatsapp/tests/actions.test.js +3 -3
- package/v2Containers/Whatsapp/tests/reducer.test.js +32 -36
- package/v2Containers/Whatsapp/tests/utils.test.js +19 -19
- package/v2Containers/Zalo/tests/actions.test.js +3 -3
- package/v2Containers/Zalo/tests/reducer.test.js +72 -42
|
@@ -10,7 +10,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
10
10
|
describe('editTemplate Saga', () => {
|
|
11
11
|
const template = { message: "Retuen",id: 1, name: 'Updated Template' };
|
|
12
12
|
|
|
13
|
-
it('handles successful template edit', () => {
|
|
13
|
+
it.concurrent('handles successful template edit', () => {
|
|
14
14
|
const fakeResponse = {
|
|
15
15
|
response: template,
|
|
16
16
|
status: { code: 200 }
|
|
@@ -28,7 +28,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
28
28
|
})
|
|
29
29
|
.run();
|
|
30
30
|
});
|
|
31
|
-
it('handles successful template edit', () => {
|
|
31
|
+
it.concurrent('handles successful template edit', () => {
|
|
32
32
|
const fakeResponse = {
|
|
33
33
|
response: template,
|
|
34
34
|
status: { code: 500 }
|
|
@@ -46,7 +46,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
46
46
|
})
|
|
47
47
|
.run();
|
|
48
48
|
});
|
|
49
|
-
it('handles failure in editing a template', () => {
|
|
49
|
+
it.concurrent('handles failure in editing a template', () => {
|
|
50
50
|
const error = new Error('Edit failed');
|
|
51
51
|
|
|
52
52
|
return expectSaga(sagas.editTemplate, template)
|
|
@@ -65,7 +65,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
65
65
|
describe('getTemplateDetails Saga', () => {
|
|
66
66
|
const id = '123';
|
|
67
67
|
|
|
68
|
-
it('handles fetching template details successfully', () => {
|
|
68
|
+
it.concurrent('handles fetching template details successfully', () => {
|
|
69
69
|
const fakeResponse = {
|
|
70
70
|
response: { id: 123, name: 'Detailed Template' }
|
|
71
71
|
};
|
|
@@ -81,7 +81,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
81
81
|
.run();
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
it('handles failure in fetching template details', () => {
|
|
84
|
+
it.concurrent('handles failure in fetching template details', () => {
|
|
85
85
|
const error = new Error('Fetch failed');
|
|
86
86
|
|
|
87
87
|
return expectSaga(sagas.getTemplateDetails, id)
|
|
@@ -102,7 +102,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
102
102
|
const fileParams = { param1: 'value1' };
|
|
103
103
|
const mode = 'strict';
|
|
104
104
|
|
|
105
|
-
it('handles successful asset upload', () => {
|
|
105
|
+
it.concurrent('handles successful asset upload', () => {
|
|
106
106
|
const fakeResponse = {
|
|
107
107
|
response: { asset: { id: 1, url: 'http://example.com/asset.jpg' } },
|
|
108
108
|
status: { code: 200 }
|
|
@@ -120,7 +120,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
120
120
|
.run();
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
it('handles failure in asset upload', () => {
|
|
123
|
+
it.concurrent('handles failure in asset upload', () => {
|
|
124
124
|
const error = new Error('Failed to upload asset');
|
|
125
125
|
|
|
126
126
|
return expectSaga(sagas.uploadAsset, file, assetType, fileParams, mode)
|
|
@@ -138,7 +138,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
138
138
|
describe('getIosCtas Saga', () => {
|
|
139
139
|
const licenseCode = 'ABC123';
|
|
140
140
|
|
|
141
|
-
it('handles fetching iOS CTAs successfully', () => {
|
|
141
|
+
it.concurrent('handles fetching iOS CTAs successfully', () => {
|
|
142
142
|
const fakeResponse = {
|
|
143
143
|
response: { metaEntities: { data: [{ id: 1, name: 'CTA One' }] } },
|
|
144
144
|
status: { code: 200 }
|
|
@@ -156,7 +156,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
156
156
|
.run();
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
it('handles failure in fetching iOS CTAs', () => {
|
|
159
|
+
it.concurrent('handles failure in fetching iOS CTAs', () => {
|
|
160
160
|
const error = new Error('Fetch failed');
|
|
161
161
|
|
|
162
162
|
return expectSaga(sagas.getIosCtas, licenseCode)
|
|
@@ -174,7 +174,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
174
174
|
describe('getMobilepushTemplatesList Saga', () => {
|
|
175
175
|
const params = { channel: 'mobilepush', queryParams: { sort: 'asc' } };
|
|
176
176
|
|
|
177
|
-
it('handles fetching mobile push templates list successfully', () => {
|
|
177
|
+
it.concurrent('handles fetching mobile push templates list successfully', () => {
|
|
178
178
|
const fakeResponse = {
|
|
179
179
|
response: {
|
|
180
180
|
templates: [{ id: 1, name: 'Template One' }],
|
|
@@ -194,7 +194,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
194
194
|
.run();
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
-
it('handles failure in fetching mobile push templates list', () => {
|
|
197
|
+
it.concurrent('handles failure in fetching mobile push templates list', () => {
|
|
198
198
|
const error = new Error('Fetch failed');
|
|
199
199
|
|
|
200
200
|
return expectSaga(sagas.getMobilepushTemplatesList, params)
|
|
@@ -212,7 +212,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
212
212
|
describe('fetchWeCrmAccounts Saga', () => {
|
|
213
213
|
const action = { source: 'CRM' };
|
|
214
214
|
|
|
215
|
-
it('handles successful fetching of WeCRM accounts', () => {
|
|
215
|
+
it.concurrent('handles successful fetching of WeCRM accounts', () => {
|
|
216
216
|
const fakeResponse = {
|
|
217
217
|
response: [{ id: 1, name: 'Account One' }]
|
|
218
218
|
};
|
|
@@ -228,7 +228,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
228
228
|
.run();
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
-
it('handles failure in fetching WeCRM accounts', () => {
|
|
231
|
+
it.concurrent('handles failure in fetching WeCRM accounts', () => {
|
|
232
232
|
const error = new Error('Fetch failed');
|
|
233
233
|
|
|
234
234
|
return expectSaga(sagas.fetchWeCrmAccounts, action)
|
|
@@ -247,7 +247,7 @@ describe('Mobile Push Template Sagas', () => {
|
|
|
247
247
|
|
|
248
248
|
// Test combined saga
|
|
249
249
|
describe('Combined editMPushSaga', () => {
|
|
250
|
-
it('should initialize all mobile push-related watcher sagas without error', () => {
|
|
250
|
+
it.concurrent('should initialize all mobile push-related watcher sagas without error', () => {
|
|
251
251
|
return expectSaga(editMPushSaga)
|
|
252
252
|
.run();
|
|
253
253
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { expectSaga } from "redux-saga-test-plan";
|
|
3
2
|
|
|
4
3
|
import {
|
|
@@ -6,7 +5,7 @@ import {
|
|
|
6
5
|
} from "../sagas";
|
|
7
6
|
|
|
8
7
|
describe("createSmsSaga Combined", () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
test.concurrent("should initialize all createSmsSaga-related watcher sagas without error", () => {
|
|
9
|
+
return expectSaga(createSmsSaga).run();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
|
|
7
7
|
describe("RichMedia Template Sagas", () => {
|
|
8
8
|
describe("editSmsSaga Combined", () => {
|
|
9
|
-
it("should initialize all SMS-related watcher sagas without error", () => {
|
|
9
|
+
it.concurrent("should initialize all SMS-related watcher sagas without error", () => {
|
|
10
10
|
return expectSaga(editSmsSaga).run();
|
|
11
11
|
});
|
|
12
12
|
});
|
|
@@ -11,7 +11,7 @@ describe('Template Management Sagas', () => {
|
|
|
11
11
|
const channel = { channel: 'email' };
|
|
12
12
|
const queryParams = { page: 1 };
|
|
13
13
|
|
|
14
|
-
it('handles failure in fetching all templates', () => {
|
|
14
|
+
it.concurrent('handles failure in fetching all templates', () => {
|
|
15
15
|
const error = new Error('API error');
|
|
16
16
|
|
|
17
17
|
return expectSaga(sagas.getAllTemplates, channel, queryParams)
|
|
@@ -30,7 +30,7 @@ describe('Template Management Sagas', () => {
|
|
|
30
30
|
const channel = 'email';
|
|
31
31
|
const id = '123';
|
|
32
32
|
|
|
33
|
-
it('handles successful deletion of a template', () => {
|
|
33
|
+
it.concurrent('handles successful deletion of a template', () => {
|
|
34
34
|
const fakeResponse = {
|
|
35
35
|
response: 'Template deleted successfully'
|
|
36
36
|
};
|
|
@@ -46,7 +46,7 @@ describe('Template Management Sagas', () => {
|
|
|
46
46
|
.run();
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
it('handles failure in deleting a template', () => {
|
|
49
|
+
it.concurrent('handles failure in deleting a template', () => {
|
|
50
50
|
const error = new Error('Deletion failed');
|
|
51
51
|
|
|
52
52
|
return expectSaga(sagas.deleteTemplate, channel, id)
|
|
@@ -62,13 +62,12 @@ describe('Template Management Sagas', () => {
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
describe('fetchUserList Saga', () => {
|
|
65
|
-
|
|
65
|
+
test.concurrent('handles successful fetching of user list', () => {
|
|
66
66
|
const fakeResponse = {
|
|
67
67
|
data: {
|
|
68
68
|
result: [{ id: 1, name: 'User One' }]
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
|
|
72
71
|
return expectSaga(sagas.fetchUserList)
|
|
73
72
|
.provide([
|
|
74
73
|
[matchers.call.fn(Api.getUserList), fakeResponse]
|
|
@@ -79,10 +78,8 @@ describe('Template Management Sagas', () => {
|
|
|
79
78
|
})
|
|
80
79
|
.run();
|
|
81
80
|
});
|
|
82
|
-
|
|
83
|
-
it('handles failure in fetching user list', () => {
|
|
81
|
+
test.concurrent('handles failure in fetching user list', () => {
|
|
84
82
|
const error = new Error('Fetch failed');
|
|
85
|
-
|
|
86
83
|
return expectSaga(sagas.fetchUserList)
|
|
87
84
|
.provide([
|
|
88
85
|
[matchers.call.fn(Api.getUserList), throwError(error)]
|
|
@@ -98,7 +95,7 @@ describe('Template Management Sagas', () => {
|
|
|
98
95
|
describe('fetchWeCrmAccounts Saga', () => {
|
|
99
96
|
const action = { source: 'CRM' };
|
|
100
97
|
|
|
101
|
-
it('handles successful fetching of WeCRM accounts', () => {
|
|
98
|
+
it.concurrent('handles successful fetching of WeCRM accounts', () => {
|
|
102
99
|
const fakeResponse = {
|
|
103
100
|
response: [{ id: 1, name: 'Account One' }]
|
|
104
101
|
};
|
|
@@ -114,7 +111,7 @@ describe('Template Management Sagas', () => {
|
|
|
114
111
|
.run();
|
|
115
112
|
});
|
|
116
113
|
|
|
117
|
-
it('handles failure in fetching WeCRM accounts', () => {
|
|
114
|
+
it.concurrent('handles failure in fetching WeCRM accounts', () => {
|
|
118
115
|
const error = new Error('Fetch failed');
|
|
119
116
|
|
|
120
117
|
return expectSaga(sagas.fetchWeCrmAccounts, action)
|
|
@@ -132,7 +129,7 @@ describe('Template Management Sagas', () => {
|
|
|
132
129
|
describe('sendZippedFile Saga', () => {
|
|
133
130
|
const selectedFile = new Blob();
|
|
134
131
|
|
|
135
|
-
it('handles successful file sending', () => {
|
|
132
|
+
it.concurrent('handles successful file sending', () => {
|
|
136
133
|
const fakeResponse = {
|
|
137
134
|
status: { isError: false },
|
|
138
135
|
response: { metaEntity: { htmlContent: encodeURIComponent('<html>Content</html>') } }
|
|
@@ -149,7 +146,7 @@ describe('Template Management Sagas', () => {
|
|
|
149
146
|
.run();
|
|
150
147
|
});
|
|
151
148
|
|
|
152
|
-
it('handles errors during file sending', () => {
|
|
149
|
+
it.concurrent('handles errors during file sending', () => {
|
|
153
150
|
const errorMessage = "Error sending file";
|
|
154
151
|
const fakeResponse = {
|
|
155
152
|
status: { isError: true },
|
|
@@ -169,7 +166,7 @@ describe('Template Management Sagas', () => {
|
|
|
169
166
|
});
|
|
170
167
|
|
|
171
168
|
describe('getEdmTemplates Saga', () => {
|
|
172
|
-
it('handles successful fetching of EDM templates', () => {
|
|
169
|
+
it.concurrent('handles successful fetching of EDM templates', () => {
|
|
173
170
|
const fakeResponse = {
|
|
174
171
|
response: [{ id: 1, name: 'EDM Template One' }]
|
|
175
172
|
};
|
|
@@ -185,7 +182,7 @@ describe('Template Management Sagas', () => {
|
|
|
185
182
|
.run();
|
|
186
183
|
});
|
|
187
184
|
|
|
188
|
-
it('handles failure in fetching EDM templates', () => {
|
|
185
|
+
it.concurrent('handles failure in fetching EDM templates', () => {
|
|
189
186
|
const error = new Error('Fetch failed');
|
|
190
187
|
|
|
191
188
|
return expectSaga(sagas.getEdmTemplates)
|
|
@@ -204,7 +201,7 @@ describe('Template Management Sagas', () => {
|
|
|
204
201
|
const id = '123';
|
|
205
202
|
const channel = 'email';
|
|
206
203
|
|
|
207
|
-
it('handles successful fetching of template details', () => {
|
|
204
|
+
it.concurrent('handles successful fetching of template details', () => {
|
|
208
205
|
const fakeResponse = {
|
|
209
206
|
response: { id: 123, name: 'Detailed Template' }
|
|
210
207
|
};
|
|
@@ -220,7 +217,7 @@ describe('Template Management Sagas', () => {
|
|
|
220
217
|
.run();
|
|
221
218
|
});
|
|
222
219
|
|
|
223
|
-
it('handles failure in fetching template details', () => {
|
|
220
|
+
it.concurrent('handles failure in fetching template details', () => {
|
|
224
221
|
const error = new Error('Fetch failed');
|
|
225
222
|
|
|
226
223
|
return expectSaga(sagas.getTemplateDetails, id, channel)
|
|
@@ -237,7 +234,7 @@ describe('Template Management Sagas', () => {
|
|
|
237
234
|
});
|
|
238
235
|
|
|
239
236
|
describe('Combined Watcher Sagas', () => {
|
|
240
|
-
it('templateSaga should initialize all watcher sagas without error', () => {
|
|
237
|
+
it.concurrent('templateSaga should initialize all watcher sagas without error', () => {
|
|
241
238
|
return expectSaga(templateSaga)
|
|
242
239
|
.run();
|
|
243
240
|
});
|
|
@@ -10,7 +10,7 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
10
10
|
describe('getDefaultWeChatTemplates Saga', () => {
|
|
11
11
|
const params = { channel: 'WeChat', queryParams: { type: 'default' } };
|
|
12
12
|
|
|
13
|
-
it('handles fetching default WeChat templates successfully', () => {
|
|
13
|
+
it.concurrent('handles fetching default WeChat templates successfully', () => {
|
|
14
14
|
const fakeResponse = {
|
|
15
15
|
response: {
|
|
16
16
|
unMapped: [{ id: 1, name: 'Template One' }],
|
|
@@ -30,7 +30,7 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
30
30
|
.run();
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
it('handles failure in fetching default WeChat templates', () => {
|
|
33
|
+
it.concurrent('handles failure in fetching default WeChat templates', () => {
|
|
34
34
|
const error = new Error('Fetch failed');
|
|
35
35
|
|
|
36
36
|
return expectSaga(sagas.getDefaultWeChatTemplates, params)
|
|
@@ -47,13 +47,11 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
47
47
|
|
|
48
48
|
describe('createTemplate Saga', () => {
|
|
49
49
|
const template = { name: 'New WeChat Template' };
|
|
50
|
-
|
|
51
|
-
it('handles creating a WeChat template successfully', () => {
|
|
50
|
+
test.concurrent('handles creating a WeChat template successfully', () => {
|
|
52
51
|
const fakeResponse = {
|
|
53
52
|
response: template,
|
|
54
53
|
status: { code: 200 }
|
|
55
54
|
};
|
|
56
|
-
|
|
57
55
|
return expectSaga(sagas.createTemplate, template)
|
|
58
56
|
.provide([
|
|
59
57
|
[call(Api.createWeChatTemplate, template), fakeResponse]
|
|
@@ -65,10 +63,8 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
65
63
|
})
|
|
66
64
|
.run();
|
|
67
65
|
});
|
|
68
|
-
|
|
69
|
-
it('handles failure when creating a WeChat template', () => {
|
|
66
|
+
test.concurrent('handles failure when creating a WeChat template', () => {
|
|
70
67
|
const error = new Error('Creation failed');
|
|
71
|
-
|
|
72
68
|
return expectSaga(sagas.createTemplate, template)
|
|
73
69
|
.provide([
|
|
74
70
|
[call(Api.createWeChatTemplate, template), throwError(error)]
|
|
@@ -82,7 +78,7 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
82
78
|
});
|
|
83
79
|
|
|
84
80
|
describe('fetchWeCrmAccounts Saga', () => {
|
|
85
|
-
it('handles fetching WeCrm accounts successfully', () => {
|
|
81
|
+
it.concurrent('handles fetching WeCrm accounts successfully', () => {
|
|
86
82
|
const fakeResponse = {
|
|
87
83
|
response: [{ id: 1, name: 'Account One' }]
|
|
88
84
|
};
|
|
@@ -98,7 +94,7 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
98
94
|
.run();
|
|
99
95
|
});
|
|
100
96
|
|
|
101
|
-
it('handles failure in fetching WeCrm accounts', () => {
|
|
97
|
+
it.concurrent('handles failure in fetching WeCrm accounts', () => {
|
|
102
98
|
const error = new Error('Fetch failed');
|
|
103
99
|
|
|
104
100
|
return expectSaga(sagas.fetchWeCrmAccounts)
|
|
@@ -116,7 +112,7 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
116
112
|
describe('getTemplateDetails Saga', () => {
|
|
117
113
|
const id = '123';
|
|
118
114
|
|
|
119
|
-
it('handles fetching template details successfully', () => {
|
|
115
|
+
it.concurrent('handles fetching template details successfully', () => {
|
|
120
116
|
const fakeResponse = {
|
|
121
117
|
response: { id: 123, name: 'Detailed Template' }
|
|
122
118
|
};
|
|
@@ -132,7 +128,7 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
132
128
|
.run();
|
|
133
129
|
});
|
|
134
130
|
|
|
135
|
-
it('handles failure in fetching template details', () => {
|
|
131
|
+
it.concurrent('handles failure in fetching template details', () => {
|
|
136
132
|
const error = new Error('Fetch failed');
|
|
137
133
|
|
|
138
134
|
return expectSaga(sagas.getTemplateDetails, id)
|
|
@@ -151,7 +147,7 @@ describe('WeChat Template Management Sagas', () => {
|
|
|
151
147
|
|
|
152
148
|
// Test combined saga
|
|
153
149
|
describe('Combined mapTemplatesSaga', () => {
|
|
154
|
-
it('should initialize all WeChat-related watcher sagas without error', () => {
|
|
150
|
+
it.concurrent('should initialize all WeChat-related watcher sagas without error', () => {
|
|
155
151
|
return expectSaga(mapTemplatesSaga)
|
|
156
152
|
.run();
|
|
157
153
|
});
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
|
|
7
7
|
describe("RichMedia Template Sagas", () => {
|
|
8
8
|
describe("richMediaTemplatesSaga Combined", () => {
|
|
9
|
-
it("should initialize all RichMedia-related watcher sagas without error", () => {
|
|
9
|
+
it.concurrent("should initialize all RichMedia-related watcher sagas without error", () => {
|
|
10
10
|
return expectSaga(richMediaTemplatesSaga).run();
|
|
11
11
|
});
|
|
12
12
|
});
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../sagas";
|
|
7
7
|
|
|
8
8
|
describe("richMediaTemplatesEditSaga Combined", () => {
|
|
9
|
-
it("should initialize all richMediaTemplatesEditSaga-related watcher sagas without error", () => {
|
|
9
|
+
it.concurrent("should initialize all richMediaTemplatesEditSaga-related watcher sagas without error", () => {
|
|
10
10
|
return expectSaga(richMediaTemplatesEditSaga).run();
|
|
11
11
|
});
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ jest.mock('@capillarytech/cap-ui-utils', () => ({
|
|
|
32
32
|
},
|
|
33
33
|
}));
|
|
34
34
|
|
|
35
|
-
jest.setTimeout(
|
|
35
|
+
jest.setTimeout(30000);
|
|
36
36
|
|
|
37
37
|
const initializeCreatives = () => {
|
|
38
38
|
const store = configureStore(mockInitialState, initialReducer, history);
|
|
@@ -61,9 +61,8 @@ afterAll(() => {
|
|
|
61
61
|
delete window?.capAuth;
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
|
|
65
|
-
|
|
66
64
|
describe("Creatives testing template creation", () => {
|
|
65
|
+
jest.useFakeTimers();
|
|
67
66
|
it("Should navigate from creatives home page and create template in RCS channel", async () => {
|
|
68
67
|
initializeCreatives();
|
|
69
68
|
const creativesScreen = await helper.getCreativesScreen();
|
|
@@ -100,7 +99,7 @@ describe("Creatives testing template creation", () => {
|
|
|
100
99
|
/Whatsapp accounts are not setup for your brand/i
|
|
101
100
|
)
|
|
102
101
|
).toBeInTheDocument();
|
|
103
|
-
}, { timeout:
|
|
102
|
+
}, { timeout: 5000, interval: 100 });
|
|
104
103
|
await userEvent.click(line);
|
|
105
104
|
//assertions for template filters for line channel
|
|
106
105
|
expect(creativesScreen.getByText(/rich video message/i)).toBeInTheDocument();
|
|
@@ -131,7 +130,7 @@ describe("Creatives testing template creation", () => {
|
|
|
131
130
|
const createButton = await creativesScreen.findByRole('button', {
|
|
132
131
|
name: /create new/i,
|
|
133
132
|
});
|
|
134
|
-
await waitFor(() => expect(createButton).toBeEnabled(),{timeout:
|
|
133
|
+
await waitFor(() => expect(createButton).toBeEnabled(),{timeout: 5000, interval: 100});
|
|
135
134
|
userEvent.click(createButton);
|
|
136
135
|
// expect(await creativesScreen.findByText(/Creative name/i, undefined, {timeout: 10000})).toBeInTheDocument();
|
|
137
136
|
const templateNameInput = await creativesScreen.findByTestId(
|
|
@@ -187,7 +186,7 @@ describe("Creatives testing template creation", () => {
|
|
|
187
186
|
const createButton = creativesScreen.getByRole('button', {
|
|
188
187
|
name: /create new/i,
|
|
189
188
|
});
|
|
190
|
-
await waitFor(() => expect(createButton).toBeEnabled(),{ timeout:
|
|
189
|
+
await waitFor(() => expect(createButton).toBeEnabled(),{ timeout: 5000, interval: 100 });
|
|
191
190
|
await userEvent.click(createButton);
|
|
192
191
|
const templateNameInput = await creativesScreen.findByTestId(
|
|
193
192
|
/template_name/,
|
|
@@ -261,7 +260,7 @@ describe("Creatives testing template creation", () => {
|
|
|
261
260
|
const createButton = creativesScreen.getByRole('button', {
|
|
262
261
|
name: /Create new/i,
|
|
263
262
|
});
|
|
264
|
-
await waitFor(() => expect(createButton).toBeEnabled(),{ timeout:
|
|
263
|
+
await waitFor(() => expect(createButton).toBeEnabled(),{ timeout: 5000, interval: 100 });
|
|
265
264
|
userEvent.click(createButton);
|
|
266
265
|
await userEvent.click(createButton);
|
|
267
266
|
screen.debug(null,Infinity);
|
|
@@ -352,7 +351,7 @@ describe("Creatives testing template creation", () => {
|
|
|
352
351
|
target: { value: 'https://capillarytech.com/' },
|
|
353
352
|
});
|
|
354
353
|
await userEvent.click(galleryBtn);
|
|
355
|
-
|
|
354
|
+
jest.advanceTimersByTime(10000);
|
|
356
355
|
expect(
|
|
357
356
|
screen.getByRole('button', {
|
|
358
357
|
name: /close/i,
|
|
@@ -376,7 +375,7 @@ describe("Creatives testing template creation", () => {
|
|
|
376
375
|
name: /create new/i,
|
|
377
376
|
});
|
|
378
377
|
|
|
379
|
-
await waitFor(() => expect(createButton).toBeEnabled(),{ timeout:
|
|
378
|
+
await waitFor(() => expect(createButton).toBeEnabled(),{ timeout: 5000, interval: 100 });
|
|
380
379
|
fireEvent.click(createButton);
|
|
381
380
|
const doneButton = creativesScreen.getByRole('button', {
|
|
382
381
|
name: globalMessages.done.defaultMessage,
|