@capillarytech/creatives-library 8.0.114-alpha.2 → 8.0.114
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/utils/commonUtils.js +3 -353
- package/utils/tagValidations.js +5 -22
- package/utils/tests/commonUtil.test.js +169 -563
- package/utils/tests/tagValidations.test.js +3 -129
- package/v2Components/ErrorInfoNote/index.js +47 -114
- package/v2Components/ErrorInfoNote/messages.js +0 -25
- package/v2Components/ErrorInfoNote/style.scss +1 -14
- package/v2Components/FormBuilder/index.js +127 -203
- package/v2Components/FormBuilder/messages.js +1 -1
- package/v2Containers/Cap/reducer.js +4 -4
- package/v2Containers/Cap/sagas.js +3 -9
- package/v2Containers/Cap/tests/saga.test.js +0 -12
- package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -26
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -3
- package/v2Containers/CreativesContainer/constants.js +1 -4
- package/v2Containers/CreativesContainer/index.js +19 -46
- package/v2Containers/CreativesContainer/messages.js +0 -4
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +3 -21
- package/v2Containers/CreativesContainer/tests/index.test.js +0 -1
- package/v2Containers/Ebill/index.js +3 -3
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +1 -1
- package/v2Containers/InApp/index.js +50 -125
- package/v2Containers/InApp/tests/index.test.js +1 -1
- package/v2Containers/InApp/tests/sagas.test.js +1 -1
- package/v2Containers/InApp/utils.js +0 -57
- package/v2Containers/MobilePush/Create/index.js +20 -24
- package/v2Containers/MobilePush/Edit/index.js +2 -6
- package/v2Containers/MobilepushWrapper/index.js +0 -2
- package/v2Containers/Sms/Create/index.js +0 -1
- package/v2Containers/Sms/Edit/index.js +0 -2
- package/v2Containers/SmsTrai/Edit/index.js +10 -49
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +36 -112
- package/v2Containers/SmsTrai/Edit/tests/index.test.js +3 -1
- package/v2Containers/SmsWrapper/index.js +1 -5
- package/v2Containers/Templates/sagas.js +1 -1
- package/v2Containers/Whatsapp/constants.js +1 -1
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +57476 -0
- package/v2Containers/Whatsapp/tests/index.test.js +88 -0
- package/v2Components/ErrorInfoNote/ErrorTypeRenderer.js +0 -127
- package/v2Components/ErrorInfoNote/ErrorTypeRenderer.test.js +0 -147
- package/v2Components/ErrorInfoNote/utils.js +0 -38
- package/v2Components/ErrorInfoNote/utils.test.js +0 -156
- package/v2Containers/InApp/tests/utils.test.js +0 -85
- package/v2Containers/InApp/utils.test.js +0 -70
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { hasAnyErrors } from './utils';
|
|
2
|
-
|
|
3
|
-
// Helper: minimal error group structure
|
|
4
|
-
const emptyErrorGroup = { ANDROID: [], IOS: [], GENERIC: [] };
|
|
5
|
-
const errorInAndroid = { ANDROID: ['Some error'], IOS: [], GENERIC: [] };
|
|
6
|
-
const errorInIOS = { ANDROID: [], IOS: ['Some error'], GENERIC: [] };
|
|
7
|
-
const errorInGeneric = { ANDROID: [], IOS: [], GENERIC: ['Some error'] };
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
describe('hasAnyErrors', () => {
|
|
11
|
-
it('returns false if errorMessage is null', () => {
|
|
12
|
-
expect(hasAnyErrors(null)).toBe(false);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('returns false if errorMessage is undefined', () => {
|
|
16
|
-
expect(hasAnyErrors(undefined)).toBe(false);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('returns false if both STANDARD_ERROR_MSG and LIQUID_ERROR_MSG are missing', () => {
|
|
20
|
-
expect(hasAnyErrors({})).toBe(false);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('returns false if both STANDARD_ERROR_MSG and LIQUID_ERROR_MSG are empty', () => {
|
|
24
|
-
const errorMessage = {
|
|
25
|
-
STANDARD_ERROR_MSG: emptyErrorGroup,
|
|
26
|
-
LIQUID_ERROR_MSG: emptyErrorGroup,
|
|
27
|
-
};
|
|
28
|
-
expect(hasAnyErrors(errorMessage)).toBe(false);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('returns true if STANDARD_ERROR_MSG has errors', () => {
|
|
32
|
-
const errorMessage = {
|
|
33
|
-
STANDARD_ERROR_MSG: errorInAndroid,
|
|
34
|
-
LIQUID_ERROR_MSG: emptyErrorGroup,
|
|
35
|
-
};
|
|
36
|
-
expect(hasAnyErrors(errorMessage)).toBe(true);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('returns true if LIQUID_ERROR_MSG has errors', () => {
|
|
40
|
-
const errorMessage = {
|
|
41
|
-
STANDARD_ERROR_MSG: emptyErrorGroup,
|
|
42
|
-
LIQUID_ERROR_MSG: errorInIOS,
|
|
43
|
-
};
|
|
44
|
-
expect(hasAnyErrors(errorMessage)).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('returns true if both STANDARD_ERROR_MSG and LIQUID_ERROR_MSG have errors', () => {
|
|
48
|
-
const errorMessage = {
|
|
49
|
-
STANDARD_ERROR_MSG: errorInGeneric,
|
|
50
|
-
LIQUID_ERROR_MSG: errorInAndroid,
|
|
51
|
-
};
|
|
52
|
-
expect(hasAnyErrors(errorMessage)).toBe(true);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('returns false if error groups are present but all arrays are empty', () => {
|
|
56
|
-
const errorMessage = {
|
|
57
|
-
STANDARD_ERROR_MSG: { ANDROID: [], IOS: [], GENERIC: [] },
|
|
58
|
-
LIQUID_ERROR_MSG: { ANDROID: [], IOS: [], GENERIC: [] },
|
|
59
|
-
};
|
|
60
|
-
expect(hasAnyErrors(errorMessage)).toBe(false);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('returns false if error groups are missing all platforms', () => {
|
|
64
|
-
const errorMessage = {
|
|
65
|
-
STANDARD_ERROR_MSG: {},
|
|
66
|
-
LIQUID_ERROR_MSG: {},
|
|
67
|
-
};
|
|
68
|
-
expect(hasAnyErrors(errorMessage)).toBe(false);
|
|
69
|
-
});
|
|
70
|
-
});
|