@capillarytech/creatives-library 8.0.249 → 8.0.250-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/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 +18 -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/index.js +452 -72
- package/v2Components/ErrorInfoNote/messages.js +22 -0
- package/v2Components/ErrorInfoNote/style.scss +280 -4
- package/v2Components/FormBuilder/tests/index.test.js +13 -4
- package/v2Components/HtmlEditor/HTMLEditor.js +640 -94
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +874 -0
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +1167 -133
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +27 -16
- package/v2Components/HtmlEditor/_htmlEditor.scss +108 -45
- package/v2Components/HtmlEditor/_index.lazy.scss +1 -1
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +13 -101
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +148 -139
- 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 +1 -1
- 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 +11 -13
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +49 -31
- package/v2Components/HtmlEditor/components/ValidationPanel/index.js +68 -39
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +254 -0
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +391 -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.apiErrors.test.js +795 -0
- 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 +95 -85
- package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +94 -45
- 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/MobilePushPreviewV2/index.js +32 -7
- package/v2Components/TemplatePreview/_templatePreview.scss +44 -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/constants.js +10 -0
- package/v2Containers/BeePopupEditor/index.js +193 -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 +222 -27
- 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/sagas.test.js +320 -29
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1321 -0
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +210 -15
- package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +40 -74
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +1749 -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 +61 -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 +162 -0
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +267 -0
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +9 -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],
|
|
@@ -23696,6 +23697,7 @@ new message content.",
|
|
|
23696
23697
|
"email": [Function],
|
|
23697
23698
|
"facebookPreview": [Function],
|
|
23698
23699
|
"gallery": [Function],
|
|
23700
|
+
"inApp": [Function],
|
|
23699
23701
|
"language": [Function],
|
|
23700
23702
|
"navigationConfig": [Function],
|
|
23701
23703
|
"previewAndTest": [Function],
|
|
@@ -47226,6 +47228,7 @@ new message content.",
|
|
|
47226
47228
|
"email": [Function],
|
|
47227
47229
|
"facebookPreview": [Function],
|
|
47228
47230
|
"gallery": [Function],
|
|
47231
|
+
"inApp": [Function],
|
|
47229
47232
|
"language": [Function],
|
|
47230
47233
|
"navigationConfig": [Function],
|
|
47231
47234
|
"previewAndTest": [Function],
|
|
@@ -71744,6 +71747,7 @@ new message content.",
|
|
|
71744
71747
|
"email": [Function],
|
|
71745
71748
|
"facebookPreview": [Function],
|
|
71746
71749
|
"gallery": [Function],
|
|
71750
|
+
"inApp": [Function],
|
|
71747
71751
|
"language": [Function],
|
|
71748
71752
|
"navigationConfig": [Function],
|
|
71749
71753
|
"previewAndTest": [Function],
|
|
@@ -98559,6 +98563,7 @@ new message content.",
|
|
|
98559
98563
|
"email": [Function],
|
|
98560
98564
|
"facebookPreview": [Function],
|
|
98561
98565
|
"gallery": [Function],
|
|
98566
|
+
"inApp": [Function],
|
|
98562
98567
|
"language": [Function],
|
|
98563
98568
|
"navigationConfig": [Function],
|
|
98564
98569
|
"previewAndTest": [Function],
|
|
@@ -120003,6 +120008,7 @@ new message content.",
|
|
|
120003
120008
|
"email": [Function],
|
|
120004
120009
|
"facebookPreview": [Function],
|
|
120005
120010
|
"gallery": [Function],
|
|
120011
|
+
"inApp": [Function],
|
|
120006
120012
|
"language": [Function],
|
|
120007
120013
|
"navigationConfig": [Function],
|
|
120008
120014
|
"previewAndTest": [Function],
|
|
@@ -141417,6 +141423,7 @@ new message content.",
|
|
|
141417
141423
|
"email": [Function],
|
|
141418
141424
|
"facebookPreview": [Function],
|
|
141419
141425
|
"gallery": [Function],
|
|
141426
|
+
"inApp": [Function],
|
|
141420
141427
|
"language": [Function],
|
|
141421
141428
|
"navigationConfig": [Function],
|
|
141422
141429
|
"previewAndTest": [Function],
|
|
@@ -166843,6 +166850,7 @@ new message content.",
|
|
|
166843
166850
|
"email": [Function],
|
|
166844
166851
|
"facebookPreview": [Function],
|
|
166845
166852
|
"gallery": [Function],
|
|
166853
|
+
"inApp": [Function],
|
|
166846
166854
|
"language": [Function],
|
|
166847
166855
|
"navigationConfig": [Function],
|
|
166848
166856
|
"previewAndTest": [Function],
|
|
@@ -193257,6 +193265,7 @@ new message content.",
|
|
|
193257
193265
|
"email": [Function],
|
|
193258
193266
|
"facebookPreview": [Function],
|
|
193259
193267
|
"gallery": [Function],
|
|
193268
|
+
"inApp": [Function],
|
|
193260
193269
|
"language": [Function],
|
|
193261
193270
|
"navigationConfig": [Function],
|
|
193262
193271
|
"previewAndTest": [Function],
|
|
@@ -221968,6 +221977,7 @@ new message content.",
|
|
|
221968
221977
|
"email": [Function],
|
|
221969
221978
|
"facebookPreview": [Function],
|
|
221970
221979
|
"gallery": [Function],
|
|
221980
|
+
"inApp": [Function],
|
|
221971
221981
|
"language": [Function],
|
|
221972
221982
|
"navigationConfig": [Function],
|
|
221973
221983
|
"previewAndTest": [Function],
|
|
@@ -251661,6 +251671,7 @@ new message content.",
|
|
|
251661
251671
|
"email": [Function],
|
|
251662
251672
|
"facebookPreview": [Function],
|
|
251663
251673
|
"gallery": [Function],
|
|
251674
|
+
"inApp": [Function],
|
|
251664
251675
|
"language": [Function],
|
|
251665
251676
|
"navigationConfig": [Function],
|
|
251666
251677
|
"previewAndTest": [Function],
|
|
@@ -267419,6 +267430,7 @@ new message content.",
|
|
|
267419
267430
|
"email": [Function],
|
|
267420
267431
|
"facebookPreview": [Function],
|
|
267421
267432
|
"gallery": [Function],
|
|
267433
|
+
"inApp": [Function],
|
|
267422
267434
|
"language": [Function],
|
|
267423
267435
|
"navigationConfig": [Function],
|
|
267424
267436
|
"previewAndTest": [Function],
|
|
@@ -282027,6 +282039,7 @@ new message content.",
|
|
|
282027
282039
|
"email": [Function],
|
|
282028
282040
|
"facebookPreview": [Function],
|
|
282029
282041
|
"gallery": [Function],
|
|
282042
|
+
"inApp": [Function],
|
|
282030
282043
|
"language": [Function],
|
|
282031
282044
|
"navigationConfig": [Function],
|
|
282032
282045
|
"previewAndTest": [Function],
|
|
@@ -298742,6 +298755,7 @@ new message content.",
|
|
|
298742
298755
|
"email": [Function],
|
|
298743
298756
|
"facebookPreview": [Function],
|
|
298744
298757
|
"gallery": [Function],
|
|
298758
|
+
"inApp": [Function],
|
|
298745
298759
|
"language": [Function],
|
|
298746
298760
|
"navigationConfig": [Function],
|
|
298747
298761
|
"previewAndTest": [Function],
|
|
@@ -322795,6 +322809,7 @@ new message content.",
|
|
|
322795
322809
|
"email": [Function],
|
|
322796
322810
|
"facebookPreview": [Function],
|
|
322797
322811
|
"gallery": [Function],
|
|
322812
|
+
"inApp": [Function],
|
|
322798
322813
|
"language": [Function],
|
|
322799
322814
|
"navigationConfig": [Function],
|
|
322800
322815
|
"previewAndTest": [Function],
|
|
@@ -350438,6 +350453,7 @@ new message content.",
|
|
|
350438
350453
|
"email": [Function],
|
|
350439
350454
|
"facebookPreview": [Function],
|
|
350440
350455
|
"gallery": [Function],
|
|
350456
|
+
"inApp": [Function],
|
|
350441
350457
|
"language": [Function],
|
|
350442
350458
|
"navigationConfig": [Function],
|
|
350443
350459
|
"previewAndTest": [Function],
|
|
@@ -366767,6 +366783,7 @@ new message content.",
|
|
|
366767
366783
|
"email": [Function],
|
|
366768
366784
|
"facebookPreview": [Function],
|
|
366769
366785
|
"gallery": [Function],
|
|
366786
|
+
"inApp": [Function],
|
|
366770
366787
|
"language": [Function],
|
|
366771
366788
|
"navigationConfig": [Function],
|
|
366772
366789
|
"previewAndTest": [Function],
|
|
@@ -388181,6 +388198,7 @@ new message content.",
|
|
|
388181
388198
|
"email": [Function],
|
|
388182
388199
|
"facebookPreview": [Function],
|
|
388183
388200
|
"gallery": [Function],
|
|
388201
|
+
"inApp": [Function],
|
|
388184
388202
|
"language": [Function],
|
|
388185
388203
|
"navigationConfig": [Function],
|
|
388186
388204
|
"previewAndTest": [Function],
|
|
@@ -413607,6 +413625,7 @@ new message content.",
|
|
|
413607
413625
|
"email": [Function],
|
|
413608
413626
|
"facebookPreview": [Function],
|
|
413609
413627
|
"gallery": [Function],
|
|
413628
|
+
"inApp": [Function],
|
|
413610
413629
|
"language": [Function],
|
|
413611
413630
|
"navigationConfig": [Function],
|
|
413612
413631
|
"previewAndTest": [Function],
|
|
@@ -435021,6 +435040,7 @@ new message content.",
|
|
|
435021
435040
|
"email": [Function],
|
|
435022
435041
|
"facebookPreview": [Function],
|
|
435023
435042
|
"gallery": [Function],
|
|
435043
|
+
"inApp": [Function],
|
|
435024
435044
|
"language": [Function],
|
|
435025
435045
|
"navigationConfig": [Function],
|
|
435026
435046
|
"previewAndTest": [Function],
|
|
@@ -457255,6 +457275,7 @@ new message content.",
|
|
|
457255
457275
|
"email": [Function],
|
|
457256
457276
|
"facebookPreview": [Function],
|
|
457257
457277
|
"gallery": [Function],
|
|
457278
|
+
"inApp": [Function],
|
|
457258
457279
|
"language": [Function],
|
|
457259
457280
|
"navigationConfig": [Function],
|
|
457260
457281
|
"previewAndTest": [Function],
|
|
@@ -480312,6 +480333,7 @@ new message content.",
|
|
|
480312
480333
|
"email": [Function],
|
|
480313
480334
|
"facebookPreview": [Function],
|
|
480314
480335
|
"gallery": [Function],
|
|
480336
|
+
"inApp": [Function],
|
|
480315
480337
|
"language": [Function],
|
|
480316
480338
|
"navigationConfig": [Function],
|
|
480317
480339
|
"previewAndTest": [Function],
|
|
@@ -504189,6 +504211,7 @@ new message content.",
|
|
|
504189
504211
|
"email": [Function],
|
|
504190
504212
|
"facebookPreview": [Function],
|
|
504191
504213
|
"gallery": [Function],
|
|
504214
|
+
"inApp": [Function],
|
|
504192
504215
|
"language": [Function],
|
|
504193
504216
|
"navigationConfig": [Function],
|
|
504194
504217
|
"previewAndTest": [Function],
|
|
@@ -528909,6 +528932,7 @@ new message content.",
|
|
|
528909
528932
|
"email": [Function],
|
|
528910
528933
|
"facebookPreview": [Function],
|
|
528911
528934
|
"gallery": [Function],
|
|
528935
|
+
"inApp": [Function],
|
|
528912
528936
|
"language": [Function],
|
|
528913
528937
|
"navigationConfig": [Function],
|
|
528914
528938
|
"previewAndTest": [Function],
|
|
@@ -554469,6 +554493,7 @@ new message content.",
|
|
|
554469
554493
|
"email": [Function],
|
|
554470
554494
|
"facebookPreview": [Function],
|
|
554471
554495
|
"gallery": [Function],
|
|
554496
|
+
"inApp": [Function],
|
|
554472
554497
|
"language": [Function],
|
|
554473
554498
|
"navigationConfig": [Function],
|
|
554474
554499
|
"previewAndTest": [Function],
|
|
@@ -580860,6 +580885,7 @@ new message content.",
|
|
|
580860
580885
|
"email": [Function],
|
|
580861
580886
|
"facebookPreview": [Function],
|
|
580862
580887
|
"gallery": [Function],
|
|
580888
|
+
"inApp": [Function],
|
|
580863
580889
|
"language": [Function],
|
|
580864
580890
|
"navigationConfig": [Function],
|
|
580865
580891
|
"previewAndTest": [Function],
|
|
@@ -608082,6 +608108,7 @@ new message content.",
|
|
|
608082
608108
|
"email": [Function],
|
|
608083
608109
|
"facebookPreview": [Function],
|
|
608084
608110
|
"gallery": [Function],
|
|
608111
|
+
"inApp": [Function],
|
|
608085
608112
|
"language": [Function],
|
|
608086
608113
|
"navigationConfig": [Function],
|
|
608087
608114
|
"previewAndTest": [Function],
|
|
@@ -636116,6 +636143,7 @@ new message content.",
|
|
|
636116
636143
|
"email": [Function],
|
|
636117
636144
|
"facebookPreview": [Function],
|
|
636118
636145
|
"gallery": [Function],
|
|
636146
|
+
"inApp": [Function],
|
|
636119
636147
|
"language": [Function],
|
|
636120
636148
|
"navigationConfig": [Function],
|
|
636121
636149
|
"previewAndTest": [Function],
|
|
@@ -658391,6 +658419,7 @@ new message content.",
|
|
|
658391
658419
|
"email": [Function],
|
|
658392
658420
|
"facebookPreview": [Function],
|
|
658393
658421
|
"gallery": [Function],
|
|
658422
|
+
"inApp": [Function],
|
|
658394
658423
|
"language": [Function],
|
|
658395
658424
|
"navigationConfig": [Function],
|
|
658396
658425
|
"previewAndTest": [Function],
|
|
@@ -681493,6 +681522,7 @@ new message content.",
|
|
|
681493
681522
|
"email": [Function],
|
|
681494
681523
|
"facebookPreview": [Function],
|
|
681495
681524
|
"gallery": [Function],
|
|
681525
|
+
"inApp": [Function],
|
|
681496
681526
|
"language": [Function],
|
|
681497
681527
|
"navigationConfig": [Function],
|
|
681498
681528
|
"previewAndTest": [Function],
|
|
@@ -705486,6 +705516,7 @@ new message content.",
|
|
|
705486
705516
|
"email": [Function],
|
|
705487
705517
|
"facebookPreview": [Function],
|
|
705488
705518
|
"gallery": [Function],
|
|
705519
|
+
"inApp": [Function],
|
|
705489
705520
|
"language": [Function],
|
|
705490
705521
|
"navigationConfig": [Function],
|
|
705491
705522
|
"previewAndTest": [Function],
|
|
@@ -726900,6 +726931,7 @@ new message content.",
|
|
|
726900
726931
|
"email": [Function],
|
|
726901
726932
|
"facebookPreview": [Function],
|
|
726902
726933
|
"gallery": [Function],
|
|
726934
|
+
"inApp": [Function],
|
|
726903
726935
|
"language": [Function],
|
|
726904
726936
|
"navigationConfig": [Function],
|
|
726905
726937
|
"previewAndTest": [Function],
|
|
@@ -751641,6 +751673,7 @@ new message content.",
|
|
|
751641
751673
|
"email": [Function],
|
|
751642
751674
|
"facebookPreview": [Function],
|
|
751643
751675
|
"gallery": [Function],
|
|
751676
|
+
"inApp": [Function],
|
|
751644
751677
|
"language": [Function],
|
|
751645
751678
|
"navigationConfig": [Function],
|
|
751646
751679
|
"previewAndTest": [Function],
|
|
@@ -776490,6 +776523,7 @@ new message content.",
|
|
|
776490
776523
|
"email": [Function],
|
|
776491
776524
|
"facebookPreview": [Function],
|
|
776492
776525
|
"gallery": [Function],
|
|
776526
|
+
"inApp": [Function],
|
|
776493
776527
|
"language": [Function],
|
|
776494
776528
|
"navigationConfig": [Function],
|
|
776495
776529
|
"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
|
-
});
|