@capillarytech/creatives-library 9.0.28 → 9.0.29-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/constants/unified.js +29 -0
- package/global-styles.js +1 -1
- package/package.json +1 -1
- package/services/tests/api.test.js +35 -20
- package/utils/commonUtils.js +22 -1
- package/utils/rcsPayloadUtils.js +102 -0
- package/utils/templateVarUtils.js +198 -0
- package/utils/tests/rcsPayloadUtils.test.js +295 -0
- package/utils/tests/templateVarUtils.test.js +204 -0
- package/v2Components/CapActionButton/constants.js +21 -1
- package/v2Components/CapActionButton/index.js +260 -144
- package/v2Components/CapActionButton/index.scss +245 -14
- package/v2Components/CapActionButton/messages.js +32 -3
- package/v2Components/CapActionButton/tests/index.test.js +74 -19
- package/v2Components/CapImageUpload/index.js +2 -2
- package/v2Components/CapTagList/index.js +9 -0
- package/v2Components/CommonTestAndPreview/CustomValuesEditor.js +70 -48
- package/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +8 -2
- package/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +214 -21
- package/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +16 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/index.js +83 -9
- package/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +30 -0
- package/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +58 -11
- package/v2Components/CommonTestAndPreview/SendTestMessage.js +10 -5
- package/v2Components/CommonTestAndPreview/UnifiedPreview/RcsPreviewContent.js +186 -22
- package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +381 -80
- package/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +155 -8
- package/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +11 -0
- package/v2Components/CommonTestAndPreview/constants.js +35 -2
- package/v2Components/CommonTestAndPreview/index.js +770 -231
- package/v2Components/CommonTestAndPreview/messages.js +45 -3
- package/v2Components/CommonTestAndPreview/previewApiUtils.js +59 -0
- package/v2Components/CommonTestAndPreview/sagas.js +25 -6
- package/v2Components/CommonTestAndPreview/tests/CommonTestAndPreview.addTestCustomer.test.js +1 -0
- package/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +412 -257
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +337 -63
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/index.test.js +118 -5
- package/v2Components/CommonTestAndPreview/tests/DeliverySettings/utils/parseSenderDetailsResponse.test.js +341 -0
- package/v2Components/CommonTestAndPreview/tests/PreviewSection.test.js +8 -1
- package/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +108 -15
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/RcsPreviewContent.test.js +281 -283
- package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +199 -1
- package/v2Components/CommonTestAndPreview/tests/index.test.js +133 -4
- package/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +67 -0
- package/v2Components/CommonTestAndPreview/tests/sagas.test.js +31 -24
- package/v2Components/CommonTestAndPreview/tests/utils.test.js +151 -0
- package/v2Components/CommonTestAndPreview/utils.js +84 -0
- package/v2Components/SmsFallback/SmsFallbackLocalSelector.js +91 -0
- package/v2Components/SmsFallback/constants.js +94 -0
- package/v2Components/SmsFallback/index.js +958 -0
- package/v2Components/SmsFallback/index.scss +266 -0
- package/v2Components/SmsFallback/messages.js +78 -0
- package/v2Components/SmsFallback/smsFallbackUtils.js +120 -0
- package/v2Components/SmsFallback/tests/SmsFallbackLocalSelector.test.js +50 -0
- package/v2Components/SmsFallback/tests/rcsSmsFallback.acceptance.test.js +147 -0
- package/v2Components/SmsFallback/tests/smsFallbackHandlers.test.js +304 -0
- package/v2Components/SmsFallback/tests/smsFallbackUi.test.js +208 -0
- package/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +309 -0
- package/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +471 -0
- package/v2Components/SmsFallback/useLocalTemplateList.js +92 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +45 -25
- package/v2Components/TemplatePreview/constants.js +2 -0
- package/v2Components/TemplatePreview/index.js +147 -32
- package/v2Components/TemplatePreview/tests/index.test.js +142 -0
- package/v2Components/TestAndPreviewSlidebox/CustomValuesEditor.js +6 -6
- package/v2Components/TestAndPreviewSlidebox/index.js +13 -1
- package/v2Components/TestAndPreviewSlidebox/sagas.js +11 -4
- package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +3 -1
- package/v2Components/VarSegmentMessageEditor/constants.js +2 -0
- package/v2Components/VarSegmentMessageEditor/index.js +125 -0
- package/v2Components/VarSegmentMessageEditor/index.scss +46 -0
- package/v2Containers/CommunicationFlow/Tests/CommunicationFlow.test.js +4 -1
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/DeliverySettingsSection.test.js +4 -0
- package/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/SenderDetails.test.js +20 -20
- package/v2Containers/CreativesContainer/CreativesSlideBoxWrapper.js +27 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +37 -4
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +14 -5
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +36 -5
- package/v2Containers/CreativesContainer/constants.js +11 -0
- package/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +77 -0
- package/v2Containers/CreativesContainer/index.js +328 -106
- package/v2Containers/CreativesContainer/index.scss +102 -1
- package/v2Containers/CreativesContainer/tests/CreativesSlideBoxWrapper.test.js +58 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +90 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.smsDltPreview.test.js +73 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +37 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +103 -34
- package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +193 -15
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +88 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +549 -57
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +20 -15
- package/v2Containers/CreativesContainer/tests/embeddedSlideboxUtils.test.js +258 -0
- package/v2Containers/CreativesContainer/tests/index.test.js +71 -9
- package/v2Containers/CreativesContainer/tests/useLocalTemplatesProp.test.js +125 -0
- package/v2Containers/Email/index.js +3 -63
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +4 -9
- package/v2Containers/MobilePush/Create/test/saga.test.js +2 -2
- package/v2Containers/Rcs/carouselUtils.js +224 -0
- package/v2Containers/Rcs/components/CarouselCard.js +317 -0
- package/v2Containers/Rcs/components/CarouselCardButtons.js +113 -0
- package/v2Containers/Rcs/components/CarouselCardMedia.js +136 -0
- package/v2Containers/Rcs/components/CarouselCharacterCount.js +31 -0
- package/v2Containers/Rcs/components/CarouselDimensionSelection.js +80 -0
- package/v2Containers/Rcs/constants.js +132 -16
- package/v2Containers/Rcs/index.js +1808 -949
- package/v2Containers/Rcs/index.scss +443 -8
- package/v2Containers/Rcs/messages.js +45 -22
- package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +484 -0
- package/v2Containers/Rcs/tests/CarouselCard.test.js +464 -0
- package/v2Containers/Rcs/tests/CarouselCardButtons.test.js +211 -0
- package/v2Containers/Rcs/tests/CarouselCardMedia.test.js +160 -0
- package/v2Containers/Rcs/tests/CarouselCharacterCount.test.js +50 -0
- package/v2Containers/Rcs/tests/CarouselDimensionSelection.test.js +119 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +74176 -39409
- package/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +10 -74
- package/v2Containers/Rcs/tests/carouselUtils.test.js +916 -0
- package/v2Containers/Rcs/tests/index.test.js +219 -40
- package/v2Containers/Rcs/tests/mockData.js +38 -0
- package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +873 -0
- package/v2Containers/Rcs/tests/utils.test.js +682 -30
- package/v2Containers/Rcs/utils.js +514 -12
- package/v2Containers/Sms/Create/index.js +115 -48
- package/v2Containers/Sms/smsFormDataHelpers.js +67 -0
- package/v2Containers/Sms/tests/smsFormDataHelpers.test.js +253 -0
- package/v2Containers/SmsTrai/Create/index.js +9 -4
- package/v2Containers/SmsTrai/Edit/constants.js +2 -0
- package/v2Containers/SmsTrai/Edit/index.js +678 -169
- package/v2Containers/SmsTrai/Edit/index.scss +126 -0
- package/v2Containers/SmsTrai/Edit/messages.js +14 -4
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +5615 -3014
- package/v2Containers/SmsWrapper/index.js +37 -8
- package/v2Containers/TagList/index.js +5 -0
- package/v2Containers/Templates/TemplatesActionBar.js +101 -0
- package/v2Containers/Templates/_templates.scss +196 -12
- package/v2Containers/Templates/actions.js +11 -0
- package/v2Containers/Templates/constants.js +2 -0
- package/v2Containers/Templates/index.js +131 -59
- package/v2Containers/Templates/sagas.js +57 -13
- package/v2Containers/Templates/tests/TemplatesActionBar.test.js +129 -0
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1060 -1015
- package/v2Containers/Templates/tests/sagas.test.js +199 -16
- package/v2Containers/Templates/tests/smsTemplatesListApi.test.js +180 -0
- package/v2Containers/Templates/utils/smsTemplatesListApi.js +79 -0
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +72 -1
- package/v2Containers/TemplatesV2/index.js +88 -25
- package/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +131 -0
- package/v2Containers/WeChat/MapTemplates/test/saga.test.js +9 -9
- package/v2Containers/Whatsapp/index.js +3 -20
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +578 -34
|
@@ -3,6 +3,7 @@ import { shallowWithIntl } from '../../../helpers/intl-enzym-test-helpers';
|
|
|
3
3
|
|
|
4
4
|
import { SlideBoxHeader } from '../SlideBoxHeader';
|
|
5
5
|
import mockdata from '../../mockdata';
|
|
6
|
+
import { MAP_TEMPLATE } from '../../WeChat/Wrapper/constants';
|
|
6
7
|
|
|
7
8
|
const { whatsappEditTemplateData, rcsEditTemplateData, whatsappPreviewTemplateData, rcsPreviewTemplateData,zaloEditTemplateData } = mockdata;
|
|
8
9
|
|
|
@@ -11,6 +12,12 @@ jest.mock("../../../v2Components/FormBuilder", () => ({
|
|
|
11
12
|
default: (props) => <div className="FormBuilder-mock" {...props}>FormBuilder</div>,
|
|
12
13
|
}));
|
|
13
14
|
|
|
15
|
+
jest.mock('../../../utils/common', () => ({
|
|
16
|
+
...jest.requireActual('../../../utils/common'),
|
|
17
|
+
isTraiDLTEnable: jest.fn(),
|
|
18
|
+
}));
|
|
19
|
+
const { isTraiDLTEnable } = require('../../../utils/common');
|
|
20
|
+
|
|
14
21
|
describe('Test SlideBoxHeader container', () => {
|
|
15
22
|
const onCreateComplete = jest.fn();
|
|
16
23
|
let renderedComponent;
|
|
@@ -73,48 +80,219 @@ describe('Test SlideBoxHeader container', () => {
|
|
|
73
80
|
expect(renderedComponent).toMatchSnapshot();
|
|
74
81
|
});
|
|
75
82
|
|
|
76
|
-
it('
|
|
83
|
+
it('renders templateNameRenderProp when isFullMode and shouldShowTemplateName are both true', () => {
|
|
84
|
+
const templateNameRenderProp = jest.fn().mockReturnValue(null);
|
|
85
|
+
renderedComponent = shallowWithIntl(
|
|
86
|
+
<SlideBoxHeader
|
|
87
|
+
slidBoxContent="editTemplate"
|
|
88
|
+
channel="SMS"
|
|
89
|
+
templateData={{ name: 'My Template' }}
|
|
90
|
+
onCreateComplete={onCreateComplete}
|
|
91
|
+
isFullMode
|
|
92
|
+
shouldShowTemplateName
|
|
93
|
+
templateNameRenderProp={templateNameRenderProp}
|
|
94
|
+
moduleType="journey"
|
|
95
|
+
/>
|
|
96
|
+
);
|
|
97
|
+
expect(templateNameRenderProp).toHaveBeenCalled();
|
|
98
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('does not call templateNameRenderProp when isFullMode is false (showTemplateNameHeader=false)', () => {
|
|
102
|
+
const templateNameRenderProp = jest.fn().mockReturnValue(null);
|
|
77
103
|
renderedComponent = shallowWithIntl(
|
|
78
104
|
<SlideBoxHeader
|
|
79
105
|
slidBoxContent="editTemplate"
|
|
80
|
-
channel="
|
|
81
|
-
templateData={{ name: '
|
|
106
|
+
channel="SMS"
|
|
107
|
+
templateData={{ name: 'My Template' }}
|
|
82
108
|
onCreateComplete={onCreateComplete}
|
|
83
109
|
isFullMode={false}
|
|
110
|
+
shouldShowTemplateName
|
|
111
|
+
templateNameRenderProp={templateNameRenderProp}
|
|
84
112
|
moduleType="journey"
|
|
85
113
|
/>
|
|
86
114
|
);
|
|
115
|
+
expect(templateNameRenderProp).not.toHaveBeenCalled();
|
|
87
116
|
expect(renderedComponent).toMatchSnapshot();
|
|
88
117
|
});
|
|
89
118
|
|
|
90
|
-
it('
|
|
119
|
+
it('does not call templateNameRenderProp when shouldShowTemplateName is false (showTemplateNameHeader=false)', () => {
|
|
120
|
+
const templateNameRenderProp = jest.fn().mockReturnValue(null);
|
|
91
121
|
renderedComponent = shallowWithIntl(
|
|
92
122
|
<SlideBoxHeader
|
|
93
|
-
slidBoxContent="
|
|
94
|
-
channel="
|
|
95
|
-
templateData={{}}
|
|
123
|
+
slidBoxContent="editTemplate"
|
|
124
|
+
channel="SMS"
|
|
125
|
+
templateData={{ name: 'My Template' }}
|
|
126
|
+
onCreateComplete={onCreateComplete}
|
|
127
|
+
isFullMode
|
|
128
|
+
shouldShowTemplateName={false}
|
|
129
|
+
templateNameRenderProp={templateNameRenderProp}
|
|
130
|
+
moduleType="journey"
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
133
|
+
expect(templateNameRenderProp).not.toHaveBeenCalled();
|
|
134
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('shows edit header for InApp edit without fullMode (shouldShowInAppEditHeader=true)', () => {
|
|
138
|
+
renderedComponent = shallowWithIntl(
|
|
139
|
+
<SlideBoxHeader
|
|
140
|
+
slidBoxContent="editTemplate"
|
|
141
|
+
channel="inapp"
|
|
142
|
+
templateData={{ name: 'InApp Tpl' }}
|
|
96
143
|
onCreateComplete={onCreateComplete}
|
|
97
144
|
isFullMode={false}
|
|
98
145
|
moduleType="journey"
|
|
99
|
-
templateStep="modeSelection"
|
|
100
146
|
/>
|
|
101
147
|
);
|
|
102
148
|
expect(renderedComponent).toMatchSnapshot();
|
|
103
149
|
});
|
|
104
150
|
|
|
105
|
-
it('
|
|
151
|
+
it('hides edit header for InApp edit with fullMode (shouldShowInAppEditHeader=false, isInAppCreate guard)', () => {
|
|
106
152
|
renderedComponent = shallowWithIntl(
|
|
107
153
|
<SlideBoxHeader
|
|
108
|
-
slidBoxContent="
|
|
109
|
-
channel="
|
|
110
|
-
templateData={{}}
|
|
154
|
+
slidBoxContent="editTemplate"
|
|
155
|
+
channel="inapp"
|
|
156
|
+
templateData={{ name: 'InApp Tpl' }}
|
|
157
|
+
onCreateComplete={onCreateComplete}
|
|
158
|
+
isFullMode
|
|
159
|
+
moduleType="journey"
|
|
160
|
+
/>
|
|
161
|
+
);
|
|
162
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('renders whatsappOverview=true header when WHATSAPP edit in fullMode', () => {
|
|
166
|
+
renderedComponent = shallowWithIntl(
|
|
167
|
+
<SlideBoxHeader
|
|
168
|
+
slidBoxContent="editTemplate"
|
|
169
|
+
channel="WHATSAPP"
|
|
170
|
+
templateData={whatsappEditTemplateData}
|
|
171
|
+
onCreateComplete={onCreateComplete}
|
|
172
|
+
isFullMode
|
|
173
|
+
moduleType="journey"
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('renders whatsappOverview=false header when WHATSAPP edit without fullMode', () => {
|
|
180
|
+
renderedComponent = shallowWithIntl(
|
|
181
|
+
<SlideBoxHeader
|
|
182
|
+
slidBoxContent="editTemplate"
|
|
183
|
+
channel="WHATSAPP"
|
|
184
|
+
templateData={whatsappEditTemplateData}
|
|
111
185
|
onCreateComplete={onCreateComplete}
|
|
112
186
|
isFullMode={false}
|
|
113
187
|
moduleType="journey"
|
|
114
|
-
|
|
188
|
+
/>
|
|
189
|
+
);
|
|
190
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('opens the WhatsApp help doc in a new tab when the learn-tips link is clicked', () => {
|
|
194
|
+
const openSpy = jest.spyOn(window, 'open').mockImplementation(() => {});
|
|
195
|
+
const { WHATSAPP_HELP_DOC_LINK } = require('../constants');
|
|
196
|
+
|
|
197
|
+
renderFunction("WHATSAPP", "createTemplate", { mode: "create" });
|
|
198
|
+
renderedComponent.find('CapLink').prop('onClick')();
|
|
199
|
+
|
|
200
|
+
expect(openSpy).toHaveBeenCalledWith(WHATSAPP_HELP_DOC_LINK, '_blank');
|
|
201
|
+
openSpy.mockRestore();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('shows the RCS creative name label when RCS edit is not in fullMode and a templateName is present', () => {
|
|
205
|
+
renderFunction("RCS", "editTemplate", { name: "RCS Creative Name" }, false);
|
|
206
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('shows the back-icon prefix in the editTemplate header when not fullMode and showPrefix is true', () => {
|
|
210
|
+
renderedComponent = shallowWithIntl(
|
|
211
|
+
<SlideBoxHeader
|
|
212
|
+
slidBoxContent="editTemplate"
|
|
213
|
+
channel="SMS"
|
|
214
|
+
templateData={{ name: 'SMS Template' }}
|
|
215
|
+
isFullMode={false}
|
|
216
|
+
showPrefix
|
|
217
|
+
moduleType="journey"
|
|
218
|
+
/>
|
|
219
|
+
);
|
|
220
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('evaluates useLocalTemplates for the back button when moduleType is not JOURNEY', () => {
|
|
224
|
+
renderedComponent = shallowWithIntl(
|
|
225
|
+
<SlideBoxHeader
|
|
226
|
+
slidBoxContent="templates"
|
|
227
|
+
channel="SMS"
|
|
228
|
+
isFullMode={false}
|
|
229
|
+
useLocalTemplates
|
|
230
|
+
/>
|
|
231
|
+
);
|
|
232
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
describe('createTemplate header (modeSelection step)', () => {
|
|
236
|
+
afterEach(() => {
|
|
237
|
+
isTraiDLTEnable.mockReset();
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it('uses the TRAI SMS upload title when isTraiDLTEnable is true for an SMS channel', () => {
|
|
241
|
+
isTraiDLTEnable.mockReturnValue(true);
|
|
242
|
+
renderedComponent = shallowWithIntl(
|
|
243
|
+
<SlideBoxHeader
|
|
244
|
+
slidBoxContent="createTemplate"
|
|
245
|
+
channel="SMS"
|
|
246
|
+
templateStep="modeSelection"
|
|
247
|
+
isFullMode={false}
|
|
248
|
+
showPrefix
|
|
249
|
+
templateData={{ mode: 'create' }}
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
252
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('uses the regular createMessageContent title when isTraiDLTEnable is false', () => {
|
|
256
|
+
isTraiDLTEnable.mockReturnValue(false);
|
|
257
|
+
renderedComponent = shallowWithIntl(
|
|
258
|
+
<SlideBoxHeader
|
|
259
|
+
slidBoxContent="createTemplate"
|
|
260
|
+
channel="WHATSAPP"
|
|
261
|
+
templateStep="modeSelection"
|
|
262
|
+
isFullMode={false}
|
|
263
|
+
templateData={{ mode: 'create' }}
|
|
264
|
+
/>
|
|
265
|
+
);
|
|
266
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('renders the createTemplate header via the createTemplateContent step when weChatTemplateType is not MAP_TEMPLATE', () => {
|
|
271
|
+
renderedComponent = shallowWithIntl(
|
|
272
|
+
<SlideBoxHeader
|
|
273
|
+
slidBoxContent="createTemplate"
|
|
274
|
+
channel="RCS"
|
|
115
275
|
templateStep="createTemplateContent"
|
|
116
|
-
|
|
117
|
-
|
|
276
|
+
weChatTemplateType={undefined}
|
|
277
|
+
isFullMode={false}
|
|
278
|
+
templateData={{ mode: 'create' }}
|
|
279
|
+
/>
|
|
280
|
+
);
|
|
281
|
+
expect(renderedComponent).toMatchSnapshot();
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('renders the WeChat map-template creation stepper when weChatTemplateType is MAP_TEMPLATE and templateStep is not modeSelection', () => {
|
|
285
|
+
const onWeChatMaptemplateStepChange = jest.fn();
|
|
286
|
+
renderedComponent = shallowWithIntl(
|
|
287
|
+
<SlideBoxHeader
|
|
288
|
+
slidBoxContent="createTemplate"
|
|
289
|
+
channel="WECHAT"
|
|
290
|
+
templateStep="addContent"
|
|
291
|
+
weChatTemplateType={MAP_TEMPLATE}
|
|
292
|
+
weChatMaptemplateStep={1}
|
|
293
|
+
onWeChatMaptemplateStepChange={onWeChatMaptemplateStepChange}
|
|
294
|
+
isFullMode={false}
|
|
295
|
+
templateData={{ mode: 'create' }}
|
|
118
296
|
/>
|
|
119
297
|
);
|
|
120
298
|
expect(renderedComponent).toMatchSnapshot();
|
|
@@ -204,6 +204,61 @@ exports[`Test SlideBoxContent container Email component isTestAndPreviewMode IIF
|
|
|
204
204
|
</SlideBoxContent__CreativesWrapper>
|
|
205
205
|
`;
|
|
206
206
|
|
|
207
|
+
exports[`Test SlideBoxContent container Email component isTestAndPreviewMode IIFE renders the direct Email component for a BEE (drag-drop) template regardless of hasSupportCKEditor 1`] = `
|
|
208
|
+
<SlideBoxContent__CreativesWrapper>
|
|
209
|
+
<ForwardRef
|
|
210
|
+
cap={Object {}}
|
|
211
|
+
editor="default"
|
|
212
|
+
eventContextTags={Object {}}
|
|
213
|
+
getDefaultTags=""
|
|
214
|
+
handleCloseTestAndPreview={[MockFunction]}
|
|
215
|
+
handleTestAndPreview={[MockFunction]}
|
|
216
|
+
isLoyaltyModule={false}
|
|
217
|
+
isTestAndPreviewMode={false}
|
|
218
|
+
key="cretives-container-email-edit"
|
|
219
|
+
location={
|
|
220
|
+
Object {
|
|
221
|
+
"pathname": "/email/edit",
|
|
222
|
+
"query": Object {
|
|
223
|
+
"module": "library",
|
|
224
|
+
"type": "embedded",
|
|
225
|
+
},
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
moduleType="email"
|
|
229
|
+
onValidationFail={[MockFunction]}
|
|
230
|
+
params={
|
|
231
|
+
Object {
|
|
232
|
+
"id": "123",
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
route={
|
|
236
|
+
Object {
|
|
237
|
+
"name": "email",
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
showLiquidErrorInFooter={false}
|
|
241
|
+
showTemplateName={[MockFunction]}
|
|
242
|
+
showTestAndPreviewSlidebox={false}
|
|
243
|
+
templateData={
|
|
244
|
+
Object {
|
|
245
|
+
"_id": "123",
|
|
246
|
+
"base": Object {
|
|
247
|
+
"is_drag_drop": true,
|
|
248
|
+
},
|
|
249
|
+
"type": "EMAIL",
|
|
250
|
+
"versions": Object {
|
|
251
|
+
"base": Object {
|
|
252
|
+
"content": Object {},
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
waitEventContextTags={Object {}}
|
|
258
|
+
/>
|
|
259
|
+
</SlideBoxContent__CreativesWrapper>
|
|
260
|
+
`;
|
|
261
|
+
|
|
207
262
|
exports[`Test SlideBoxContent container InApp vs InAppWrapper rendering conditions renders InApp when isFullMode=false and loyalty module enabled 1`] = `
|
|
208
263
|
<SlideBoxContent__CreativesWrapper>
|
|
209
264
|
<Component
|
|
@@ -870,6 +925,11 @@ exports[`Test SlideBoxContent container Should render correct component for rcs
|
|
|
870
925
|
}
|
|
871
926
|
}
|
|
872
927
|
onCreateComplete={[MockFunction]}
|
|
928
|
+
templateData={
|
|
929
|
+
Object {
|
|
930
|
+
"mode": "create",
|
|
931
|
+
}
|
|
932
|
+
}
|
|
873
933
|
waitEventContextTags={Object {}}
|
|
874
934
|
/>
|
|
875
935
|
</SlideBoxContent__CreativesWrapper>
|
|
@@ -981,6 +1041,7 @@ exports[`Test SlideBoxContent container Should render correct component for rcs
|
|
|
981
1041
|
<Connect(UserIsAuthenticated(Component))
|
|
982
1042
|
FTPMode="create"
|
|
983
1043
|
channel="rcs"
|
|
1044
|
+
localTemplatesConfig={Object {}}
|
|
984
1045
|
loyaltyMetaData={Object {}}
|
|
985
1046
|
messageDetails={Object {}}
|
|
986
1047
|
onCreateComplete={[MockFunction]}
|
|
@@ -1393,6 +1454,7 @@ exports[`Test SlideBoxContent container Should render correct component for what
|
|
|
1393
1454
|
<Connect(UserIsAuthenticated(Component))
|
|
1394
1455
|
FTPMode="create"
|
|
1395
1456
|
channel="whatsapp"
|
|
1457
|
+
localTemplatesConfig={Object {}}
|
|
1396
1458
|
loyaltyMetaData={Object {}}
|
|
1397
1459
|
messageDetails={Object {}}
|
|
1398
1460
|
onCreateComplete={[MockFunction]}
|
|
@@ -3195,6 +3257,29 @@ exports[`Test SlideBoxContent container getChannelPreviewContent utility functio
|
|
|
3195
3257
|
</SlideBoxContent__CreativesWrapper>
|
|
3196
3258
|
`;
|
|
3197
3259
|
|
|
3260
|
+
exports[`Test SlideBoxContent container getLineType utility function Should derive isCreate/isEdit from slidBoxContent in non-full mode when templateData is absent 1`] = `
|
|
3261
|
+
<SlideBoxContent__CreativesWrapper>
|
|
3262
|
+
<Connect(Connect(UserIsAuthenticated(InjectIntl(CreativesCommon))))
|
|
3263
|
+
createNew={true}
|
|
3264
|
+
isFullMode={false}
|
|
3265
|
+
location={
|
|
3266
|
+
Object {
|
|
3267
|
+
"pathname": "/sms/edit",
|
|
3268
|
+
"query": Object {
|
|
3269
|
+
"isEditFromCampaigns": undefined,
|
|
3270
|
+
"module": "library",
|
|
3271
|
+
"type": "embedded",
|
|
3272
|
+
},
|
|
3273
|
+
"search": "",
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
onCreateComplete={[MockFunction]}
|
|
3277
|
+
templateData={null}
|
|
3278
|
+
waitEventContextTags={Object {}}
|
|
3279
|
+
/>
|
|
3280
|
+
</SlideBoxContent__CreativesWrapper>
|
|
3281
|
+
`;
|
|
3282
|
+
|
|
3198
3283
|
exports[`Test SlideBoxContent container getLineType utility function Should handle LINE channel in create mode with full mode 1`] = `
|
|
3199
3284
|
<SlideBoxContent__CreativesWrapper>
|
|
3200
3285
|
<Connect(Connect(UserIsAuthenticated(InjectIntl(CreativesCommon))))
|
|
@@ -3331,6 +3416,8 @@ exports[`Test SlideBoxContent container getLineType utility function Should hand
|
|
|
3331
3416
|
</SlideBoxContent__CreativesWrapper>
|
|
3332
3417
|
`;
|
|
3333
3418
|
|
|
3419
|
+
exports[`Test SlideBoxContent container getLineType utility function Should handle LINE channel in non-full mode with template data that is neither an edit nor a default 1`] = `<SlideBoxContent__CreativesWrapper />`;
|
|
3420
|
+
|
|
3334
3421
|
exports[`Test SlideBoxContent container getViber utility function Should handle VIBER channel in create mode 1`] = `
|
|
3335
3422
|
<SlideBoxContent__CreativesWrapper>
|
|
3336
3423
|
<ForwardRef
|
|
@@ -3409,6 +3496,7 @@ exports[`Test SlideBoxContent container getViber utility function Should handle
|
|
|
3409
3496
|
"name": "sms",
|
|
3410
3497
|
}
|
|
3411
3498
|
}
|
|
3499
|
+
templateData={null}
|
|
3412
3500
|
waitEventContextTags={Object {}}
|
|
3413
3501
|
/>
|
|
3414
3502
|
</SlideBoxContent__CreativesWrapper>
|