@capillarytech/creatives-library 8.0.258 → 8.0.259
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/assets/Android.png +0 -0
- package/assets/iOS.png +0 -0
- package/constants/unified.js +2 -1
- package/initialReducer.js +2 -0
- package/package.json +1 -1
- package/services/api.js +10 -0
- package/services/tests/api.test.js +34 -0
- package/utils/common.js +5 -0
- package/utils/commonUtils.js +28 -5
- package/utils/tests/commonUtil.test.js +224 -0
- package/utils/transformTemplateConfig.js +0 -10
- package/v2Components/CapDeviceContent/index.js +61 -56
- package/v2Components/CapTagList/index.js +6 -1
- package/v2Components/CapTagListWithInput/index.js +5 -1
- package/v2Components/CapTagListWithInput/messages.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +5 -0
- package/v2Components/ErrorInfoNote/constants.js +1 -0
- package/v2Components/ErrorInfoNote/index.js +457 -72
- package/v2Components/ErrorInfoNote/messages.js +36 -6
- package/v2Components/ErrorInfoNote/style.scss +282 -6
- package/v2Components/FormBuilder/tests/index.test.js +13 -4
- package/v2Components/HtmlEditor/HTMLEditor.js +547 -94
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +874 -0
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +1441 -133
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +27 -16
- package/v2Components/HtmlEditor/_htmlEditor.scss +108 -45
- package/v2Components/HtmlEditor/_index.lazy.scss +0 -1
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +23 -102
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +148 -140
- package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +2 -1
- package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
- package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +9 -0
- package/v2Components/HtmlEditor/components/EditorToolbar/index.js +4 -4
- package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +22 -0
- package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +4 -7
- package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +35 -45
- package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +1 -3
- package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
- package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +7 -6
- package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +3 -6
- package/v2Components/HtmlEditor/components/PreviewPane/index.js +22 -43
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/_validationErrorDisplay.scss +1 -0
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +49 -31
- package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +50 -34
- package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +6 -0
- package/v2Components/HtmlEditor/components/ValidationPanel/index.js +70 -41
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +255 -0
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +364 -0
- package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +51 -0
- package/v2Components/HtmlEditor/constants.js +42 -20
- package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +373 -16
- package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +120 -16
- package/v2Components/HtmlEditor/hooks/useEditorContent.js +5 -2
- package/v2Components/HtmlEditor/hooks/useInAppContent.js +88 -146
- package/v2Components/HtmlEditor/hooks/useValidation.js +189 -53
- package/v2Components/HtmlEditor/index.js +1 -1
- package/v2Components/HtmlEditor/messages.js +92 -94
- package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +94 -45
- package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +134 -0
- package/v2Components/HtmlEditor/utils/contentSanitizer.js +40 -41
- package/v2Components/HtmlEditor/utils/htmlValidator.js +71 -72
- package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +134 -102
- package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +23 -25
- package/v2Components/HtmlEditor/utils/validationAdapter.js +66 -41
- package/v2Components/HtmlEditor/utils/validationConstants.js +40 -0
- package/v2Components/MobilePushPreviewV2/index.js +32 -7
- package/v2Components/TemplatePreview/_templatePreview.scss +55 -24
- package/v2Components/TemplatePreview/index.js +47 -32
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +1 -0
- package/v2Containers/BeeEditor/index.js +172 -90
- package/v2Containers/BeePopupEditor/_beePopupEditor.scss +14 -0
- package/v2Containers/BeePopupEditor/constants.js +10 -0
- package/v2Containers/BeePopupEditor/index.js +194 -0
- package/v2Containers/BeePopupEditor/tests/index.test.js +627 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +127 -51
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +163 -13
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -1
- package/v2Containers/CreativesContainer/constants.js +1 -0
- package/v2Containers/CreativesContainer/index.js +239 -46
- package/v2Containers/CreativesContainer/messages.js +8 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +11 -2
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +38 -50
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +106 -0
- package/v2Containers/Email/actions.js +7 -0
- package/v2Containers/Email/constants.js +5 -1
- package/v2Containers/Email/index.js +234 -29
- package/v2Containers/Email/messages.js +32 -0
- package/v2Containers/Email/reducer.js +12 -1
- package/v2Containers/Email/sagas.js +61 -7
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +2 -0
- package/v2Containers/Email/tests/reducer.test.js +46 -0
- package/v2Containers/Email/tests/sagas.test.js +320 -29
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1285 -0
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +211 -21
- package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +40 -74
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +1880 -0
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +520 -0
- package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +2 -67
- package/v2Containers/EmailWrapper/constants.js +2 -0
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +629 -77
- package/v2Containers/EmailWrapper/index.js +103 -23
- package/v2Containers/EmailWrapper/messages.js +65 -1
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +643 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +594 -77
- package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +376 -0
- package/v2Containers/InApp/__tests__/sagas.test.js +363 -0
- package/v2Containers/InApp/actions.js +7 -0
- package/v2Containers/InApp/constants.js +20 -4
- package/v2Containers/InApp/index.js +802 -359
- package/v2Containers/InApp/index.scss +4 -3
- package/v2Containers/InApp/messages.js +7 -3
- package/v2Containers/InApp/reducer.js +21 -3
- package/v2Containers/InApp/sagas.js +29 -9
- package/v2Containers/InApp/selectors.js +25 -5
- package/v2Containers/InApp/tests/index.test.js +154 -50
- package/v2Containers/InApp/tests/reducer.test.js +34 -0
- package/v2Containers/InApp/tests/sagas.test.js +61 -9
- package/v2Containers/InApp/tests/selectors.test.js +612 -0
- package/v2Containers/InAppWrapper/components/InAppWrapperView.js +151 -0
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +267 -0
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +23 -0
- package/v2Containers/InAppWrapper/constants.js +16 -0
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +473 -0
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +198 -0
- package/v2Containers/InAppWrapper/index.js +148 -0
- package/v2Containers/InAppWrapper/messages.js +49 -0
- package/v2Containers/InappAdvance/index.js +1099 -0
- package/v2Containers/InappAdvance/index.scss +10 -0
- package/v2Containers/InappAdvance/tests/index.test.js +448 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +12 -0
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -0
- package/v2Containers/TagList/index.js +62 -19
- package/v2Containers/Templates/_templates.scss +60 -1
- package/v2Containers/Templates/index.js +89 -4
- package/v2Containers/Templates/messages.js +4 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34 -0
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +0 -152
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +0 -214
|
@@ -2282,6 +2282,7 @@ new message content.",
|
|
|
2282
2282
|
"email": [Function],
|
|
2283
2283
|
"facebookPreview": [Function],
|
|
2284
2284
|
"gallery": [Function],
|
|
2285
|
+
"inApp": [Function],
|
|
2285
2286
|
"language": [Function],
|
|
2286
2287
|
"navigationConfig": [Function],
|
|
2287
2288
|
"previewAndTest": [Function],
|
|
@@ -23708,6 +23709,7 @@ new message content.",
|
|
|
23708
23709
|
"email": [Function],
|
|
23709
23710
|
"facebookPreview": [Function],
|
|
23710
23711
|
"gallery": [Function],
|
|
23712
|
+
"inApp": [Function],
|
|
23711
23713
|
"language": [Function],
|
|
23712
23714
|
"navigationConfig": [Function],
|
|
23713
23715
|
"previewAndTest": [Function],
|
|
@@ -47250,6 +47252,7 @@ new message content.",
|
|
|
47250
47252
|
"email": [Function],
|
|
47251
47253
|
"facebookPreview": [Function],
|
|
47252
47254
|
"gallery": [Function],
|
|
47255
|
+
"inApp": [Function],
|
|
47253
47256
|
"language": [Function],
|
|
47254
47257
|
"navigationConfig": [Function],
|
|
47255
47258
|
"previewAndTest": [Function],
|
|
@@ -71780,6 +71783,7 @@ new message content.",
|
|
|
71780
71783
|
"email": [Function],
|
|
71781
71784
|
"facebookPreview": [Function],
|
|
71782
71785
|
"gallery": [Function],
|
|
71786
|
+
"inApp": [Function],
|
|
71783
71787
|
"language": [Function],
|
|
71784
71788
|
"navigationConfig": [Function],
|
|
71785
71789
|
"previewAndTest": [Function],
|
|
@@ -98607,6 +98611,7 @@ new message content.",
|
|
|
98607
98611
|
"email": [Function],
|
|
98608
98612
|
"facebookPreview": [Function],
|
|
98609
98613
|
"gallery": [Function],
|
|
98614
|
+
"inApp": [Function],
|
|
98610
98615
|
"language": [Function],
|
|
98611
98616
|
"navigationConfig": [Function],
|
|
98612
98617
|
"previewAndTest": [Function],
|
|
@@ -120063,6 +120068,7 @@ new message content.",
|
|
|
120063
120068
|
"email": [Function],
|
|
120064
120069
|
"facebookPreview": [Function],
|
|
120065
120070
|
"gallery": [Function],
|
|
120071
|
+
"inApp": [Function],
|
|
120066
120072
|
"language": [Function],
|
|
120067
120073
|
"navigationConfig": [Function],
|
|
120068
120074
|
"previewAndTest": [Function],
|
|
@@ -141489,6 +141495,7 @@ new message content.",
|
|
|
141489
141495
|
"email": [Function],
|
|
141490
141496
|
"facebookPreview": [Function],
|
|
141491
141497
|
"gallery": [Function],
|
|
141498
|
+
"inApp": [Function],
|
|
141492
141499
|
"language": [Function],
|
|
141493
141500
|
"navigationConfig": [Function],
|
|
141494
141501
|
"previewAndTest": [Function],
|
|
@@ -166927,6 +166934,7 @@ new message content.",
|
|
|
166927
166934
|
"email": [Function],
|
|
166928
166935
|
"facebookPreview": [Function],
|
|
166929
166936
|
"gallery": [Function],
|
|
166937
|
+
"inApp": [Function],
|
|
166930
166938
|
"language": [Function],
|
|
166931
166939
|
"navigationConfig": [Function],
|
|
166932
166940
|
"previewAndTest": [Function],
|
|
@@ -193353,6 +193361,7 @@ new message content.",
|
|
|
193353
193361
|
"email": [Function],
|
|
193354
193362
|
"facebookPreview": [Function],
|
|
193355
193363
|
"gallery": [Function],
|
|
193364
|
+
"inApp": [Function],
|
|
193356
193365
|
"language": [Function],
|
|
193357
193366
|
"navigationConfig": [Function],
|
|
193358
193367
|
"previewAndTest": [Function],
|
|
@@ -222076,6 +222085,7 @@ new message content.",
|
|
|
222076
222085
|
"email": [Function],
|
|
222077
222086
|
"facebookPreview": [Function],
|
|
222078
222087
|
"gallery": [Function],
|
|
222088
|
+
"inApp": [Function],
|
|
222079
222089
|
"language": [Function],
|
|
222080
222090
|
"navigationConfig": [Function],
|
|
222081
222091
|
"previewAndTest": [Function],
|
|
@@ -251781,6 +251791,7 @@ new message content.",
|
|
|
251781
251791
|
"email": [Function],
|
|
251782
251792
|
"facebookPreview": [Function],
|
|
251783
251793
|
"gallery": [Function],
|
|
251794
|
+
"inApp": [Function],
|
|
251784
251795
|
"language": [Function],
|
|
251785
251796
|
"navigationConfig": [Function],
|
|
251786
251797
|
"previewAndTest": [Function],
|
|
@@ -267538,6 +267549,7 @@ new message content.",
|
|
|
267538
267549
|
"email": [Function],
|
|
267539
267550
|
"facebookPreview": [Function],
|
|
267540
267551
|
"gallery": [Function],
|
|
267552
|
+
"inApp": [Function],
|
|
267541
267553
|
"language": [Function],
|
|
267542
267554
|
"navigationConfig": [Function],
|
|
267543
267555
|
"previewAndTest": [Function],
|
|
@@ -282145,6 +282157,7 @@ new message content.",
|
|
|
282145
282157
|
"email": [Function],
|
|
282146
282158
|
"facebookPreview": [Function],
|
|
282147
282159
|
"gallery": [Function],
|
|
282160
|
+
"inApp": [Function],
|
|
282148
282161
|
"language": [Function],
|
|
282149
282162
|
"navigationConfig": [Function],
|
|
282150
282163
|
"previewAndTest": [Function],
|
|
@@ -298859,6 +298872,7 @@ new message content.",
|
|
|
298859
298872
|
"email": [Function],
|
|
298860
298873
|
"facebookPreview": [Function],
|
|
298861
298874
|
"gallery": [Function],
|
|
298875
|
+
"inApp": [Function],
|
|
298862
298876
|
"language": [Function],
|
|
298863
298877
|
"navigationConfig": [Function],
|
|
298864
298878
|
"previewAndTest": [Function],
|
|
@@ -322911,6 +322925,7 @@ new message content.",
|
|
|
322911
322925
|
"email": [Function],
|
|
322912
322926
|
"facebookPreview": [Function],
|
|
322913
322927
|
"gallery": [Function],
|
|
322928
|
+
"inApp": [Function],
|
|
322914
322929
|
"language": [Function],
|
|
322915
322930
|
"navigationConfig": [Function],
|
|
322916
322931
|
"previewAndTest": [Function],
|
|
@@ -350553,6 +350568,7 @@ new message content.",
|
|
|
350553
350568
|
"email": [Function],
|
|
350554
350569
|
"facebookPreview": [Function],
|
|
350555
350570
|
"gallery": [Function],
|
|
350571
|
+
"inApp": [Function],
|
|
350556
350572
|
"language": [Function],
|
|
350557
350573
|
"navigationConfig": [Function],
|
|
350558
350574
|
"previewAndTest": [Function],
|
|
@@ -366881,6 +366897,7 @@ new message content.",
|
|
|
366881
366897
|
"email": [Function],
|
|
366882
366898
|
"facebookPreview": [Function],
|
|
366883
366899
|
"gallery": [Function],
|
|
366900
|
+
"inApp": [Function],
|
|
366884
366901
|
"language": [Function],
|
|
366885
366902
|
"navigationConfig": [Function],
|
|
366886
366903
|
"previewAndTest": [Function],
|
|
@@ -388307,6 +388324,7 @@ new message content.",
|
|
|
388307
388324
|
"email": [Function],
|
|
388308
388325
|
"facebookPreview": [Function],
|
|
388309
388326
|
"gallery": [Function],
|
|
388327
|
+
"inApp": [Function],
|
|
388310
388328
|
"language": [Function],
|
|
388311
388329
|
"navigationConfig": [Function],
|
|
388312
388330
|
"previewAndTest": [Function],
|
|
@@ -413745,6 +413763,7 @@ new message content.",
|
|
|
413745
413763
|
"email": [Function],
|
|
413746
413764
|
"facebookPreview": [Function],
|
|
413747
413765
|
"gallery": [Function],
|
|
413766
|
+
"inApp": [Function],
|
|
413748
413767
|
"language": [Function],
|
|
413749
413768
|
"navigationConfig": [Function],
|
|
413750
413769
|
"previewAndTest": [Function],
|
|
@@ -435171,6 +435190,7 @@ new message content.",
|
|
|
435171
435190
|
"email": [Function],
|
|
435172
435191
|
"facebookPreview": [Function],
|
|
435173
435192
|
"gallery": [Function],
|
|
435193
|
+
"inApp": [Function],
|
|
435174
435194
|
"language": [Function],
|
|
435175
435195
|
"navigationConfig": [Function],
|
|
435176
435196
|
"previewAndTest": [Function],
|
|
@@ -457417,6 +457437,7 @@ new message content.",
|
|
|
457417
457437
|
"email": [Function],
|
|
457418
457438
|
"facebookPreview": [Function],
|
|
457419
457439
|
"gallery": [Function],
|
|
457440
|
+
"inApp": [Function],
|
|
457420
457441
|
"language": [Function],
|
|
457421
457442
|
"navigationConfig": [Function],
|
|
457422
457443
|
"previewAndTest": [Function],
|
|
@@ -480486,6 +480507,7 @@ new message content.",
|
|
|
480486
480507
|
"email": [Function],
|
|
480487
480508
|
"facebookPreview": [Function],
|
|
480488
480509
|
"gallery": [Function],
|
|
480510
|
+
"inApp": [Function],
|
|
480489
480511
|
"language": [Function],
|
|
480490
480512
|
"navigationConfig": [Function],
|
|
480491
480513
|
"previewAndTest": [Function],
|
|
@@ -504375,6 +504397,7 @@ new message content.",
|
|
|
504375
504397
|
"email": [Function],
|
|
504376
504398
|
"facebookPreview": [Function],
|
|
504377
504399
|
"gallery": [Function],
|
|
504400
|
+
"inApp": [Function],
|
|
504378
504401
|
"language": [Function],
|
|
504379
504402
|
"navigationConfig": [Function],
|
|
504380
504403
|
"previewAndTest": [Function],
|
|
@@ -529107,6 +529130,7 @@ new message content.",
|
|
|
529107
529130
|
"email": [Function],
|
|
529108
529131
|
"facebookPreview": [Function],
|
|
529109
529132
|
"gallery": [Function],
|
|
529133
|
+
"inApp": [Function],
|
|
529110
529134
|
"language": [Function],
|
|
529111
529135
|
"navigationConfig": [Function],
|
|
529112
529136
|
"previewAndTest": [Function],
|
|
@@ -554679,6 +554703,7 @@ new message content.",
|
|
|
554679
554703
|
"email": [Function],
|
|
554680
554704
|
"facebookPreview": [Function],
|
|
554681
554705
|
"gallery": [Function],
|
|
554706
|
+
"inApp": [Function],
|
|
554682
554707
|
"language": [Function],
|
|
554683
554708
|
"navigationConfig": [Function],
|
|
554684
554709
|
"previewAndTest": [Function],
|
|
@@ -581082,6 +581107,7 @@ new message content.",
|
|
|
581082
581107
|
"email": [Function],
|
|
581083
581108
|
"facebookPreview": [Function],
|
|
581084
581109
|
"gallery": [Function],
|
|
581110
|
+
"inApp": [Function],
|
|
581085
581111
|
"language": [Function],
|
|
581086
581112
|
"navigationConfig": [Function],
|
|
581087
581113
|
"previewAndTest": [Function],
|
|
@@ -608316,6 +608342,7 @@ new message content.",
|
|
|
608316
608342
|
"email": [Function],
|
|
608317
608343
|
"facebookPreview": [Function],
|
|
608318
608344
|
"gallery": [Function],
|
|
608345
|
+
"inApp": [Function],
|
|
608319
608346
|
"language": [Function],
|
|
608320
608347
|
"navigationConfig": [Function],
|
|
608321
608348
|
"previewAndTest": [Function],
|
|
@@ -636362,6 +636389,7 @@ new message content.",
|
|
|
636362
636389
|
"email": [Function],
|
|
636363
636390
|
"facebookPreview": [Function],
|
|
636364
636391
|
"gallery": [Function],
|
|
636392
|
+
"inApp": [Function],
|
|
636365
636393
|
"language": [Function],
|
|
636366
636394
|
"navigationConfig": [Function],
|
|
636367
636395
|
"previewAndTest": [Function],
|
|
@@ -658649,6 +658677,7 @@ new message content.",
|
|
|
658649
658677
|
"email": [Function],
|
|
658650
658678
|
"facebookPreview": [Function],
|
|
658651
658679
|
"gallery": [Function],
|
|
658680
|
+
"inApp": [Function],
|
|
658652
658681
|
"language": [Function],
|
|
658653
658682
|
"navigationConfig": [Function],
|
|
658654
658683
|
"previewAndTest": [Function],
|
|
@@ -681763,6 +681792,7 @@ new message content.",
|
|
|
681763
681792
|
"email": [Function],
|
|
681764
681793
|
"facebookPreview": [Function],
|
|
681765
681794
|
"gallery": [Function],
|
|
681795
|
+
"inApp": [Function],
|
|
681766
681796
|
"language": [Function],
|
|
681767
681797
|
"navigationConfig": [Function],
|
|
681768
681798
|
"previewAndTest": [Function],
|
|
@@ -705768,6 +705798,7 @@ new message content.",
|
|
|
705768
705798
|
"email": [Function],
|
|
705769
705799
|
"facebookPreview": [Function],
|
|
705770
705800
|
"gallery": [Function],
|
|
705801
|
+
"inApp": [Function],
|
|
705771
705802
|
"language": [Function],
|
|
705772
705803
|
"navigationConfig": [Function],
|
|
705773
705804
|
"previewAndTest": [Function],
|
|
@@ -727194,6 +727225,7 @@ new message content.",
|
|
|
727194
727225
|
"email": [Function],
|
|
727195
727226
|
"facebookPreview": [Function],
|
|
727196
727227
|
"gallery": [Function],
|
|
727228
|
+
"inApp": [Function],
|
|
727197
727229
|
"language": [Function],
|
|
727198
727230
|
"navigationConfig": [Function],
|
|
727199
727231
|
"previewAndTest": [Function],
|
|
@@ -751951,6 +751983,7 @@ new message content.",
|
|
|
751951
751983
|
"email": [Function],
|
|
751952
751984
|
"facebookPreview": [Function],
|
|
751953
751985
|
"gallery": [Function],
|
|
751986
|
+
"inApp": [Function],
|
|
751954
751987
|
"language": [Function],
|
|
751955
751988
|
"navigationConfig": [Function],
|
|
751956
751989
|
"previewAndTest": [Function],
|
|
@@ -776816,6 +776849,7 @@ new message content.",
|
|
|
776816
776849
|
"email": [Function],
|
|
776817
776850
|
"facebookPreview": [Function],
|
|
776818
776851
|
"gallery": [Function],
|
|
776852
|
+
"inApp": [Function],
|
|
776819
776853
|
"language": [Function],
|
|
776820
776854
|
"navigationConfig": [Function],
|
|
776821
776855
|
"previewAndTest": [Function],
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ValidationErrorDisplay Component Tests
|
|
3
|
-
*
|
|
4
|
-
* Tests for the ValidationErrorDisplay component that integrates with ErrorInfoNote.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { render, screen } from '@testing-library/react';
|
|
9
|
-
import '@testing-library/jest-dom';
|
|
10
|
-
import ValidationErrorDisplay from '../index';
|
|
11
|
-
|
|
12
|
-
// Mock ErrorInfoNote component
|
|
13
|
-
jest.mock('../../../../ErrorInfoNote', () => {
|
|
14
|
-
return function MockErrorInfoNote({ errorMessages }) {
|
|
15
|
-
const liquidErrors = errorMessages?.LIQUID_ERROR_MSG || [];
|
|
16
|
-
const standardErrors = errorMessages?.STANDARD_ERROR_MSG || [];
|
|
17
|
-
const hasErrors = liquidErrors.length > 0 || standardErrors.length > 0;
|
|
18
|
-
|
|
19
|
-
if (!hasErrors) return null;
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div data-testid="error-info-note">
|
|
23
|
-
{liquidErrors.map((msg, index) => (
|
|
24
|
-
<div key={`liquid-${index}`} data-testid="error-message">
|
|
25
|
-
{msg}
|
|
26
|
-
</div>
|
|
27
|
-
))}
|
|
28
|
-
{standardErrors.map((msg, index) => (
|
|
29
|
-
<div key={`standard-${index}`} data-testid="error-message">
|
|
30
|
-
{msg}
|
|
31
|
-
</div>
|
|
32
|
-
))}
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
describe('ValidationErrorDisplay', () => {
|
|
39
|
-
it('renders standard errors when validation has issues', () => {
|
|
40
|
-
const mockValidation = {
|
|
41
|
-
getAllIssues: () => [
|
|
42
|
-
{ message: 'Missing closing tag', severity: 'error', line: 5, column: 10 },
|
|
43
|
-
{ message: 'Invalid attribute', severity: 'error', line: 7 }
|
|
44
|
-
],
|
|
45
|
-
isClean: () => false,
|
|
46
|
-
isValidating: false
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
render(<ValidationErrorDisplay validation={mockValidation} />);
|
|
50
|
-
|
|
51
|
-
expect(screen.getByTestId('error-info-note')).toBeInTheDocument();
|
|
52
|
-
const errorMessages = screen.getAllByTestId('error-message');
|
|
53
|
-
expect(errorMessages).toHaveLength(2);
|
|
54
|
-
expect(errorMessages[0]).toHaveTextContent('Missing closing tag Line 5, Char 10.');
|
|
55
|
-
expect(errorMessages[1]).toHaveTextContent('Invalid attribute Line 7.');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('renders liquid errors separately', () => {
|
|
59
|
-
const mockValidation = {
|
|
60
|
-
getAllIssues: () => [
|
|
61
|
-
{ message: 'Invalid liquid syntax', severity: 'error', source: 'liquid-validator', line: 3 },
|
|
62
|
-
{ message: 'HTML error', severity: 'error', source: 'htmlhint', line: 10 }
|
|
63
|
-
],
|
|
64
|
-
isClean: () => false,
|
|
65
|
-
isValidating: false
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
render(<ValidationErrorDisplay validation={mockValidation} />);
|
|
69
|
-
|
|
70
|
-
expect(screen.getByTestId('error-info-note')).toBeInTheDocument();
|
|
71
|
-
const errorMessages = screen.getAllByTestId('error-message');
|
|
72
|
-
expect(errorMessages).toHaveLength(2);
|
|
73
|
-
// First should be liquid error, second should be standard error
|
|
74
|
-
expect(errorMessages[0]).toHaveTextContent('Invalid liquid syntax Line 3.');
|
|
75
|
-
expect(errorMessages[1]).toHaveTextContent('HTML error Line 10.');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('does not render when validation has no errors', () => {
|
|
79
|
-
const mockValidation = {
|
|
80
|
-
getAllIssues: () => [],
|
|
81
|
-
isClean: () => true,
|
|
82
|
-
isValidating: false
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const { container } = render(<ValidationErrorDisplay validation={mockValidation} />);
|
|
86
|
-
|
|
87
|
-
expect(screen.queryByTestId('error-info-note')).not.toBeInTheDocument();
|
|
88
|
-
expect(container.firstChild).toBeNull();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('does not render when validation is null', () => {
|
|
92
|
-
const { container } = render(<ValidationErrorDisplay validation={null} />);
|
|
93
|
-
|
|
94
|
-
expect(screen.queryByTestId('error-info-note')).not.toBeInTheDocument();
|
|
95
|
-
expect(container.firstChild).toBeNull();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('does not render when validation is in progress', () => {
|
|
99
|
-
const mockValidation = {
|
|
100
|
-
getAllIssues: () => [],
|
|
101
|
-
isClean: () => false,
|
|
102
|
-
isValidating: true
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const { container } = render(<ValidationErrorDisplay validation={mockValidation} />);
|
|
106
|
-
|
|
107
|
-
expect(screen.queryByTestId('error-info-note')).not.toBeInTheDocument();
|
|
108
|
-
expect(container.firstChild).toBeNull();
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it('applies custom className', () => {
|
|
112
|
-
const mockValidation = {
|
|
113
|
-
getAllIssues: () => [{ message: 'Error', severity: 'error' }],
|
|
114
|
-
isClean: () => false,
|
|
115
|
-
isValidating: false
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const { container } = render(
|
|
119
|
-
<ValidationErrorDisplay validation={mockValidation} className="custom-class" />
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
const wrapper = container.querySelector('.validation-error-display');
|
|
123
|
-
expect(wrapper).toHaveClass('custom-class');
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('handles inapp variant correctly', () => {
|
|
127
|
-
const mockValidation = {
|
|
128
|
-
getAllIssues: () => [{ message: 'Mobile error', severity: 'error' }],
|
|
129
|
-
isClean: () => false,
|
|
130
|
-
isValidating: false
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
render(<ValidationErrorDisplay validation={mockValidation} variant="inapp" />);
|
|
134
|
-
|
|
135
|
-
expect(screen.getByTestId('error-info-note')).toBeInTheDocument();
|
|
136
|
-
expect(screen.getByTestId('error-message')).toHaveTextContent('Mobile error');
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('includes rule information in error messages when available', () => {
|
|
140
|
-
const mockValidation = {
|
|
141
|
-
getAllIssues: () => [
|
|
142
|
-
{ message: 'Alt attribute required', severity: 'error', rule: 'alt-require', line: 5 }
|
|
143
|
-
],
|
|
144
|
-
isClean: () => false,
|
|
145
|
-
isValidating: false
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
render(<ValidationErrorDisplay validation={mockValidation} />);
|
|
149
|
-
|
|
150
|
-
expect(screen.getByTestId('error-message')).toHaveTextContent('Alt attribute required Line 5. • alt-require');
|
|
151
|
-
});
|
|
152
|
-
});
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, fireEvent, within, screen } from '@testing-library/react';
|
|
3
|
-
import '@testing-library/jest-dom';
|
|
4
|
-
import { IntlProvider } from 'react-intl';
|
|
5
|
-
import { Provider } from 'react-redux';
|
|
6
|
-
import { configureStore } from '@capillarytech/vulcan-react-sdk/utils'
|
|
7
|
-
import { initialReducer } from '../../../initialReducer';
|
|
8
|
-
import EmailWrapperView from '../components/EmailWrapperView';
|
|
9
|
-
import { EmailWrapperViewMockProps } from '../mockdata/mockdata';
|
|
10
|
-
import { EMAIL_CREATE_MODES } from '../constants';
|
|
11
|
-
import history from '../../../utils/history';
|
|
12
|
-
|
|
13
|
-
// This mock needs to be before any imports
|
|
14
|
-
jest.mock('../../../v2Containers/Email', () => ({
|
|
15
|
-
__esModule: true,
|
|
16
|
-
default: () => <div data-testid="email-create-container" />,
|
|
17
|
-
}));
|
|
18
|
-
|
|
19
|
-
// Mock react-router
|
|
20
|
-
jest.mock('react-router-dom', () => ({
|
|
21
|
-
...jest.requireActual('react-router-dom'),
|
|
22
|
-
useHistory: () => ({
|
|
23
|
-
push: jest.fn(),
|
|
24
|
-
replace: jest.fn(),
|
|
25
|
-
go: jest.fn(),
|
|
26
|
-
goBack: jest.fn(),
|
|
27
|
-
goForward: jest.fn(),
|
|
28
|
-
location: { search: '' }
|
|
29
|
-
}),
|
|
30
|
-
}));
|
|
31
|
-
|
|
32
|
-
// Mock redux-auth-wrapper
|
|
33
|
-
jest.mock('redux-auth-wrapper/history4/redirect', () => ({
|
|
34
|
-
connectedRouterRedirect: () => (Component) => Component,
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
// Mock react-router
|
|
38
|
-
jest.mock('connected-react-router', () => ({
|
|
39
|
-
push: jest.fn(),
|
|
40
|
-
replace: jest.fn(),
|
|
41
|
-
go: jest.fn(),
|
|
42
|
-
goBack: jest.fn(),
|
|
43
|
-
goForward: jest.fn(),
|
|
44
|
-
}));
|
|
45
|
-
|
|
46
|
-
// Mock the saga injector
|
|
47
|
-
jest.mock('@capillarytech/vulcan-react-sdk/utils/injectSaga', () => ({
|
|
48
|
-
__esModule: true,
|
|
49
|
-
default: () => (Component) => Component,
|
|
50
|
-
}));
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const initialState = {
|
|
54
|
-
cap: { loading: false, error: null },
|
|
55
|
-
router: { location: { pathname: '/' } }
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
describe('EmailWrapperView', () => {
|
|
59
|
-
let store;
|
|
60
|
-
|
|
61
|
-
beforeAll(() => {
|
|
62
|
-
store = configureStore(initialState, initialReducer, history);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const renderWithProviders = (component) => {
|
|
66
|
-
return render(
|
|
67
|
-
<Provider store={store}>
|
|
68
|
-
<IntlProvider locale="en" messages={{}}>
|
|
69
|
-
{component}
|
|
70
|
-
</IntlProvider>
|
|
71
|
-
</Provider>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
it('renders mode selection UI when step is modeSelection', () => {
|
|
76
|
-
const props = {
|
|
77
|
-
...EmailWrapperViewMockProps,
|
|
78
|
-
step: 'modeSelection',
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const { getByText } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
82
|
-
expect(getByText('Create using editor')).toBeInTheDocument();
|
|
83
|
-
expect(getByText('Upload zip file')).toBeInTheDocument();
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('shows template name input in full mode', () => {
|
|
87
|
-
const props = {
|
|
88
|
-
...EmailWrapperViewMockProps,
|
|
89
|
-
isFullMode: true,
|
|
90
|
-
step: 'modeSelection',
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const { container } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
94
|
-
const input = container.querySelector('.ant-input');
|
|
95
|
-
expect(input).toBeInTheDocument();
|
|
96
|
-
expect(input.value).toBe(props.templateName);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('handles template name changes', () => {
|
|
100
|
-
const props = {
|
|
101
|
-
...EmailWrapperViewMockProps,
|
|
102
|
-
isFullMode: true,
|
|
103
|
-
step: 'modeSelection',
|
|
104
|
-
onTemplateNameChange: jest.fn(),
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const { container } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
108
|
-
const input = container.querySelector('.ant-input');
|
|
109
|
-
expect(input).toBeInTheDocument();
|
|
110
|
-
|
|
111
|
-
// Create a change event and fire it
|
|
112
|
-
fireEvent.change(input, { target: { value: 'New Template Name' } });
|
|
113
|
-
|
|
114
|
-
// Just verify that the function was called
|
|
115
|
-
expect(props.onTemplateNameChange).toHaveBeenCalled();
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('shows upload button when in upload mode', () => {
|
|
119
|
-
const props = {
|
|
120
|
-
...EmailWrapperViewMockProps,
|
|
121
|
-
step: 'modeSelection',
|
|
122
|
-
emailCreateMode: EMAIL_CREATE_MODES.UPLOAD,
|
|
123
|
-
uploadButtonLabel: 'Upload',
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const { getByText, container } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
127
|
-
|
|
128
|
-
// Find the "Upload zip file" section
|
|
129
|
-
const modeSelectionSection = getByText('Upload zip file').closest('div');
|
|
130
|
-
|
|
131
|
-
// Find any button in the upload section
|
|
132
|
-
const uploadButton = container.querySelector('.ant-btn');
|
|
133
|
-
|
|
134
|
-
// Verify that we found an upload button
|
|
135
|
-
expect(uploadButton).toBeInTheDocument();
|
|
136
|
-
expect(uploadButton.textContent).toContain('Upload');
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('shows loading spinner when uploading', () => {
|
|
140
|
-
const props = {
|
|
141
|
-
...EmailWrapperViewMockProps,
|
|
142
|
-
isUploading: true,
|
|
143
|
-
emailCreateMode: EMAIL_CREATE_MODES.UPLOAD,
|
|
144
|
-
step: 'modeSelection',
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
const { container } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
148
|
-
const spinner = container.querySelector('.ant-spin');
|
|
149
|
-
expect(spinner).toBeInTheDocument();
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it('shows content creation UI when not in mode selection', () => {
|
|
153
|
-
const props = {
|
|
154
|
-
...EmailWrapperViewMockProps,
|
|
155
|
-
step: 'contentCreation',
|
|
156
|
-
isShowEmailCreate: true,
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const { getByTestId } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
160
|
-
expect(getByTestId('email-create-container')).toBeInTheDocument();
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it('disables upload button when template name is empty in full mode', () => {
|
|
164
|
-
const props = {
|
|
165
|
-
...EmailWrapperViewMockProps,
|
|
166
|
-
isFullMode: true,
|
|
167
|
-
step: 'modeSelection',
|
|
168
|
-
emailCreateMode: EMAIL_CREATE_MODES.UPLOAD,
|
|
169
|
-
templateName: '',
|
|
170
|
-
isTemplateNameEmpty: true,
|
|
171
|
-
uploadButtonLabel: 'Upload',
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
const { getByText, container } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
175
|
-
|
|
176
|
-
// Find the Upload section
|
|
177
|
-
getByText('Upload zip file');
|
|
178
|
-
|
|
179
|
-
// Find button in the container
|
|
180
|
-
const uploadButton = container.querySelector('.ant-btn');
|
|
181
|
-
|
|
182
|
-
// Check if the button is disabled
|
|
183
|
-
expect(uploadButton).toBeDisabled();
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it('shows error message when template name is empty during upload', () => {
|
|
187
|
-
const props = {
|
|
188
|
-
...EmailWrapperViewMockProps,
|
|
189
|
-
isFullMode: true,
|
|
190
|
-
step: 'modeSelection',
|
|
191
|
-
emailCreateMode: EMAIL_CREATE_MODES.UPLOAD,
|
|
192
|
-
templateName: '',
|
|
193
|
-
isTemplateNameEmpty: true,
|
|
194
|
-
// Add errorMessage directly to the props
|
|
195
|
-
errorMessage: 'Please enter template name',
|
|
196
|
-
intl: {
|
|
197
|
-
formatMessage: () => 'Please enter template name',
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const { container } = renderWithProviders(<EmailWrapperView {...props} />);
|
|
202
|
-
|
|
203
|
-
// Look for error feedback in the Ant Design form
|
|
204
|
-
const errorElement = container.querySelector('.ant-form-item-explain');
|
|
205
|
-
|
|
206
|
-
if (errorElement) {
|
|
207
|
-
expect(errorElement.textContent).toContain('Please enter template name');
|
|
208
|
-
} else {
|
|
209
|
-
// If the standard error element is not found, look for any element containing the error text
|
|
210
|
-
const allText = container.textContent;
|
|
211
|
-
expect(allText).toContain('Please enter template name');
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
});
|