@capillarytech/creatives-library 8.0.113 → 8.0.114-alpha.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/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 +389 -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 +324 -178
- package/v2Components/CapVideoUpload/tests/index.test.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +1 -2
- package/v2Components/ErrorInfoNote/ErrorTypeRenderer.js +130 -0
- package/v2Components/ErrorInfoNote/ErrorTypeRenderer.test.js +146 -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 +28 -0
- package/v2Components/ErrorInfoNote/utils.test.js +93 -0
- package/v2Components/FormBuilder/index.js +200 -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 +2 -1
- package/v2Containers/CreativesContainer/index.js +37 -10
- 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 +127 -49
- 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/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 +4 -1
- 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 +14 -2
- 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
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "../sagas";
|
|
6
6
|
|
|
7
7
|
describe("appSaga Combined", () => {
|
|
8
|
-
|
|
8
|
+
test.concurrent("should initialize all appSaga-related watcher sagas without error", () => {
|
|
9
9
|
return expectSaga(appSaga).run();
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
import * as actions from '../actions';
|
|
3
2
|
import * as types from '../constants';
|
|
4
3
|
|
|
5
4
|
describe('Gallery actions', () => {
|
|
6
5
|
describe('uploadAsset', () => {
|
|
7
|
-
|
|
6
|
+
test.concurrent('has a type of UPLOAD_ASSET_REQUEST', () => {
|
|
8
7
|
const expected = {
|
|
9
8
|
type: types.UPLOAD_ASSET_REQUEST,
|
|
10
9
|
file: 'test',
|
|
@@ -15,7 +14,7 @@ describe('Gallery actions', () => {
|
|
|
15
14
|
});
|
|
16
15
|
|
|
17
16
|
describe('getAllAssets', () => {
|
|
18
|
-
|
|
17
|
+
test.concurrent('has a type of GET_ALL_ASSETS_REQUEST', () => {
|
|
19
18
|
const expected = {
|
|
20
19
|
type: types.GET_ALL_ASSETS_REQUEST,
|
|
21
20
|
assetType: 'IMAGE',
|
|
@@ -6,7 +6,7 @@ import * as actions from '../actions';
|
|
|
6
6
|
|
|
7
7
|
describe('galleryReducer', () => {
|
|
8
8
|
describe('Initial State should match snapshot', () => {
|
|
9
|
-
it('returns the initial state', () => {
|
|
9
|
+
it.concurrent('returns the initial state', () => {
|
|
10
10
|
expect(galleryReducer(undefined, {})).toMatchSnapshot();
|
|
11
11
|
});
|
|
12
12
|
});
|
|
@@ -50,14 +50,14 @@ describe('galleryReducer', () => {
|
|
|
50
50
|
error: 'Some error Occurred',
|
|
51
51
|
};
|
|
52
52
|
const stateOnFailure = galleryReducer(initialState, failureAction);
|
|
53
|
-
it('should set fetching_schedule_message to true on request', () => {
|
|
53
|
+
it.concurrent('should set fetching_schedule_message to true on request', () => {
|
|
54
54
|
expect(stateOnRequest.toJS()).toEqual({ assetList: [], fetchingAllAssets: true, fetchAllAssetSuccess: false });
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
it('should set assetList from response on success', () => {
|
|
57
|
+
it.concurrent('should set assetList from response on success', () => {
|
|
58
58
|
expect(stateOnSuccess.toJS()).toEqual(successStateExpected);
|
|
59
59
|
});
|
|
60
|
-
it('should set fetching_schedule_message to false on GET_ALL_ASSETS_FAILURE', () => {
|
|
60
|
+
it.concurrent('should set fetching_schedule_message to false on GET_ALL_ASSETS_FAILURE', () => {
|
|
61
61
|
expect(stateOnFailure.toJS()).toEqual({assetList: [], fetchingAllAssets: false, fetchAllAssetSuccess: false});
|
|
62
62
|
});
|
|
63
63
|
});
|
|
@@ -82,14 +82,14 @@ describe('galleryReducer', () => {
|
|
|
82
82
|
error: 'Some error Occurred',
|
|
83
83
|
};
|
|
84
84
|
const stateOnFailure = galleryReducer(initialState, failureAction);
|
|
85
|
-
it('should set assetUploading to true and uploadAssetSuccess to false on request', () => {
|
|
85
|
+
it.concurrent('should set assetUploading to true and uploadAssetSuccess to false on request', () => {
|
|
86
86
|
expect(stateOnRequest.toJS()).toEqual({ uploadAssetSuccess: false, assetUploading: true });
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
it('should set assetUploading to false and uploadAssetSuccess to true on success', () => {
|
|
89
|
+
it.concurrent('should set assetUploading to false and uploadAssetSuccess to true on success', () => {
|
|
90
90
|
expect(stateOnSuccess.toJS()).toEqual(successStateExpected);
|
|
91
91
|
});
|
|
92
|
-
it('should set assetUploading to false and uploadAssetSuccess to false on UPLOAD_ASSET_FAILURE', () => {
|
|
92
|
+
it.concurrent('should set assetUploading to false and uploadAssetSuccess to false on UPLOAD_ASSET_FAILURE', () => {
|
|
93
93
|
expect(stateOnFailure.toJS()).toEqual({ uploadAssetSuccess: false, assetUploading: false });
|
|
94
94
|
});
|
|
95
95
|
});
|
|
@@ -14,7 +14,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
14
14
|
const assetType = 'image';
|
|
15
15
|
const queryParams = { page: 1 };
|
|
16
16
|
|
|
17
|
-
it('handles fetching all assets successfully', () => {
|
|
17
|
+
it.concurrent('handles fetching all assets successfully', () => {
|
|
18
18
|
const result = {
|
|
19
19
|
response: { data: { data: mockAssets } },
|
|
20
20
|
};
|
|
@@ -30,7 +30,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
30
30
|
.run(500);
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
it('handles failure in fetching all assets', () => expectSaga(sagas.getAllAssets, { assetType, queryParams })
|
|
33
|
+
it.concurrent('handles failure in fetching all assets', () => expectSaga(sagas.getAllAssets, { assetType, queryParams })
|
|
34
34
|
.provide([
|
|
35
35
|
[call(Api.getAllAssets, { assetType, queryParams }), throwError(mockError)],
|
|
36
36
|
])
|
|
@@ -46,7 +46,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
46
46
|
const assetType = 'image';
|
|
47
47
|
const fileParams = { param1: 'value1' };
|
|
48
48
|
|
|
49
|
-
it('handles successful asset upload', () => {
|
|
49
|
+
it.concurrent('handles successful asset upload', () => {
|
|
50
50
|
const fakeResponse = {
|
|
51
51
|
response: { asset: { id: 1, url: 'http://example.com/asset.jpg' } },
|
|
52
52
|
status: { code: 200 },
|
|
@@ -64,7 +64,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
64
64
|
.run();
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
it('handles failure in asset upload', () => {
|
|
67
|
+
it.concurrent('handles failure in asset upload', () => {
|
|
68
68
|
const error = new Error('Failed to upload asset');
|
|
69
69
|
|
|
70
70
|
return expectSaga(sagas.uploadAsset, file, assetType, fileParams)
|
|
@@ -83,7 +83,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
83
83
|
const assetId = '123';
|
|
84
84
|
const assetType = 'image';
|
|
85
85
|
|
|
86
|
-
it('handles deleting an asset successfully', () => {
|
|
86
|
+
it.concurrent('handles deleting an asset successfully', () => {
|
|
87
87
|
const fakeResponse = {
|
|
88
88
|
response: 'Asset deleted successfully',
|
|
89
89
|
};
|
|
@@ -99,7 +99,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
99
99
|
.run();
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
it('handles failure in deleting an asset', () => {
|
|
102
|
+
it.concurrent('handles failure in deleting an asset', () => {
|
|
103
103
|
const error = new Error('Deletion failed');
|
|
104
104
|
|
|
105
105
|
return expectSaga(sagas.deleteAssetById, assetId, assetType)
|
|
@@ -115,7 +115,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
describe('fetchUserList Saga', () => {
|
|
118
|
-
it('handles fetching user list successfully', () => {
|
|
118
|
+
it.concurrent('handles fetching user list successfully', () => {
|
|
119
119
|
const fakeResponse = {
|
|
120
120
|
data: {
|
|
121
121
|
result: [{ id: 1, name: 'User One' }],
|
|
@@ -133,7 +133,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
133
133
|
.run();
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
-
it('handles failure in fetching user list', () => {
|
|
136
|
+
it.concurrent('handles failure in fetching user list', () => {
|
|
137
137
|
const error = new Error('Fetch failed');
|
|
138
138
|
|
|
139
139
|
return expectSaga(sagas.fetchUserList)
|
|
@@ -151,7 +151,7 @@ describe('Asset and User Management Sagas', () => {
|
|
|
151
151
|
|
|
152
152
|
// Test combined saga
|
|
153
153
|
describe('Combined gallerySaga', () => {
|
|
154
|
-
it('should initialize all gallery-related watcher sagas without error', () => expectSaga(sagas.gallerySaga)
|
|
154
|
+
it.concurrent('should initialize all gallery-related watcher sagas without error', () => expectSaga(sagas.gallerySaga)
|
|
155
155
|
.run());
|
|
156
156
|
});
|
|
157
157
|
});
|
|
@@ -3,7 +3,7 @@ import { expectSaga } from "redux-saga-test-plan";
|
|
|
3
3
|
import { dashboardSaga } from "../sagas";
|
|
4
4
|
|
|
5
5
|
describe("dashboardSaga Combined", () => {
|
|
6
|
-
|
|
6
|
+
test.concurrent("should initialize all dashboardSaga-related watcher sagas without error", () => {
|
|
7
7
|
return expectSaga(dashboardSaga).run();
|
|
8
8
|
});
|
|
9
9
|
});
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "../sagas";
|
|
6
6
|
|
|
7
7
|
describe("ebillSaga Combined", () => {
|
|
8
|
-
|
|
8
|
+
test.concurrent("should initialize all ebill-related watcher sagas without error", () => {
|
|
9
9
|
return expectSaga(ebillSaga).run();
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -12,7 +12,7 @@ describe('Email Template Sagas', () => {
|
|
|
12
12
|
describe('createTemplate Saga', () => {
|
|
13
13
|
const template = { name: 'Test Template', content: 'Test Content' };
|
|
14
14
|
|
|
15
|
-
it('should handle successful template creation', () => {
|
|
15
|
+
it.concurrent('should handle successful template creation', () => {
|
|
16
16
|
const generator = sagas.createTemplate(template);
|
|
17
17
|
const response = {
|
|
18
18
|
response: { id: 1, name: 'Test Template' },
|
|
@@ -33,7 +33,7 @@ describe('Email Template Sagas', () => {
|
|
|
33
33
|
expect(generator.next().done).toBeTruthy();
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
it('should handle server error with status code 500', () => {
|
|
36
|
+
it.concurrent('should handle server error with status code 500', () => {
|
|
37
37
|
const generator = sagas.createTemplate(template);
|
|
38
38
|
const response = {
|
|
39
39
|
message: 'Internal Server Error',
|
|
@@ -54,7 +54,7 @@ describe('Email Template Sagas', () => {
|
|
|
54
54
|
expect(generator.next().done).toBeTruthy();
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
it('should handle API error response with message', () => {
|
|
57
|
+
it.concurrent('should handle API error response with message', () => {
|
|
58
58
|
const generator = sagas.createTemplate(template);
|
|
59
59
|
const response = {
|
|
60
60
|
message: 'Validation Error',
|
|
@@ -75,7 +75,7 @@ describe('Email Template Sagas', () => {
|
|
|
75
75
|
expect(generator.next().done).toBeTruthy();
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
it('should handle API call exception', () => {
|
|
78
|
+
it.concurrent('should handle API call exception', () => {
|
|
79
79
|
const generator = sagas.createTemplate(template);
|
|
80
80
|
const error = new Error('Network Error');
|
|
81
81
|
|
|
@@ -92,7 +92,7 @@ describe('Email Template Sagas', () => {
|
|
|
92
92
|
expect(generator.next().done).toBeTruthy();
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
-
it('should set empty string statusCode when status is null', () => {
|
|
95
|
+
it.concurrent('should set empty string statusCode when status is null', () => {
|
|
96
96
|
const generator = sagas.createTemplate(template);
|
|
97
97
|
const response = {
|
|
98
98
|
response: { id: 1, name: 'Test Template' },
|
|
@@ -114,7 +114,7 @@ describe('Email Template Sagas', () => {
|
|
|
114
114
|
expect(generator.next().done).toBeTruthy();
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
it('should set empty string statusCode when status is undefined', () => {
|
|
117
|
+
it.concurrent('should set empty string statusCode when status is undefined', () => {
|
|
118
118
|
const generator = sagas.createTemplate(template);
|
|
119
119
|
const response = {
|
|
120
120
|
response: { id: 1, name: 'Test Template' },
|
|
@@ -135,7 +135,7 @@ describe('Email Template Sagas', () => {
|
|
|
135
135
|
expect(generator.next().done).toBeTruthy();
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
it('should set empty string statusCode when status.code is null', () => {
|
|
138
|
+
it.concurrent('should set empty string statusCode when status.code is null', () => {
|
|
139
139
|
const generator = sagas.createTemplate(template);
|
|
140
140
|
const response = {
|
|
141
141
|
response: { id: 1, name: 'Test Template' },
|
|
@@ -157,7 +157,7 @@ describe('Email Template Sagas', () => {
|
|
|
157
157
|
expect(generator.next().done).toBeTruthy();
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
-
it('should set empty string statusCode when status.code is undefined', () => {
|
|
160
|
+
it.concurrent('should set empty string statusCode when status.code is undefined', () => {
|
|
161
161
|
const generator = sagas.createTemplate(template);
|
|
162
162
|
const response = {
|
|
163
163
|
response: { id: 1, name: 'Test Template' },
|
|
@@ -179,7 +179,7 @@ describe('Email Template Sagas', () => {
|
|
|
179
179
|
expect(generator.next().done).toBeTruthy();
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
it('should set empty string statusCode when status is an empty object', () => {
|
|
182
|
+
it.concurrent('should set empty string statusCode when status is an empty object', () => {
|
|
183
183
|
const generator = sagas.createTemplate(template);
|
|
184
184
|
const response = {
|
|
185
185
|
response: { id: 1, name: 'Test Template' },
|
|
@@ -206,7 +206,7 @@ describe('Email Template Sagas', () => {
|
|
|
206
206
|
const templateId = 123;
|
|
207
207
|
const channel = 'email';
|
|
208
208
|
|
|
209
|
-
it('should handle successful template duplication with complete response', () => {
|
|
209
|
+
it.concurrent('should handle successful template duplication with complete response', () => {
|
|
210
210
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
211
211
|
const response = {
|
|
212
212
|
response: { id: 456, name: 'Duplicated Template' },
|
|
@@ -228,7 +228,7 @@ describe('Email Template Sagas', () => {
|
|
|
228
228
|
expect(generator.next().done).toBeTruthy();
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
-
it('should handle response with missing status object', () => {
|
|
231
|
+
it.concurrent('should handle response with missing status object', () => {
|
|
232
232
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
233
233
|
const response = {
|
|
234
234
|
response: { id: 456, name: 'Duplicated Template' },
|
|
@@ -249,7 +249,7 @@ describe('Email Template Sagas', () => {
|
|
|
249
249
|
expect(generator.next().done).toBeTruthy();
|
|
250
250
|
});
|
|
251
251
|
|
|
252
|
-
it('should handle response with empty status object', () => {
|
|
252
|
+
it.concurrent('should handle response with empty status object', () => {
|
|
253
253
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
254
254
|
const response = {
|
|
255
255
|
response: { id: 456, name: 'Duplicated Template' },
|
|
@@ -271,7 +271,7 @@ describe('Email Template Sagas', () => {
|
|
|
271
271
|
expect(generator.next().done).toBeTruthy();
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
-
it('should handle response with null status', () => {
|
|
274
|
+
it.concurrent('should handle response with null status', () => {
|
|
275
275
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
276
276
|
const response = {
|
|
277
277
|
response: { id: 456, name: 'Duplicated Template' },
|
|
@@ -293,7 +293,7 @@ describe('Email Template Sagas', () => {
|
|
|
293
293
|
expect(generator.next().done).toBeTruthy();
|
|
294
294
|
});
|
|
295
295
|
|
|
296
|
-
it('should handle response with undefined status code', () => {
|
|
296
|
+
it.concurrent('should handle response with undefined status code', () => {
|
|
297
297
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
298
298
|
const response = {
|
|
299
299
|
response: { id: 456, name: 'Duplicated Template' },
|
|
@@ -315,7 +315,7 @@ describe('Email Template Sagas', () => {
|
|
|
315
315
|
expect(generator.next().done).toBeTruthy();
|
|
316
316
|
});
|
|
317
317
|
|
|
318
|
-
it('should handle response with missing response data', () => {
|
|
318
|
+
it.concurrent('should handle response with missing response data', () => {
|
|
319
319
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
320
320
|
const response = {
|
|
321
321
|
status: { code: 200 },
|
|
@@ -336,7 +336,7 @@ describe('Email Template Sagas', () => {
|
|
|
336
336
|
expect(generator.next().done).toBeTruthy();
|
|
337
337
|
});
|
|
338
338
|
|
|
339
|
-
it('should handle error response', () => {
|
|
339
|
+
it.concurrent('should handle error response', () => {
|
|
340
340
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
341
341
|
const error = new Error('Duplication failed');
|
|
342
342
|
|
|
@@ -353,7 +353,7 @@ describe('Email Template Sagas', () => {
|
|
|
353
353
|
expect(generator.next().done).toBeTruthy();
|
|
354
354
|
});
|
|
355
355
|
|
|
356
|
-
it('should set errorMsg when status code is 500', () => {
|
|
356
|
+
it.concurrent('should set errorMsg when status code is 500', () => {
|
|
357
357
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
358
358
|
const response = {
|
|
359
359
|
response: { id: 456 },
|
|
@@ -375,7 +375,7 @@ describe('Email Template Sagas', () => {
|
|
|
375
375
|
expect(generator.next().done).toBeTruthy();
|
|
376
376
|
});
|
|
377
377
|
|
|
378
|
-
it('should set errorMsg when both message exists and status code is 500', () => {
|
|
378
|
+
it.concurrent('should set errorMsg when both message exists and status code is 500', () => {
|
|
379
379
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
380
380
|
const response = {
|
|
381
381
|
response: null,
|
|
@@ -397,7 +397,7 @@ describe('Email Template Sagas', () => {
|
|
|
397
397
|
expect(generator.next().done).toBeTruthy();
|
|
398
398
|
});
|
|
399
399
|
|
|
400
|
-
it('should set errorMsg when message exists but status code is not 500', () => {
|
|
400
|
+
it.concurrent('should set errorMsg when message exists but status code is not 500', () => {
|
|
401
401
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
402
402
|
const response = {
|
|
403
403
|
response: { id: 456 },
|
|
@@ -419,7 +419,7 @@ describe('Email Template Sagas', () => {
|
|
|
419
419
|
expect(generator.next().done).toBeTruthy();
|
|
420
420
|
});
|
|
421
421
|
|
|
422
|
-
it('should handle case when status code is 500 but no message exists', () => {
|
|
422
|
+
it.concurrent('should handle case when status code is 500 but no message exists', () => {
|
|
423
423
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
424
424
|
const response = {
|
|
425
425
|
response: { id: 456 },
|
|
@@ -440,7 +440,7 @@ describe('Email Template Sagas', () => {
|
|
|
440
440
|
expect(generator.next().done).toBeTruthy();
|
|
441
441
|
});
|
|
442
442
|
|
|
443
|
-
it('should not set errorMsg when no message and status code is not 500', () => {
|
|
443
|
+
it.concurrent('should not set errorMsg when no message and status code is not 500', () => {
|
|
444
444
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
445
445
|
const response = {
|
|
446
446
|
response: { id: 456 },
|
|
@@ -461,7 +461,7 @@ describe('Email Template Sagas', () => {
|
|
|
461
461
|
expect(generator.next().done).toBeTruthy();
|
|
462
462
|
});
|
|
463
463
|
|
|
464
|
-
it('should handle case when accessing status.code throws error', () => {
|
|
464
|
+
it.concurrent('should handle case when accessing status.code throws error', () => {
|
|
465
465
|
const generator = sagas.duplicateTemplate(templateId, channel);
|
|
466
466
|
const error = new TypeError("Cannot read property 'code' of undefined");
|
|
467
467
|
|
|
@@ -482,7 +482,7 @@ describe('Email Template Sagas', () => {
|
|
|
482
482
|
describe('getTemplateDetails Saga', () => {
|
|
483
483
|
const id = '123';
|
|
484
484
|
|
|
485
|
-
it('handles fetching template details successfully', () => {
|
|
485
|
+
it.concurrent('handles fetching template details successfully', () => {
|
|
486
486
|
const fakeResponse = {
|
|
487
487
|
response: { id: 123, name: 'Detailed Template' },
|
|
488
488
|
};
|
|
@@ -498,7 +498,7 @@ describe('Email Template Sagas', () => {
|
|
|
498
498
|
.run();
|
|
499
499
|
});
|
|
500
500
|
|
|
501
|
-
it('handles failure in fetching template details', () => {
|
|
501
|
+
it.concurrent('handles failure in fetching template details', () => {
|
|
502
502
|
const error = new Error('Fetch failed');
|
|
503
503
|
|
|
504
504
|
return expectSaga(sagas.getTemplateDetails, id)
|
|
@@ -519,7 +519,7 @@ describe('Email Template Sagas', () => {
|
|
|
519
519
|
const assetType = 'image';
|
|
520
520
|
const queryParams = { page: 1 };
|
|
521
521
|
|
|
522
|
-
it('handles fetching all assets successfully', () => {
|
|
522
|
+
it.concurrent('handles fetching all assets successfully', () => {
|
|
523
523
|
const result = {
|
|
524
524
|
response: { data: { data: mockAssets } },
|
|
525
525
|
};
|
|
@@ -535,7 +535,7 @@ describe('Email Template Sagas', () => {
|
|
|
535
535
|
.run(500);
|
|
536
536
|
});
|
|
537
537
|
|
|
538
|
-
it('handles failure in fetching all assets', () => expectSaga(sagas.getAllAssets, { assetType, queryParams })
|
|
538
|
+
it.concurrent('handles failure in fetching all assets', () => expectSaga(sagas.getAllAssets, { assetType, queryParams })
|
|
539
539
|
.provide([
|
|
540
540
|
[call(Api.getAllAssets, { assetType, queryParams }), throwError(mockError)],
|
|
541
541
|
])
|
|
@@ -551,7 +551,7 @@ describe('Email Template Sagas', () => {
|
|
|
551
551
|
cmsType: 'email', projectId: '123', cmsMode: 'edit', langId: 'en', isEdmSupport: true,
|
|
552
552
|
};
|
|
553
553
|
|
|
554
|
-
it('handles fetching CMS settings successfully', () => {
|
|
554
|
+
it.concurrent('handles fetching CMS settings successfully', () => {
|
|
555
555
|
const fakeResponse = {
|
|
556
556
|
data: {
|
|
557
557
|
response: {
|
|
@@ -571,7 +571,7 @@ describe('Email Template Sagas', () => {
|
|
|
571
571
|
.run();
|
|
572
572
|
});
|
|
573
573
|
|
|
574
|
-
it('handles failure in fetching CMS settings', () => {
|
|
574
|
+
it.concurrent('handles failure in fetching CMS settings', () => {
|
|
575
575
|
const error = new Error('Fetch failed');
|
|
576
576
|
|
|
577
577
|
return expectSaga(sagas.getCmsSetting, params)
|
|
@@ -589,7 +589,7 @@ describe('Email Template Sagas', () => {
|
|
|
589
589
|
describe('getCmsData Saga', () => {
|
|
590
590
|
const params = { cmsType: 'email', projectId: '123', langId: 'en' };
|
|
591
591
|
|
|
592
|
-
it('handles fetching CMS data successfully', () => {
|
|
592
|
+
it.concurrent('handles fetching CMS data successfully', () => {
|
|
593
593
|
const fakeResponse = {
|
|
594
594
|
data: {
|
|
595
595
|
response: {
|
|
@@ -611,7 +611,7 @@ describe('Email Template Sagas', () => {
|
|
|
611
611
|
.run();
|
|
612
612
|
});
|
|
613
613
|
|
|
614
|
-
it('handles failure in fetching CMS data', () => {
|
|
614
|
+
it.concurrent('handles failure in fetching CMS data', () => {
|
|
615
615
|
const error = new Error('Fetch failed');
|
|
616
616
|
|
|
617
617
|
return expectSaga(sagas.getCmsData, params)
|
|
@@ -631,7 +631,7 @@ describe('Email Template Sagas', () => {
|
|
|
631
631
|
const assetType = 'image';
|
|
632
632
|
const fileParams = { param1: 'value1' };
|
|
633
633
|
|
|
634
|
-
it('handles successful asset upload', () => {
|
|
634
|
+
it.concurrent('handles successful asset upload', () => {
|
|
635
635
|
const fakeResponse = {
|
|
636
636
|
response: { asset: { id: 1, url: 'http://example.com/asset.jpg' } },
|
|
637
637
|
status: { code: '200' },
|
|
@@ -649,7 +649,7 @@ describe('Email Template Sagas', () => {
|
|
|
649
649
|
.run();
|
|
650
650
|
});
|
|
651
651
|
|
|
652
|
-
it('handles failure in asset upload', () => {
|
|
652
|
+
it.concurrent('handles failure in asset upload', () => {
|
|
653
653
|
const error = new Error('Failed to upload asset');
|
|
654
654
|
|
|
655
655
|
return expectSaga(sagas.uploadAsset, file, assetType, fileParams)
|
|
@@ -665,7 +665,7 @@ describe('Email Template Sagas', () => {
|
|
|
665
665
|
});
|
|
666
666
|
|
|
667
667
|
describe('Combined emailSaga', () => {
|
|
668
|
-
it('should initialize all email-related watcher sagas without error', () => expectSaga(sagas.emailSaga)
|
|
668
|
+
it.concurrent('should initialize all email-related watcher sagas without error', () => expectSaga(sagas.emailSaga)
|
|
669
669
|
.run());
|
|
670
670
|
});
|
|
671
671
|
});
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
describe('LanguageProvider actions', () => {
|
|
10
10
|
describe('Change Local Action', () => {
|
|
11
|
-
|
|
11
|
+
test.concurrent('has a type of CHANGE_LOCALE', () => {
|
|
12
12
|
const expected = {
|
|
13
13
|
type: CHANGE_LOCALE,
|
|
14
14
|
locale: 'de',
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from '../constants';
|
|
7
7
|
|
|
8
8
|
describe('languageProviderReducer', () => {
|
|
9
|
-
it('returns the initial state', () => {
|
|
9
|
+
it.concurrent('returns the initial state', () => {
|
|
10
10
|
expect(languageProviderReducer(undefined, {})).toEqual(fromJS({
|
|
11
11
|
locale: 'en',
|
|
12
12
|
}));
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
it('changes the locale', () => {
|
|
15
|
+
it.concurrent('changes the locale', () => {
|
|
16
16
|
expect(languageProviderReducer(undefined, { type: CHANGE_LOCALE, locale: 'de' }).toJS()).toEqual({
|
|
17
17
|
locale: 'de',
|
|
18
18
|
});
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from '../selectors';
|
|
6
6
|
|
|
7
7
|
describe('selectLanguage', () => {
|
|
8
|
-
it('should select the global state', () => {
|
|
8
|
+
it.concurrent('should select the global state', () => {
|
|
9
9
|
const globalState = fromJS({});
|
|
10
10
|
const mockedState = fromJS({
|
|
11
11
|
language: globalState,
|
|
@@ -161,15 +161,13 @@ describe('Line Template Sagas', () => {
|
|
|
161
161
|
|
|
162
162
|
describe('getLineTemplatesList Saga', () => {
|
|
163
163
|
const params = { channel: 'line', queryParams: { sort: 'asc' } };
|
|
164
|
-
|
|
165
|
-
it('handles fetching line templates list successfully', () => {
|
|
164
|
+
test.concurrent('handles fetching line templates list successfully', () => {
|
|
166
165
|
const fakeResponse = {
|
|
167
166
|
response: {
|
|
168
167
|
templates: [{ id: 1, name: 'Template One' }],
|
|
169
168
|
mapped: { id: 2, name: 'Mapped Template' }
|
|
170
169
|
}
|
|
171
170
|
};
|
|
172
|
-
|
|
173
171
|
return expectSaga(sagas.getLineTemplatesList, params)
|
|
174
172
|
.provide([
|
|
175
173
|
[call(Api.getAllTemplates, { channel: params.channel, queryParams: params.queryParams }), fakeResponse]
|
|
@@ -181,10 +179,8 @@ describe('Line Template Sagas', () => {
|
|
|
181
179
|
})
|
|
182
180
|
.run();
|
|
183
181
|
});
|
|
184
|
-
|
|
185
|
-
it('handles failure in fetching line templates list', () => {
|
|
182
|
+
test.concurrent('handles failure in fetching line templates list', () => {
|
|
186
183
|
const error = new Error('Fetch failed');
|
|
187
|
-
|
|
188
184
|
return expectSaga(sagas.getLineTemplatesList, params)
|
|
189
185
|
.provide([
|
|
190
186
|
[call(Api.getAllTemplates, { channel: params.channel, queryParams: params.queryParams }), throwError(error)]
|
|
@@ -196,9 +192,6 @@ describe('Line Template Sagas', () => {
|
|
|
196
192
|
.run();
|
|
197
193
|
});
|
|
198
194
|
});
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
195
|
});
|
|
203
196
|
|
|
204
197
|
describe('Combined lineCreateSaga', () => {
|
|
@@ -16,7 +16,7 @@ describe('Template Sagas', () => {
|
|
|
16
16
|
|
|
17
17
|
describe('editTemplate Saga', () => {
|
|
18
18
|
const template = { id: 1, content: 'Updated Content' };
|
|
19
|
-
it('handles editing template successfully', () => {
|
|
19
|
+
it.concurrent('handles editing template successfully', () => {
|
|
20
20
|
const fakeResponse = {
|
|
21
21
|
response: { updated: true },
|
|
22
22
|
status: { code: 200 }
|
|
@@ -35,7 +35,7 @@ describe('Template Sagas', () => {
|
|
|
35
35
|
.run();
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
it('handles failure in editing template', () => {
|
|
38
|
+
it.concurrent('handles failure in editing template', () => {
|
|
39
39
|
const error = new Error('Update failed');
|
|
40
40
|
|
|
41
41
|
return expectSaga(sagas.editTemplate, template)
|
|
@@ -53,12 +53,10 @@ describe('Template Sagas', () => {
|
|
|
53
53
|
|
|
54
54
|
describe('getTemplateDetails Saga', () => {
|
|
55
55
|
const id = '123';
|
|
56
|
-
|
|
57
|
-
it('handles fetching template details successfully', () => {
|
|
56
|
+
test.concurrent('handles fetching template details successfully', () => {
|
|
58
57
|
const fakeResponse = {
|
|
59
58
|
response: { id: 123, name: 'Detailed Template' }
|
|
60
59
|
};
|
|
61
|
-
|
|
62
60
|
return expectSaga(sagas.getTemplateDetails, id)
|
|
63
61
|
.provide([
|
|
64
62
|
[call(Api.getTemplateDetails, id), fakeResponse]
|
|
@@ -69,10 +67,8 @@ describe('Template Sagas', () => {
|
|
|
69
67
|
})
|
|
70
68
|
.run();
|
|
71
69
|
});
|
|
72
|
-
|
|
73
|
-
it('handles failure in fetching template details', () => {
|
|
70
|
+
test.concurrent('handles failure in fetching template details', () => {
|
|
74
71
|
const error = new Error('Fetch failed');
|
|
75
|
-
|
|
76
72
|
return expectSaga(sagas.getTemplateDetails, id)
|
|
77
73
|
.provide([
|
|
78
74
|
[call(Api.getTemplateDetails, id), throwError(error)]
|
|
@@ -91,7 +87,7 @@ describe('Template Sagas', () => {
|
|
|
91
87
|
const fileParams = { directory: 'profile' };
|
|
92
88
|
const mode = 'create';
|
|
93
89
|
|
|
94
|
-
it('handles asset upload successfully', () => {
|
|
90
|
+
it.concurrent('handles asset upload successfully', () => {
|
|
95
91
|
const fakeResponse = {
|
|
96
92
|
response: { asset: { id: 1, url: 'http://example.com/image.png' } },
|
|
97
93
|
status: { code: 200 }
|
|
@@ -109,7 +105,7 @@ describe('Template Sagas', () => {
|
|
|
109
105
|
.run();
|
|
110
106
|
});
|
|
111
107
|
|
|
112
|
-
it('handles failure in uploading asset', () => {
|
|
108
|
+
it.concurrent('handles failure in uploading asset', () => {
|
|
113
109
|
const error = new Error('Upload failed');
|
|
114
110
|
|
|
115
111
|
return expectSaga(sagas.uploadAsset, file, assetType, fileParams, mode)
|
|
@@ -127,7 +123,7 @@ describe('Template Sagas', () => {
|
|
|
127
123
|
describe('Saga watchers', () => {
|
|
128
124
|
describe('watchEditTemplate saga', () => {
|
|
129
125
|
const generator = watchEditTemplate();
|
|
130
|
-
it('should take the latest EDIT_TEMPLATE_REQUEST actions and call editTemplate saga', () => {
|
|
126
|
+
it.concurrent('should take the latest EDIT_TEMPLATE_REQUEST actions and call editTemplate saga', () => {
|
|
131
127
|
expect(generator.next().value).toEqual(
|
|
132
128
|
takeLatest(types.EDIT_TEMPLATE_REQUEST, sagas.editTemplate),
|
|
133
129
|
);
|
|
@@ -136,7 +132,7 @@ describe('Saga watchers', () => {
|
|
|
136
132
|
|
|
137
133
|
describe('watchGetTemplateDetails saga', () => {
|
|
138
134
|
const generator = watchGetTemplateDetails();
|
|
139
|
-
it('should take the latest GET_TEMPLATE_DETAILS_REQUEST actions and call getTemplateDetails saga', () => {
|
|
135
|
+
it.concurrent('should take the latest GET_TEMPLATE_DETAILS_REQUEST actions and call getTemplateDetails saga', () => {
|
|
140
136
|
expect(generator.next().value).toEqual(
|
|
141
137
|
takeLatest(types.GET_TEMPLATE_DETAILS_REQUEST, sagas.getTemplateDetails),
|
|
142
138
|
);
|
|
@@ -145,7 +141,7 @@ describe('Saga watchers', () => {
|
|
|
145
141
|
|
|
146
142
|
describe('watchUploadAsset saga', () => {
|
|
147
143
|
const generator = watchUploadAsset();
|
|
148
|
-
it('should take the latest UPLOAD_ASSET_REQUEST actions and call uploadAsset saga', () => {
|
|
144
|
+
it.concurrent('should take the latest UPLOAD_ASSET_REQUEST actions and call uploadAsset saga', () => {
|
|
149
145
|
expect(generator.next().value).toEqual(
|
|
150
146
|
takeLatest(types.UPLOAD_ASSET_REQUEST, sagas.uploadAsset),
|
|
151
147
|
);
|
|
@@ -154,7 +150,7 @@ describe('Saga watchers', () => {
|
|
|
154
150
|
|
|
155
151
|
describe('watchLineTemplatesList saga', () => {
|
|
156
152
|
const generator = watchLineTemplatesList();
|
|
157
|
-
it('should take the latest GET_LINE_TEMPLATES_LIST_REQUEST actions and call getLineTemplatesList saga', () => {
|
|
153
|
+
it.concurrent('should take the latest GET_LINE_TEMPLATES_LIST_REQUEST actions and call getLineTemplatesList saga', () => {
|
|
158
154
|
expect(generator.next().value).toEqual(
|
|
159
155
|
takeLatest(types.GET_LINE_TEMPLATES_LIST_REQUEST, sagas.getLineTemplatesList),
|
|
160
156
|
);
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
|
|
8
8
|
describe("MPUSH Sagas", () => {
|
|
9
9
|
describe("duplicateMPushSaga Combined", () => {
|
|
10
|
-
it("should initialize all MPUSH-related watcher sagas without error", () => {
|
|
10
|
+
it.concurrent("should initialize all MPUSH-related watcher sagas without error", () => {
|
|
11
11
|
return expectSaga(duplicateMPushSaga).run();
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
14
|
describe("createMPushSaga Combined", () => {
|
|
15
|
-
it("should initialize all MPUSH-related watcher sagas without error", () => {
|
|
15
|
+
it.concurrent("should initialize all MPUSH-related watcher sagas without error", () => {
|
|
16
16
|
return expectSaga(createMPushSaga).run();
|
|
17
17
|
});
|
|
18
18
|
});
|