@capillarytech/creatives-library 8.0.290 → 8.0.292-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/constants/unified.js +3 -1
- package/initialState.js +0 -2
- package/package.json +1 -1
- package/utils/common.js +5 -8
- package/utils/commonUtils.js +4 -85
- package/utils/tagValidations.js +83 -223
- package/utils/tests/commonUtil.test.js +147 -124
- package/utils/tests/tagValidations.test.js +441 -358
- package/v2Components/CommonTestAndPreview/SendTestMessage.js +1 -33
- package/v2Components/CommonTestAndPreview/actions.js +0 -20
- package/v2Components/CommonTestAndPreview/constants.js +0 -10
- package/v2Components/CommonTestAndPreview/index.js +15 -133
- package/v2Components/CommonTestAndPreview/reducer.js +0 -47
- package/v2Components/CommonTestAndPreview/sagas.js +0 -60
- package/v2Components/CommonTestAndPreview/selectors.js +0 -51
- package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +0 -127
- package/v2Components/CommonTestAndPreview/tests/actions.test.js +0 -50
- package/v2Components/CommonTestAndPreview/tests/constants.test.js +0 -18
- package/v2Components/CommonTestAndPreview/tests/index.test.js +1 -214
- package/v2Components/CommonTestAndPreview/tests/reducer.test.js +0 -118
- package/v2Components/CommonTestAndPreview/tests/sagas.test.js +0 -145
- package/v2Components/CommonTestAndPreview/tests/selectors.test.js +0 -146
- package/v2Components/ErrorInfoNote/index.js +2 -5
- package/v2Components/FormBuilder/index.js +137 -203
- package/v2Components/FormBuilder/messages.js +0 -8
- package/v2Components/HtmlEditor/HTMLEditor.js +0 -5
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +0 -15
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +1 -2
- package/v2Components/TestAndPreviewSlidebox/index.js +0 -14
- package/v2Containers/Cap/mockData.js +0 -14
- package/v2Containers/Cap/reducer.js +3 -55
- package/v2Containers/Cap/tests/reducer.test.js +0 -102
- package/v2Containers/CreativesContainer/SlideBoxContent.js +5 -1
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -5
- package/v2Containers/CreativesContainer/index.js +38 -7
- package/v2Containers/Email/index.js +1 -5
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +23 -70
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +29 -137
- package/v2Containers/FTP/index.js +2 -51
- package/v2Containers/FTP/messages.js +0 -4
- package/v2Containers/InApp/index.js +4 -104
- package/v2Containers/InApp/tests/index.test.js +17 -6
- package/v2Containers/InappAdvance/index.js +4 -108
- package/v2Containers/InappAdvance/tests/index.test.js +2 -0
- package/v2Containers/Line/Container/Text/index.js +0 -1
- package/v2Containers/MobilePush/Create/index.js +42 -19
- package/v2Containers/MobilePush/Edit/index.js +42 -19
- package/v2Containers/MobilePushNew/index.js +12 -32
- package/v2Containers/MobilepushWrapper/index.js +3 -1
- package/v2Containers/Rcs/index.js +12 -37
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +12 -649
- package/v2Containers/Sms/Create/index.js +39 -3
- package/v2Containers/Sms/Create/messages.js +4 -0
- package/v2Containers/Sms/Edit/index.js +35 -3
- package/v2Containers/Sms/commonMethods.js +3 -6
- package/v2Containers/Sms/tests/commonMethods.test.js +122 -0
- package/v2Containers/SmsTrai/Edit/index.js +11 -47
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +6 -147
- package/v2Containers/SmsWrapper/index.js +2 -0
- package/v2Containers/Viber/index.js +0 -1
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +1 -3
- package/v2Containers/WebPush/Create/hooks/useTagManagement.test.js +0 -7
- package/v2Containers/WebPush/Create/index.js +2 -2
- package/v2Containers/WebPush/Create/utils/validation.js +17 -2
- package/v2Containers/WebPush/Create/utils/validation.test.js +59 -24
- package/v2Containers/Whatsapp/index.js +10 -18
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +4225 -26174
- package/v2Containers/Zalo/index.js +3 -11
- package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +0 -33
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +0 -397
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.scss +0 -35
- package/v2Components/CommonTestAndPreview/DeliverySettings/TECH_DETAILING_DELIVERY_SETTINGS.md +0 -725
- package/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +0 -92
- package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +0 -243
- package/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +0 -111
- package/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +0 -91
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +0 -782
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/index.test.js +0 -200
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/utils/parseSenderDetailsResponse.test.js +0 -235
|
@@ -25,17 +25,9 @@ import {
|
|
|
25
25
|
watchFetchTestGroups,
|
|
26
26
|
watchCreateMessageMeta,
|
|
27
27
|
watchGetPrefilledValues,
|
|
28
|
-
getSenderDetailsSaga,
|
|
29
|
-
getWeCrmAccountsSaga,
|
|
30
|
-
watchGetSenderDetails,
|
|
31
|
-
watchGetWeCrmAccounts,
|
|
32
28
|
commonTestAndPreviewSaga,
|
|
33
29
|
} from '../sagas';
|
|
34
30
|
import * as Api from '../../../services/api';
|
|
35
|
-
jest.mock('../DeliverySettings/utils/parseSenderDetailsResponse', () => ({
|
|
36
|
-
parseSenderDetailsResponse: jest.fn((channel, response) => ({ domains: response?.entity?.[channel] || [] })),
|
|
37
|
-
}));
|
|
38
|
-
import { parseSenderDetailsResponse } from '../DeliverySettings/utils/parseSenderDetailsResponse';
|
|
39
31
|
import {
|
|
40
32
|
SEARCH_CUSTOMERS_SUCCESS,
|
|
41
33
|
SEARCH_CUSTOMERS_FAILURE,
|
|
@@ -53,10 +45,6 @@ import {
|
|
|
53
45
|
CREATE_MESSAGE_META_FAILURE,
|
|
54
46
|
GET_PREFILLED_VALUES_SUCCESS,
|
|
55
47
|
GET_PREFILLED_VALUES_FAILURE,
|
|
56
|
-
GET_SENDER_DETAILS_SUCCESS,
|
|
57
|
-
GET_SENDER_DETAILS_FAILURE,
|
|
58
|
-
GET_WECRM_ACCOUNTS_SUCCESS,
|
|
59
|
-
GET_WECRM_ACCOUNTS_FAILURE,
|
|
60
48
|
} from '../constants';
|
|
61
49
|
|
|
62
50
|
describe('CommonTestAndPreview Sagas', () => {
|
|
@@ -1706,137 +1694,6 @@ describe('CommonTestAndPreview Sagas', () => {
|
|
|
1706
1694
|
);
|
|
1707
1695
|
expect(generator.next().done).toBe(true);
|
|
1708
1696
|
});
|
|
1709
|
-
|
|
1710
|
-
it('should watch for GET_SENDER_DETAILS_REQUESTED', () => {
|
|
1711
|
-
const generator = watchGetSenderDetails();
|
|
1712
|
-
expect(generator.next().value).toEqual(
|
|
1713
|
-
takeLatest('app/CommonTestAndPreview/GET_SENDER_DETAILS_REQUESTED', getSenderDetailsSaga)
|
|
1714
|
-
);
|
|
1715
|
-
expect(generator.next().done).toBe(true);
|
|
1716
|
-
});
|
|
1717
|
-
|
|
1718
|
-
it('should watch for GET_WECRM_ACCOUNTS_REQUESTED', () => {
|
|
1719
|
-
const generator = watchGetWeCrmAccounts();
|
|
1720
|
-
expect(generator.next().value).toEqual(
|
|
1721
|
-
takeLatest('app/CommonTestAndPreview/GET_WECRM_ACCOUNTS_REQUESTED', getWeCrmAccountsSaga)
|
|
1722
|
-
);
|
|
1723
|
-
expect(generator.next().done).toBe(true);
|
|
1724
|
-
});
|
|
1725
|
-
});
|
|
1726
|
-
|
|
1727
|
-
describe('getSenderDetailsSaga', () => {
|
|
1728
|
-
it('should fetch sender details and put SUCCESS with parsed domains', () => {
|
|
1729
|
-
const action = { payload: { channel: 'SMS', orgUnitId: 100 } };
|
|
1730
|
-
const apiResponse = { entity: { SMS: [{ id: 1, domainProperties: {} }] } };
|
|
1731
|
-
parseSenderDetailsResponse.mockReturnValue({ domains: [{ domainId: 1 }] });
|
|
1732
|
-
|
|
1733
|
-
const generator = getSenderDetailsSaga(action);
|
|
1734
|
-
|
|
1735
|
-
expect(generator.next().value).toEqual(call(Api.getSenderDetails, 'SMS', 100));
|
|
1736
|
-
expect(generator.next(apiResponse).value).toEqual(
|
|
1737
|
-
put({ type: GET_SENDER_DETAILS_SUCCESS, payload: { channel: 'SMS', domains: [{ domainId: 1 }] } })
|
|
1738
|
-
);
|
|
1739
|
-
expect(generator.next().done).toBe(true);
|
|
1740
|
-
});
|
|
1741
|
-
|
|
1742
|
-
it('should use orgUnitId -1 when not provided', () => {
|
|
1743
|
-
const action = { payload: { channel: 'EMAIL' } };
|
|
1744
|
-
const apiResponse = { entity: { EMAIL: [] } };
|
|
1745
|
-
parseSenderDetailsResponse.mockReturnValue({ domains: [] });
|
|
1746
|
-
|
|
1747
|
-
const generator = getSenderDetailsSaga(action);
|
|
1748
|
-
|
|
1749
|
-
expect(generator.next().value).toEqual(call(Api.getSenderDetails, 'EMAIL', -1));
|
|
1750
|
-
generator.next(apiResponse);
|
|
1751
|
-
expect(generator.next().done).toBe(true);
|
|
1752
|
-
});
|
|
1753
|
-
|
|
1754
|
-
it('should return early when channel is missing', () => {
|
|
1755
|
-
const action = { payload: {} };
|
|
1756
|
-
const generator = getSenderDetailsSaga(action);
|
|
1757
|
-
expect(generator.next().done).toBe(true);
|
|
1758
|
-
});
|
|
1759
|
-
|
|
1760
|
-
it('should put FAILURE when response has errors', () => {
|
|
1761
|
-
const action = { payload: { channel: 'SMS' } };
|
|
1762
|
-
const apiResponse = { errors: [{ message: 'Forbidden' }] };
|
|
1763
|
-
|
|
1764
|
-
const generator = getSenderDetailsSaga(action);
|
|
1765
|
-
generator.next();
|
|
1766
|
-
expect(generator.next(apiResponse).value).toEqual(
|
|
1767
|
-
put({
|
|
1768
|
-
type: GET_SENDER_DETAILS_FAILURE,
|
|
1769
|
-
payload: { channel: 'SMS', error: [{ message: 'Forbidden' }] },
|
|
1770
|
-
})
|
|
1771
|
-
);
|
|
1772
|
-
expect(generator.next().done).toBe(true);
|
|
1773
|
-
});
|
|
1774
|
-
|
|
1775
|
-
it('should put FAILURE on throw', () => {
|
|
1776
|
-
const action = { payload: { channel: 'WHATSAPP' } };
|
|
1777
|
-
const generator = getSenderDetailsSaga(action);
|
|
1778
|
-
generator.next();
|
|
1779
|
-
const err = generator.throw(new Error('Network error'));
|
|
1780
|
-
expect(err.value).toEqual(
|
|
1781
|
-
put({
|
|
1782
|
-
type: GET_SENDER_DETAILS_FAILURE,
|
|
1783
|
-
payload: { channel: 'WHATSAPP', error: 'Network error' },
|
|
1784
|
-
})
|
|
1785
|
-
);
|
|
1786
|
-
expect(generator.next().done).toBe(true);
|
|
1787
|
-
});
|
|
1788
|
-
});
|
|
1789
|
-
|
|
1790
|
-
describe('getWeCrmAccountsSaga', () => {
|
|
1791
|
-
it('should fetch wecrm accounts and put SUCCESS with list from response', () => {
|
|
1792
|
-
const action = { payload: { sourceName: 'WHATSAPP' } };
|
|
1793
|
-
const apiResult = { response: [{ name: 'WABA1', sourceAccountIdentifier: 'waba-1' }] };
|
|
1794
|
-
|
|
1795
|
-
const generator = getWeCrmAccountsSaga(action);
|
|
1796
|
-
|
|
1797
|
-
expect(generator.next().value).toEqual(call(Api.fetchWeCrmAccounts, 'WHATSAPP'));
|
|
1798
|
-
expect(generator.next(apiResult).value).toEqual(
|
|
1799
|
-
put({ type: GET_WECRM_ACCOUNTS_SUCCESS, payload: { accounts: [{ name: 'WABA1', sourceAccountIdentifier: 'waba-1' }] } })
|
|
1800
|
-
);
|
|
1801
|
-
expect(generator.next().done).toBe(true);
|
|
1802
|
-
});
|
|
1803
|
-
|
|
1804
|
-
it('should use WHATSAPP when sourceName not provided', () => {
|
|
1805
|
-
const action = { payload: {} };
|
|
1806
|
-
const generator = getWeCrmAccountsSaga(action);
|
|
1807
|
-
expect(generator.next().value).toEqual(call(Api.fetchWeCrmAccounts, 'WHATSAPP'));
|
|
1808
|
-
});
|
|
1809
|
-
|
|
1810
|
-
it('should use entity when response not present', () => {
|
|
1811
|
-
const action = { payload: {} };
|
|
1812
|
-
const apiResult = { entity: [{ name: 'Acc1' }] };
|
|
1813
|
-
|
|
1814
|
-
const generator = getWeCrmAccountsSaga(action);
|
|
1815
|
-
generator.next();
|
|
1816
|
-
expect(generator.next(apiResult).value).toEqual(
|
|
1817
|
-
put({ type: GET_WECRM_ACCOUNTS_SUCCESS, payload: { accounts: [{ name: 'Acc1' }] } })
|
|
1818
|
-
);
|
|
1819
|
-
});
|
|
1820
|
-
|
|
1821
|
-
it('should put empty array when result has no list', () => {
|
|
1822
|
-
const action = { payload: {} };
|
|
1823
|
-
const generator = getWeCrmAccountsSaga(action);
|
|
1824
|
-
generator.next();
|
|
1825
|
-
expect(generator.next({}).value).toEqual(
|
|
1826
|
-
put({ type: GET_WECRM_ACCOUNTS_SUCCESS, payload: { accounts: [] } })
|
|
1827
|
-
);
|
|
1828
|
-
});
|
|
1829
|
-
|
|
1830
|
-
it('should put FAILURE on throw', () => {
|
|
1831
|
-
const action = { payload: {} };
|
|
1832
|
-
const generator = getWeCrmAccountsSaga(action);
|
|
1833
|
-
generator.next();
|
|
1834
|
-
const err = generator.throw(new Error('API failed'));
|
|
1835
|
-
expect(err.value).toEqual(
|
|
1836
|
-
put({ type: GET_WECRM_ACCOUNTS_FAILURE, payload: { error: 'API failed' } })
|
|
1837
|
-
);
|
|
1838
|
-
expect(generator.next().done).toBe(true);
|
|
1839
|
-
});
|
|
1840
1697
|
});
|
|
1841
1698
|
|
|
1842
1699
|
describe('commonTestAndPreviewSaga', () => {
|
|
@@ -1853,8 +1710,6 @@ describe('CommonTestAndPreview Sagas', () => {
|
|
|
1853
1710
|
watchFetchTestGroups(),
|
|
1854
1711
|
watchCreateMessageMeta(),
|
|
1855
1712
|
watchGetPrefilledValues(),
|
|
1856
|
-
watchGetSenderDetails(),
|
|
1857
|
-
watchGetWeCrmAccounts(),
|
|
1858
1713
|
])
|
|
1859
1714
|
);
|
|
1860
1715
|
|
|
@@ -32,12 +32,6 @@ import {
|
|
|
32
32
|
makeSelectUpdatePreviewErrors,
|
|
33
33
|
makeSelectFetchPrefilledValuesError,
|
|
34
34
|
makeSelectFetchPrefilledValuesErrors,
|
|
35
|
-
makeSelectSenderDetailsForChannel,
|
|
36
|
-
makeSelectSenderDetailsByChannel,
|
|
37
|
-
makeSelectWeCrmAccounts,
|
|
38
|
-
makeSelectIsLoadingSenderDetails,
|
|
39
|
-
makeSelectFetchSenderDetailsError,
|
|
40
|
-
makeSelectFetchWeCrmAccountsError,
|
|
41
35
|
} from '../selectors';
|
|
42
36
|
|
|
43
37
|
describe('CommonTestAndPreview Selectors', () => {
|
|
@@ -107,19 +101,6 @@ describe('CommonTestAndPreview Selectors', () => {
|
|
|
107
101
|
fetchPrefilledValuesErrors: [
|
|
108
102
|
{ code: 7078, message: 'User profile not found' },
|
|
109
103
|
],
|
|
110
|
-
senderDetailsByChannel: {
|
|
111
|
-
SMS: [
|
|
112
|
-
{ domainId: 1, domainName: 'SMS Domain', gsmSenders: [{ value: 'sender1' }] },
|
|
113
|
-
],
|
|
114
|
-
EMAIL: [],
|
|
115
|
-
WHATSAPP: [],
|
|
116
|
-
},
|
|
117
|
-
wecrmAccounts: [
|
|
118
|
-
{ name: 'WeCRM Account 1', sourceAccountIdentifier: 'waba-1' },
|
|
119
|
-
],
|
|
120
|
-
isLoadingSenderDetails: false,
|
|
121
|
-
fetchSenderDetailsError: null,
|
|
122
|
-
fetchWeCrmAccountsError: null,
|
|
123
104
|
},
|
|
124
105
|
});
|
|
125
106
|
|
|
@@ -569,133 +550,6 @@ describe('CommonTestAndPreview Selectors', () => {
|
|
|
569
550
|
});
|
|
570
551
|
});
|
|
571
552
|
|
|
572
|
-
describe('makeSelectSenderDetailsForChannel', () => {
|
|
573
|
-
it('should select sender details for given channel as JS array', () => {
|
|
574
|
-
const selector = makeSelectSenderDetailsForChannel('SMS');
|
|
575
|
-
const result = selector(mockState);
|
|
576
|
-
|
|
577
|
-
expect(result).toBeDefined();
|
|
578
|
-
expect(Array.isArray(result)).toBe(true);
|
|
579
|
-
expect(result.length).toBe(1);
|
|
580
|
-
expect(result[0].domainName).toBe('SMS Domain');
|
|
581
|
-
});
|
|
582
|
-
|
|
583
|
-
it('should return empty array for channel with no data', () => {
|
|
584
|
-
const selector = makeSelectSenderDetailsForChannel('EMAIL');
|
|
585
|
-
const result = selector(mockState);
|
|
586
|
-
|
|
587
|
-
expect(result).toEqual([]);
|
|
588
|
-
});
|
|
589
|
-
|
|
590
|
-
it('should return empty array when substate or byChannel missing', () => {
|
|
591
|
-
const emptyState = fromJS({});
|
|
592
|
-
const selector = makeSelectSenderDetailsForChannel('SMS');
|
|
593
|
-
const result = selector(emptyState);
|
|
594
|
-
|
|
595
|
-
expect(result).toEqual([]);
|
|
596
|
-
});
|
|
597
|
-
});
|
|
598
|
-
|
|
599
|
-
describe('makeSelectSenderDetailsByChannel', () => {
|
|
600
|
-
it('should select senderDetailsByChannel and convert to JS object', () => {
|
|
601
|
-
const selector = makeSelectSenderDetailsByChannel();
|
|
602
|
-
const result = selector(mockState);
|
|
603
|
-
|
|
604
|
-
expect(result).toBeDefined();
|
|
605
|
-
expect(result.SMS).toBeDefined();
|
|
606
|
-
expect(Array.isArray(result.SMS)).toBe(true);
|
|
607
|
-
expect(result.SMS[0].domainName).toBe('SMS Domain');
|
|
608
|
-
expect(result.EMAIL).toEqual([]);
|
|
609
|
-
expect(result.WHATSAPP).toEqual([]);
|
|
610
|
-
});
|
|
611
|
-
|
|
612
|
-
it('should return empty object when domain is missing', () => {
|
|
613
|
-
const emptyState = fromJS({});
|
|
614
|
-
const selector = makeSelectSenderDetailsByChannel();
|
|
615
|
-
const result = selector(emptyState);
|
|
616
|
-
|
|
617
|
-
expect(result).toEqual({});
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
describe('makeSelectWeCrmAccounts', () => {
|
|
622
|
-
it('should select wecrmAccounts and convert to JS array', () => {
|
|
623
|
-
const selector = makeSelectWeCrmAccounts();
|
|
624
|
-
const result = selector(mockState);
|
|
625
|
-
|
|
626
|
-
expect(result).toBeDefined();
|
|
627
|
-
expect(Array.isArray(result)).toBe(true);
|
|
628
|
-
expect(result.length).toBe(1);
|
|
629
|
-
expect(result[0].name).toBe('WeCRM Account 1');
|
|
630
|
-
expect(result[0].sourceAccountIdentifier).toBe('waba-1');
|
|
631
|
-
});
|
|
632
|
-
|
|
633
|
-
it('should return empty array when wecrmAccounts is missing', () => {
|
|
634
|
-
const emptyState = fromJS({ commonTestAndPreview: {} });
|
|
635
|
-
const selector = makeSelectWeCrmAccounts();
|
|
636
|
-
const result = selector(emptyState);
|
|
637
|
-
|
|
638
|
-
expect(result).toEqual([]);
|
|
639
|
-
});
|
|
640
|
-
});
|
|
641
|
-
|
|
642
|
-
describe('makeSelectIsLoadingSenderDetails', () => {
|
|
643
|
-
it('should select isLoadingSenderDetails flag', () => {
|
|
644
|
-
const selector = makeSelectIsLoadingSenderDetails();
|
|
645
|
-
const result = selector(mockState);
|
|
646
|
-
|
|
647
|
-
expect(result).toBe(false);
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
it('should return true when loading', () => {
|
|
651
|
-
const loadingState = fromJS({
|
|
652
|
-
commonTestAndPreview: { isLoadingSenderDetails: true },
|
|
653
|
-
});
|
|
654
|
-
const selector = makeSelectIsLoadingSenderDetails();
|
|
655
|
-
const result = selector(loadingState);
|
|
656
|
-
|
|
657
|
-
expect(result).toBe(true);
|
|
658
|
-
});
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
describe('makeSelectFetchSenderDetailsError', () => {
|
|
662
|
-
it('should select fetchSenderDetailsError from state', () => {
|
|
663
|
-
const selector = makeSelectFetchSenderDetailsError();
|
|
664
|
-
const result = selector(mockState);
|
|
665
|
-
|
|
666
|
-
expect(result).toBeNull();
|
|
667
|
-
});
|
|
668
|
-
|
|
669
|
-
it('should return error when present', () => {
|
|
670
|
-
const errorState = fromJS({
|
|
671
|
-
commonTestAndPreview: { fetchSenderDetailsError: 'Sender fetch failed' },
|
|
672
|
-
});
|
|
673
|
-
const selector = makeSelectFetchSenderDetailsError();
|
|
674
|
-
const result = selector(errorState);
|
|
675
|
-
|
|
676
|
-
expect(result).toBe('Sender fetch failed');
|
|
677
|
-
});
|
|
678
|
-
});
|
|
679
|
-
|
|
680
|
-
describe('makeSelectFetchWeCrmAccountsError', () => {
|
|
681
|
-
it('should select fetchWeCrmAccountsError from state', () => {
|
|
682
|
-
const selector = makeSelectFetchWeCrmAccountsError();
|
|
683
|
-
const result = selector(mockState);
|
|
684
|
-
|
|
685
|
-
expect(result).toBeNull();
|
|
686
|
-
});
|
|
687
|
-
|
|
688
|
-
it('should return error when present', () => {
|
|
689
|
-
const errorState = fromJS({
|
|
690
|
-
commonTestAndPreview: { fetchWeCrmAccountsError: 'WeCRM fetch failed' },
|
|
691
|
-
});
|
|
692
|
-
const selector = makeSelectFetchWeCrmAccountsError();
|
|
693
|
-
const result = selector(errorState);
|
|
694
|
-
|
|
695
|
-
expect(result).toBe('WeCRM fetch failed');
|
|
696
|
-
});
|
|
697
|
-
});
|
|
698
|
-
|
|
699
553
|
describe('Edge Cases', () => {
|
|
700
554
|
it('should handle undefined state gracefully', () => {
|
|
701
555
|
const selector = makeSelectCustomers();
|
|
@@ -186,7 +186,6 @@ export const ErrorInfoNote = (props) => {
|
|
|
186
186
|
errorMessages,
|
|
187
187
|
onErrorClick,
|
|
188
188
|
onClose,
|
|
189
|
-
isLiquidEnabled = true,
|
|
190
189
|
intl,
|
|
191
190
|
useLegacyDisplay = false, // Use simple list display instead of tabs (for BEE Editor)
|
|
192
191
|
} = props;
|
|
@@ -230,7 +229,7 @@ export const ErrorInfoNote = (props) => {
|
|
|
230
229
|
const standardErrors = Array.isArray(rawStandardErrors) ? rawStandardErrors : [];
|
|
231
230
|
const liquidErrors = Array.isArray(rawLiquidErrors) ? rawLiquidErrors : [];
|
|
232
231
|
const hasStandardErrors = standardErrors.length > 0;
|
|
233
|
-
const hasLiquidErrors = liquidErrors.length > 0
|
|
232
|
+
const hasLiquidErrors = liquidErrors.length > 0;
|
|
234
233
|
|
|
235
234
|
if (!hasStandardErrors && !hasLiquidErrors) {
|
|
236
235
|
return null;
|
|
@@ -357,7 +356,7 @@ export const ErrorInfoNote = (props) => {
|
|
|
357
356
|
className="error-info-note__tabs"
|
|
358
357
|
/>
|
|
359
358
|
<CapRow className="error-info-note__actions">
|
|
360
|
-
{hasLiquidErrors &&
|
|
359
|
+
{hasLiquidErrors && (
|
|
361
360
|
<CapButton
|
|
362
361
|
type="flat"
|
|
363
362
|
className="error-info-note__liquid-doc"
|
|
@@ -452,7 +451,6 @@ ErrorInfoNote.defaultProps = {
|
|
|
452
451
|
},
|
|
453
452
|
onErrorClick: null,
|
|
454
453
|
onClose: null,
|
|
455
|
-
isLiquidEnabled: true,
|
|
456
454
|
intl: null,
|
|
457
455
|
useLegacyDisplay: false, // Use simple list display for BEE Editor
|
|
458
456
|
};
|
|
@@ -479,7 +477,6 @@ ErrorInfoNote.propTypes = {
|
|
|
479
477
|
}),
|
|
480
478
|
onErrorClick: PropTypes.func,
|
|
481
479
|
onClose: PropTypes.func,
|
|
482
|
-
isLiquidEnabled: PropTypes.bool,
|
|
483
480
|
intl: PropTypes.object,
|
|
484
481
|
useLegacyDisplay: PropTypes.bool, // Use simple list display for BEE Editor
|
|
485
482
|
};
|