cap-creatives-ui 8.0.280 → 8.0.321

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.
Files changed (247) hide show
  1. package/.github/workflows/pr-title-check.yml +88 -0
  2. package/app/constants/unified.js +21 -1
  3. package/app/containers/App/constants.js +0 -1
  4. package/app/containers/Login/test/index.test.js +123 -0
  5. package/app/containers/Login/test/selectors.test.js +165 -0
  6. package/app/initialState.js +0 -2
  7. package/app/services/api.js +6 -0
  8. package/app/services/tests/api.test.js +7 -0
  9. package/app/services/tests/getSchema.test.js +95 -0
  10. package/app/utils/common.js +23 -9
  11. package/app/utils/commonUtils.js +64 -93
  12. package/app/utils/tagValidations.js +83 -219
  13. package/app/utils/templateVarUtils.js +172 -0
  14. package/app/utils/tests/common.test.js +265 -323
  15. package/app/utils/tests/commonUtil.test.js +461 -118
  16. package/app/utils/tests/commonUtils.test.js +581 -0
  17. package/app/utils/tests/messageUtils.test.js +95 -0
  18. package/app/utils/tests/smsCharCount.test.js +304 -0
  19. package/app/utils/tests/smsCharCountV2.test.js +213 -10
  20. package/app/utils/tests/tagValidations.test.js +474 -357
  21. package/app/utils/tests/templateVarUtils.test.js +160 -0
  22. package/app/v2Components/CapDeviceContent/index.js +10 -7
  23. package/app/v2Components/CapTagList/index.js +32 -24
  24. package/app/v2Components/CapTagList/style.scss +48 -0
  25. package/app/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +63 -0
  26. package/app/v2Components/CapTagListWithInput/index.js +8 -0
  27. package/app/v2Components/CapWhatsappCTA/index.js +2 -0
  28. package/app/v2Components/CapWhatsappCarouselButton/index.js +32 -14
  29. package/app/v2Components/CapWhatsappCarouselButton/tests/index.test.js +120 -2
  30. package/app/v2Components/CommonTestAndPreview/CustomValuesEditor.js +70 -49
  31. package/app/v2Components/CommonTestAndPreview/DeliverySettings/DeliverySettings.scss +39 -0
  32. package/app/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.js +606 -0
  33. package/app/v2Components/CommonTestAndPreview/DeliverySettings/ModifyDeliverySettings.scss +36 -0
  34. package/app/v2Components/CommonTestAndPreview/DeliverySettings/constants.js +79 -0
  35. package/app/v2Components/CommonTestAndPreview/DeliverySettings/index.js +314 -0
  36. package/app/v2Components/CommonTestAndPreview/DeliverySettings/messages.js +141 -0
  37. package/app/v2Components/CommonTestAndPreview/DeliverySettings/utils/parseSenderDetailsResponse.js +156 -0
  38. package/app/v2Components/CommonTestAndPreview/SendTestMessage.js +57 -1
  39. package/app/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +20 -1
  40. package/app/v2Components/CommonTestAndPreview/UnifiedPreview/index.js +133 -4
  41. package/app/v2Components/CommonTestAndPreview/_commonTestAndPreview.scss +210 -4
  42. package/app/v2Components/CommonTestAndPreview/actions.js +20 -0
  43. package/app/v2Components/CommonTestAndPreview/constants.js +57 -1
  44. package/app/v2Components/CommonTestAndPreview/index.js +878 -156
  45. package/app/v2Components/CommonTestAndPreview/messages.js +41 -3
  46. package/app/v2Components/CommonTestAndPreview/previewApiUtils.js +59 -0
  47. package/app/v2Components/CommonTestAndPreview/reducer.js +47 -0
  48. package/app/v2Components/CommonTestAndPreview/sagas.js +75 -5
  49. package/app/v2Components/CommonTestAndPreview/selectors.js +51 -0
  50. package/app/v2Components/CommonTestAndPreview/tests/CustomValuesEditor.test.js +352 -0
  51. package/app/v2Components/CommonTestAndPreview/tests/DeliverySettings/ModifyDeliverySettings.test.js +1156 -0
  52. package/app/v2Components/CommonTestAndPreview/tests/DeliverySettings/index.test.js +334 -0
  53. package/app/v2Components/CommonTestAndPreview/tests/DeliverySettings/utils/parseSenderDetailsResponse.test.js +576 -0
  54. package/app/v2Components/CommonTestAndPreview/tests/SendTestMessage.test.js +156 -0
  55. package/app/v2Components/CommonTestAndPreview/tests/UnifiedPreview/index.test.js +199 -1
  56. package/app/v2Components/CommonTestAndPreview/tests/actions.test.js +50 -0
  57. package/app/v2Components/CommonTestAndPreview/tests/constants.test.js +18 -7
  58. package/app/v2Components/CommonTestAndPreview/tests/index.test.js +914 -5
  59. package/app/v2Components/CommonTestAndPreview/tests/previewApiUtils.test.js +67 -0
  60. package/app/v2Components/CommonTestAndPreview/tests/reducer.test.js +118 -0
  61. package/app/v2Components/CommonTestAndPreview/tests/sagas.test.js +146 -378
  62. package/app/v2Components/CommonTestAndPreview/tests/selectors.test.js +146 -0
  63. package/app/v2Components/ErrorInfoNote/index.js +24 -26
  64. package/app/v2Components/FormBuilder/index.js +182 -204
  65. package/app/v2Components/FormBuilder/messages.js +4 -8
  66. package/app/v2Components/HtmlEditor/HTMLEditor.js +7 -6
  67. package/app/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +1 -1
  68. package/app/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +928 -17
  69. package/app/v2Components/HtmlEditor/components/CodeEditorPane/index.js +4 -2
  70. package/app/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +452 -3
  71. package/app/v2Components/HtmlEditor/hooks/useValidation.js +12 -9
  72. package/app/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +132 -0
  73. package/app/v2Components/HtmlEditor/utils/htmlValidator.js +4 -2
  74. package/app/v2Components/SmsFallback/SmsFallbackLocalSelector.js +87 -0
  75. package/app/v2Components/SmsFallback/constants.js +73 -0
  76. package/app/v2Components/SmsFallback/index.js +956 -0
  77. package/app/v2Components/SmsFallback/index.scss +265 -0
  78. package/app/v2Components/SmsFallback/messages.js +78 -0
  79. package/app/v2Components/SmsFallback/smsFallbackUtils.js +107 -0
  80. package/app/v2Components/SmsFallback/tests/SmsFallbackLocalSelector.test.js +50 -0
  81. package/app/v2Components/SmsFallback/tests/rcsSmsFallback.acceptance.test.js +147 -0
  82. package/app/v2Components/SmsFallback/tests/smsFallbackHandlers.test.js +304 -0
  83. package/app/v2Components/SmsFallback/tests/smsFallbackUi.test.js +197 -0
  84. package/app/v2Components/SmsFallback/tests/smsFallbackUtils.test.js +261 -0
  85. package/app/v2Components/SmsFallback/tests/useLocalTemplateList.test.js +422 -0
  86. package/app/v2Components/SmsFallback/useLocalTemplateList.js +92 -0
  87. package/app/v2Components/TestAndPreviewSlidebox/index.js +22 -1
  88. package/app/v2Components/TestAndPreviewSlidebox/sagas.js +11 -4
  89. package/app/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +3 -1
  90. package/app/v2Components/VarSegmentMessageEditor/constants.js +2 -0
  91. package/app/v2Components/VarSegmentMessageEditor/index.js +125 -0
  92. package/app/v2Components/VarSegmentMessageEditor/index.scss +46 -0
  93. package/app/v2Containers/BeeEditor/index.js +3 -0
  94. package/app/v2Containers/BeePopupEditor/index.js +9 -2
  95. package/app/v2Containers/Cap/mockData.js +0 -14
  96. package/app/v2Containers/Cap/reducer.js +3 -55
  97. package/app/v2Containers/Cap/tests/reducer.test.js +0 -102
  98. package/app/v2Containers/CommunicationFlow/CommunicationFlow.js +291 -0
  99. package/app/v2Containers/CommunicationFlow/CommunicationFlow.scss +25 -0
  100. package/app/v2Containers/CommunicationFlow/Tests/CommunicationFlow.test.js +255 -0
  101. package/app/v2Containers/CommunicationFlow/constants.js +200 -0
  102. package/app/v2Containers/CommunicationFlow/index.js +102 -0
  103. package/app/v2Containers/CommunicationFlow/messages.js +346 -0
  104. package/app/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.js +522 -0
  105. package/app/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/ChannelSelectionStep.scss +170 -0
  106. package/app/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/Tests/ChannelSelectionStep.test.js +796 -0
  107. package/app/v2Containers/CommunicationFlow/steps/ChannelSelectionStep/index.js +5 -0
  108. package/app/v2Containers/CommunicationFlow/steps/CommunicationStrategyStep/CommunicationStrategyStep.js +95 -0
  109. package/app/v2Containers/CommunicationFlow/steps/CommunicationStrategyStep/Tests/CommunicationStrategyStep.test.js +133 -0
  110. package/app/v2Containers/CommunicationFlow/steps/CommunicationStrategyStep/index.js +5 -0
  111. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/DeliverySettingsSection.js +289 -0
  112. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/DeliverySettingsSection.scss +70 -0
  113. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.js +319 -0
  114. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/SenderDetails.scss +69 -0
  115. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/DeliverySettingsSection.test.js +616 -0
  116. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/SenderDetails.test.js +577 -0
  117. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/Tests/deliverySettingsConfig.test.js +1111 -0
  118. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/deliverySettingsConfig.js +696 -0
  119. package/app/v2Containers/CommunicationFlow/steps/DeliverySettingsStep/index.js +7 -0
  120. package/app/v2Containers/CommunicationFlow/steps/DynamicControlsStep/DynamicControlsStep.js +102 -0
  121. package/app/v2Containers/CommunicationFlow/steps/DynamicControlsStep/DynamicControlsStep.scss +36 -0
  122. package/app/v2Containers/CommunicationFlow/steps/DynamicControlsStep/Tests/DynamicControlsStep.test.js +91 -0
  123. package/app/v2Containers/CommunicationFlow/steps/DynamicControlsStep/index.js +5 -0
  124. package/app/v2Containers/CommunicationFlow/steps/MessageTypeStep/MessageTypeStep.js +86 -0
  125. package/app/v2Containers/CommunicationFlow/steps/MessageTypeStep/Tests/MessageTypeStep.test.js +100 -0
  126. package/app/v2Containers/CommunicationFlow/steps/MessageTypeStep/index.js +5 -0
  127. package/app/v2Containers/CommunicationFlow/utils/getEnabledSteps.js +30 -0
  128. package/app/v2Containers/CreativesContainer/CreativesSlideBoxWrapper.js +43 -0
  129. package/app/v2Containers/CreativesContainer/SlideBoxContent.js +127 -11
  130. package/app/v2Containers/CreativesContainer/SlideBoxFooter.js +62 -9
  131. package/app/v2Containers/CreativesContainer/SlideBoxHeader.js +29 -4
  132. package/app/v2Containers/CreativesContainer/constants.js +24 -0
  133. package/app/v2Containers/CreativesContainer/embeddedSlideboxUtils.js +67 -0
  134. package/app/v2Containers/CreativesContainer/index.js +346 -71
  135. package/app/v2Containers/CreativesContainer/index.scss +51 -1
  136. package/app/v2Containers/CreativesContainer/messages.js +12 -0
  137. package/app/v2Containers/CreativesContainer/tests/SlideBoxContent.localTemplates.test.js +90 -0
  138. package/app/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +69 -1
  139. package/app/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +443 -0
  140. package/app/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +110 -0
  141. package/app/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +147 -4
  142. package/app/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +363 -0
  143. package/app/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +57 -10
  144. package/app/v2Containers/CreativesContainer/tests/embeddedSlideboxUtils.test.js +258 -0
  145. package/app/v2Containers/CreativesContainer/tests/index.test.js +71 -9
  146. package/app/v2Containers/CreativesContainer/tests/useLocalTemplatesProp.test.js +125 -0
  147. package/app/v2Containers/Email/index.js +2 -5
  148. package/app/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +58 -77
  149. package/app/v2Containers/EmailWrapper/components/EmailWrapperView.js +3 -0
  150. package/app/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +158 -89
  151. package/app/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +16 -1
  152. package/app/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +17 -12
  153. package/app/v2Containers/EmailWrapper/index.js +4 -0
  154. package/app/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +1 -0
  155. package/app/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +133 -0
  156. package/app/v2Containers/FTP/index.js +2 -51
  157. package/app/v2Containers/FTP/messages.js +0 -4
  158. package/app/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +110 -155
  159. package/app/v2Containers/InApp/index.js +297 -118
  160. package/app/v2Containers/InApp/tests/index.test.js +17 -6
  161. package/app/v2Containers/InApp/tests/mockData.js +1 -1
  162. package/app/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +19 -0
  163. package/app/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +3 -0
  164. package/app/v2Containers/InAppWrapper/index.js +3 -0
  165. package/app/v2Containers/InappAdvance/index.js +5 -104
  166. package/app/v2Containers/InappAdvance/tests/index.test.js +2 -0
  167. package/app/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +24 -3
  168. package/app/v2Containers/Line/Container/Text/index.js +0 -1
  169. package/app/v2Containers/MobilePush/Create/index.js +105 -28
  170. package/app/v2Containers/MobilePush/Create/messages.js +4 -0
  171. package/app/v2Containers/MobilePush/Edit/index.js +250 -68
  172. package/app/v2Containers/MobilePush/Edit/messages.js +4 -0
  173. package/app/v2Containers/MobilePushNew/components/PlatformContentFields.js +36 -12
  174. package/app/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +68 -27
  175. package/app/v2Containers/MobilePushNew/index.js +78 -35
  176. package/app/v2Containers/MobilePushNew/messages.js +8 -0
  177. package/app/v2Containers/MobilepushWrapper/index.js +11 -1
  178. package/app/v2Containers/Rcs/constants.js +32 -1
  179. package/app/v2Containers/Rcs/index.js +963 -916
  180. package/app/v2Containers/Rcs/index.scss +85 -6
  181. package/app/v2Containers/Rcs/messages.js +10 -1
  182. package/app/v2Containers/Rcs/rcsLibraryHydrationUtils.js +205 -0
  183. package/app/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +41136 -1566
  184. package/app/v2Containers/Rcs/tests/__snapshots__/utils.test.js.snap +0 -5
  185. package/app/v2Containers/Rcs/tests/index.test.js +41 -38
  186. package/app/v2Containers/Rcs/tests/mockData.js +38 -0
  187. package/app/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +251 -0
  188. package/app/v2Containers/Rcs/tests/utils.test.js +379 -1
  189. package/app/v2Containers/Rcs/utils.js +358 -10
  190. package/app/v2Containers/Sms/Create/index.js +122 -39
  191. package/app/v2Containers/Sms/Create/messages.js +4 -0
  192. package/app/v2Containers/Sms/Edit/index.js +37 -3
  193. package/app/v2Containers/Sms/commonMethods.js +3 -6
  194. package/app/v2Containers/Sms/smsFormDataHelpers.js +67 -0
  195. package/app/v2Containers/Sms/tests/commonMethods.test.js +122 -0
  196. package/app/v2Containers/Sms/tests/smsFormDataHelpers.test.js +253 -0
  197. package/app/v2Containers/SmsTrai/Create/index.js +9 -4
  198. package/app/v2Containers/SmsTrai/Create/index.scss +1 -1
  199. package/app/v2Containers/SmsTrai/Edit/constants.js +2 -0
  200. package/app/v2Containers/SmsTrai/Edit/index.js +667 -160
  201. package/app/v2Containers/SmsTrai/Edit/index.scss +121 -0
  202. package/app/v2Containers/SmsTrai/Edit/messages.js +9 -4
  203. package/app/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4590 -2436
  204. package/app/v2Containers/SmsWrapper/index.js +41 -8
  205. package/app/v2Containers/TagList/index.js +63 -2
  206. package/app/v2Containers/TagList/messages.js +8 -0
  207. package/app/v2Containers/TagList/tests/TagList.test.js +122 -20
  208. package/app/v2Containers/TagList/tests/mockdata.js +17 -0
  209. package/app/v2Containers/Templates/TemplatesActionBar.js +101 -0
  210. package/app/v2Containers/Templates/_templates.scss +61 -2
  211. package/app/v2Containers/Templates/actions.js +11 -0
  212. package/app/v2Containers/Templates/constants.js +2 -0
  213. package/app/v2Containers/Templates/index.js +90 -40
  214. package/app/v2Containers/Templates/reducer.js +3 -1
  215. package/app/v2Containers/Templates/sagas.js +57 -12
  216. package/app/v2Containers/Templates/tests/TemplatesActionBar.test.js +120 -0
  217. package/app/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1043 -1079
  218. package/app/v2Containers/Templates/tests/reducer.test.js +12 -0
  219. package/app/v2Containers/Templates/tests/sagas.test.js +193 -12
  220. package/app/v2Containers/Templates/tests/smsTemplatesListApi.test.js +180 -0
  221. package/app/v2Containers/Templates/utils/smsTemplatesListApi.js +79 -0
  222. package/app/v2Containers/TemplatesV2/TemplatesV2.style.js +72 -1
  223. package/app/v2Containers/TemplatesV2/index.js +147 -49
  224. package/app/v2Containers/TemplatesV2/tests/TemplatesV2.localTemplates.test.js +131 -0
  225. package/app/v2Containers/Viber/index.js +9 -10
  226. package/app/v2Containers/Viber/index.scss +1 -1
  227. package/app/v2Containers/WebPush/Create/components/BrandIconSection.test.js +264 -0
  228. package/app/v2Containers/WebPush/Create/components/MessageSection.js +78 -19
  229. package/app/v2Containers/WebPush/Create/components/MessageSection.test.js +82 -0
  230. package/app/v2Containers/WebPush/Create/components/__snapshots__/BrandIconSection.test.js.snap +187 -0
  231. package/app/v2Containers/WebPush/Create/components/__snapshots__/MessageSection.test.js.snap +25 -17
  232. package/app/v2Containers/WebPush/Create/hooks/useAiraTriggerPosition.js +80 -0
  233. package/app/v2Containers/WebPush/Create/hooks/useAiraTriggerPosition.test.js +210 -0
  234. package/app/v2Containers/WebPush/Create/hooks/useTagManagement.js +1 -5
  235. package/app/v2Containers/WebPush/Create/hooks/useTagManagement.test.js +0 -7
  236. package/app/v2Containers/WebPush/Create/index.js +36 -6
  237. package/app/v2Containers/WebPush/Create/index.scss +5 -0
  238. package/app/v2Containers/WebPush/Create/messages.js +8 -1
  239. package/app/v2Containers/WebPush/Create/preview/tests/NotificationContainer.test.js +269 -0
  240. package/app/v2Containers/WebPush/Create/utils/validation.js +31 -15
  241. package/app/v2Containers/WebPush/Create/utils/validation.test.js +72 -24
  242. package/app/v2Containers/Whatsapp/index.js +28 -53
  243. package/app/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +26939 -3982
  244. package/app/v2Containers/Whatsapp/tests/index.test.js +172 -0
  245. package/app/v2Containers/Zalo/index.js +5 -11
  246. package/package.json +2 -2
  247. package/version +9 -0
@@ -1,7 +1,7 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`Test SlideBoxContent container campaign message, add creative click rcs 1`] = `
4
- <CreativesContainer__SlideBoxWrapper
4
+ <CreativesSlideBoxWrapper
5
5
  className="add-creatives-section creatives-library-mode "
6
6
  shouldApplyFooterMargin={false}
7
7
  slideBoxWrapperMargin={0}
@@ -12,14 +12,18 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
12
12
  closeIconType="close"
13
13
  content={
14
14
  <SlideBoxContent
15
+ channelsToHide={Array []}
15
16
  currentChannel="RCS"
17
+ customerType=""
16
18
  getFormData={[Function]}
17
19
  handleClose={[Function]}
18
20
  handleCloseTestAndPreview={[Function]}
19
21
  handleTestAndPreview={[Function]}
20
22
  hostName=""
21
23
  inAppEditorType={null}
24
+ isAnonymousType={false}
22
25
  isTestAndPreviewMode={false}
26
+ localTemplatesConfig={Object {}}
23
27
  loyaltyMetaData={
24
28
  Object {
25
29
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -38,6 +42,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
38
42
  onInAppEditorTypeChange={[Function]}
39
43
  onInAppModeChange={[Function]}
40
44
  onMobilepushModeChange={[Function]}
45
+ onPersonalizationTokensChange={[Function]}
41
46
  onPreviewTemplate={[Function]}
42
47
  onRemoveTemplateName={[Function]}
43
48
  onResetStep={[Function]}
@@ -46,6 +51,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
46
51
  onValidationFail={[Function]}
47
52
  onWeChatMaptemplateStepChange={[Function]}
48
53
  onWechatTemplateChange={[Function]}
54
+ restrictPersonalization={false}
49
55
  saveMessage={[Function]}
50
56
  setIsLoadingContent={[Function]}
51
57
  showLiquidErrorInFooter={[Function]}
@@ -80,6 +86,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
80
86
  }
81
87
  templateNameRenderProp={[Function]}
82
88
  templateStep="modeSelection"
89
+ useLocalTemplates={false}
83
90
  weChatMaptemplateStep={0}
84
91
  weChatTemplateType=""
85
92
  />
@@ -88,11 +95,11 @@ exports[`Test SlideBoxContent container campaign message, add creative click rcs
88
95
  show={true}
89
96
  size="size-xl"
90
97
  />
91
- </CreativesContainer__SlideBoxWrapper>
98
+ </CreativesSlideBoxWrapper>
92
99
  `;
93
100
 
94
101
  exports[`Test SlideBoxContent container campaign message, add creative click whatsapp 1`] = `
95
- <CreativesContainer__SlideBoxWrapper
102
+ <CreativesSlideBoxWrapper
96
103
  className="add-creatives-section creatives-library-mode "
97
104
  shouldApplyFooterMargin={false}
98
105
  slideBoxWrapperMargin={0}
@@ -103,14 +110,18 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
103
110
  closeIconType="close"
104
111
  content={
105
112
  <SlideBoxContent
113
+ channelsToHide={Array []}
106
114
  currentChannel="WHATSAPP"
115
+ customerType=""
107
116
  getFormData={[Function]}
108
117
  handleClose={[Function]}
109
118
  handleCloseTestAndPreview={[Function]}
110
119
  handleTestAndPreview={[Function]}
111
120
  hostName=""
112
121
  inAppEditorType={null}
122
+ isAnonymousType={false}
113
123
  isTestAndPreviewMode={false}
124
+ localTemplatesConfig={Object {}}
114
125
  loyaltyMetaData={
115
126
  Object {
116
127
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -129,6 +140,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
129
140
  onInAppEditorTypeChange={[Function]}
130
141
  onInAppModeChange={[Function]}
131
142
  onMobilepushModeChange={[Function]}
143
+ onPersonalizationTokensChange={[Function]}
132
144
  onPreviewTemplate={[Function]}
133
145
  onRemoveTemplateName={[Function]}
134
146
  onResetStep={[Function]}
@@ -137,6 +149,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
137
149
  onValidationFail={[Function]}
138
150
  onWeChatMaptemplateStepChange={[Function]}
139
151
  onWechatTemplateChange={[Function]}
152
+ restrictPersonalization={false}
140
153
  saveMessage={[Function]}
141
154
  setIsLoadingContent={[Function]}
142
155
  showLiquidErrorInFooter={[Function]}
@@ -171,6 +184,7 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
171
184
  }
172
185
  templateNameRenderProp={[Function]}
173
186
  templateStep="modeSelection"
187
+ useLocalTemplates={false}
174
188
  weChatMaptemplateStep={0}
175
189
  weChatTemplateType=""
176
190
  />
@@ -179,11 +193,11 @@ exports[`Test SlideBoxContent container campaign message, add creative click wha
179
193
  show={true}
180
194
  size="size-xl"
181
195
  />
182
- </CreativesContainer__SlideBoxWrapper>
196
+ </CreativesSlideBoxWrapper>
183
197
  `;
184
198
 
185
199
  exports[`Test SlideBoxContent container campaign message, whatsapp edit all data 1`] = `
186
- <CreativesContainer__SlideBoxWrapper
200
+ <CreativesSlideBoxWrapper
187
201
  className="add-creatives-section creatives-library-mode "
188
202
  shouldApplyFooterMargin={false}
189
203
  slideBoxWrapperMargin={0}
@@ -194,14 +208,18 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
194
208
  closeIconType="close"
195
209
  content={
196
210
  <SlideBoxContent
211
+ channelsToHide={Array []}
197
212
  currentChannel="WHATSAPP"
213
+ customerType=""
198
214
  getFormData={[Function]}
199
215
  handleClose={[Function]}
200
216
  handleCloseTestAndPreview={[Function]}
201
217
  handleTestAndPreview={[Function]}
202
218
  hostName=""
203
219
  inAppEditorType={null}
220
+ isAnonymousType={false}
204
221
  isTestAndPreviewMode={false}
222
+ localTemplatesConfig={Object {}}
205
223
  loyaltyMetaData={
206
224
  Object {
207
225
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -220,6 +238,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
220
238
  onInAppEditorTypeChange={[Function]}
221
239
  onInAppModeChange={[Function]}
222
240
  onMobilepushModeChange={[Function]}
241
+ onPersonalizationTokensChange={[Function]}
223
242
  onPreviewTemplate={[Function]}
224
243
  onRemoveTemplateName={[Function]}
225
244
  onResetStep={[Function]}
@@ -228,6 +247,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
228
247
  onValidationFail={[Function]}
229
248
  onWeChatMaptemplateStepChange={[Function]}
230
249
  onWechatTemplateChange={[Function]}
250
+ restrictPersonalization={false}
231
251
  saveMessage={[Function]}
232
252
  setIsLoadingContent={[Function]}
233
253
  showLiquidErrorInFooter={[Function]}
@@ -257,6 +277,8 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
257
277
  }
258
278
  }
259
279
  fetchingCmsData={false}
280
+ formData={Array []}
281
+ hasPersonalizationTokenError={false}
260
282
  htmlEditorValidationState={
261
283
  Object {
262
284
  "errorsAcknowledged": false,
@@ -269,6 +291,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
269
291
  "validationComplete": false,
270
292
  }
271
293
  }
294
+ isAnonymousType={false}
272
295
  isContinueButtonDisabled={false}
273
296
  isCreatingTemplate={false}
274
297
  isEmptyContent={false}
@@ -280,6 +303,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
280
303
  onEditTemplate={[Function]}
281
304
  onSave={[Function]}
282
305
  onTestAndPreview={[Function]}
306
+ restrictPersonalization={false}
283
307
  selectedEmailCreateMode={null}
284
308
  shouldShowContinueFooter={[Function]}
285
309
  shouldShowDoneFooter={[Function]}
@@ -300,6 +324,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
300
324
  slidBoxContent="editTemplate"
301
325
  templateNameRenderProp={[Function]}
302
326
  templateStep="modeSelection"
327
+ useLocalTemplates={false}
303
328
  weChatMaptemplateStep={0}
304
329
  weChatTemplateType=""
305
330
  />
@@ -308,11 +333,11 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit all data
308
333
  show={false}
309
334
  size="size-xl"
310
335
  />
311
- </CreativesContainer__SlideBoxWrapper>
336
+ </CreativesSlideBoxWrapper>
312
337
  `;
313
338
 
314
339
  exports[`Test SlideBoxContent container campaign message, whatsapp edit min data 1`] = `
315
- <CreativesContainer__SlideBoxWrapper
340
+ <CreativesSlideBoxWrapper
316
341
  className="add-creatives-section creatives-library-mode "
317
342
  shouldApplyFooterMargin={false}
318
343
  slideBoxWrapperMargin={0}
@@ -323,14 +348,18 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
323
348
  closeIconType="close"
324
349
  content={
325
350
  <SlideBoxContent
351
+ channelsToHide={Array []}
326
352
  currentChannel="WHATSAPP"
353
+ customerType=""
327
354
  getFormData={[Function]}
328
355
  handleClose={[Function]}
329
356
  handleCloseTestAndPreview={[Function]}
330
357
  handleTestAndPreview={[Function]}
331
358
  hostName=""
332
359
  inAppEditorType={null}
360
+ isAnonymousType={false}
333
361
  isTestAndPreviewMode={false}
362
+ localTemplatesConfig={Object {}}
334
363
  loyaltyMetaData={
335
364
  Object {
336
365
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -349,6 +378,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
349
378
  onInAppEditorTypeChange={[Function]}
350
379
  onInAppModeChange={[Function]}
351
380
  onMobilepushModeChange={[Function]}
381
+ onPersonalizationTokensChange={[Function]}
352
382
  onPreviewTemplate={[Function]}
353
383
  onRemoveTemplateName={[Function]}
354
384
  onResetStep={[Function]}
@@ -357,6 +387,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
357
387
  onValidationFail={[Function]}
358
388
  onWeChatMaptemplateStepChange={[Function]}
359
389
  onWechatTemplateChange={[Function]}
390
+ restrictPersonalization={false}
360
391
  saveMessage={[Function]}
361
392
  setIsLoadingContent={[Function]}
362
393
  showLiquidErrorInFooter={[Function]}
@@ -386,6 +417,8 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
386
417
  }
387
418
  }
388
419
  fetchingCmsData={false}
420
+ formData={Array []}
421
+ hasPersonalizationTokenError={false}
389
422
  htmlEditorValidationState={
390
423
  Object {
391
424
  "errorsAcknowledged": false,
@@ -398,6 +431,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
398
431
  "validationComplete": false,
399
432
  }
400
433
  }
434
+ isAnonymousType={false}
401
435
  isContinueButtonDisabled={false}
402
436
  isCreatingTemplate={false}
403
437
  isEmptyContent={false}
@@ -409,6 +443,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
409
443
  onEditTemplate={[Function]}
410
444
  onSave={[Function]}
411
445
  onTestAndPreview={[Function]}
446
+ restrictPersonalization={false}
412
447
  selectedEmailCreateMode={null}
413
448
  shouldShowContinueFooter={[Function]}
414
449
  shouldShowDoneFooter={[Function]}
@@ -429,6 +464,7 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
429
464
  slidBoxContent="editTemplate"
430
465
  templateNameRenderProp={[Function]}
431
466
  templateStep="modeSelection"
467
+ useLocalTemplates={false}
432
468
  weChatMaptemplateStep={0}
433
469
  weChatTemplateType=""
434
470
  />
@@ -437,11 +473,11 @@ exports[`Test SlideBoxContent container campaign message, whatsapp edit min data
437
473
  show={false}
438
474
  size="size-xl"
439
475
  />
440
- </CreativesContainer__SlideBoxWrapper>
476
+ </CreativesSlideBoxWrapper>
441
477
  `;
442
478
 
443
479
  exports[`Test SlideBoxContent container it should clear the url, on channel change from new whatsapp to another 1`] = `
444
- <CreativesContainer__SlideBoxWrapper
480
+ <CreativesSlideBoxWrapper
445
481
  className="add-creatives-section creatives-library-mode "
446
482
  shouldApplyFooterMargin={false}
447
483
  slideBoxWrapperMargin={0}
@@ -452,14 +488,18 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
452
488
  closeIconType="close"
453
489
  content={
454
490
  <SlideBoxContent
491
+ channelsToHide={Array []}
455
492
  currentChannel="WHATSAPP"
493
+ customerType=""
456
494
  getFormData={[Function]}
457
495
  handleClose={[Function]}
458
496
  handleCloseTestAndPreview={[Function]}
459
497
  handleTestAndPreview={[Function]}
460
498
  hostName=""
461
499
  inAppEditorType={null}
500
+ isAnonymousType={false}
462
501
  isTestAndPreviewMode={false}
502
+ localTemplatesConfig={Object {}}
463
503
  loyaltyMetaData={
464
504
  Object {
465
505
  "actionName": "SEND_COMMUNICATION_ACTION",
@@ -478,6 +518,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
478
518
  onInAppEditorTypeChange={[Function]}
479
519
  onInAppModeChange={[Function]}
480
520
  onMobilepushModeChange={[Function]}
521
+ onPersonalizationTokensChange={[Function]}
481
522
  onPreviewTemplate={[Function]}
482
523
  onRemoveTemplateName={[Function]}
483
524
  onResetStep={[Function]}
@@ -486,6 +527,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
486
527
  onValidationFail={[Function]}
487
528
  onWeChatMaptemplateStepChange={[Function]}
488
529
  onWechatTemplateChange={[Function]}
530
+ restrictPersonalization={false}
489
531
  saveMessage={[Function]}
490
532
  setIsLoadingContent={[Function]}
491
533
  showLiquidErrorInFooter={[Function]}
@@ -515,6 +557,8 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
515
557
  }
516
558
  }
517
559
  fetchingCmsData={false}
560
+ formData={Array []}
561
+ hasPersonalizationTokenError={false}
518
562
  htmlEditorValidationState={
519
563
  Object {
520
564
  "errorsAcknowledged": false,
@@ -527,6 +571,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
527
571
  "validationComplete": false,
528
572
  }
529
573
  }
574
+ isAnonymousType={false}
530
575
  isContinueButtonDisabled={false}
531
576
  isCreatingTemplate={false}
532
577
  isEmptyContent={false}
@@ -538,6 +583,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
538
583
  onEditTemplate={[Function]}
539
584
  onSave={[Function]}
540
585
  onTestAndPreview={[Function]}
586
+ restrictPersonalization={false}
541
587
  selectedEmailCreateMode={null}
542
588
  shouldShowContinueFooter={[Function]}
543
589
  shouldShowDoneFooter={[Function]}
@@ -558,6 +604,7 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
558
604
  slidBoxContent="editTemplate"
559
605
  templateNameRenderProp={[Function]}
560
606
  templateStep="modeSelection"
607
+ useLocalTemplates={false}
561
608
  weChatMaptemplateStep={0}
562
609
  weChatTemplateType=""
563
610
  />
@@ -566,5 +613,5 @@ exports[`Test SlideBoxContent container it should clear the url, on channel chan
566
613
  show={false}
567
614
  size="size-xl"
568
615
  />
569
- </CreativesContainer__SlideBoxWrapper>
616
+ </CreativesSlideBoxWrapper>
570
617
  `;
@@ -0,0 +1,258 @@
1
+ import {
2
+ CAP_SPACE_32,
3
+ CAP_SPACE_56,
4
+ CAP_SPACE_64,
5
+ } from '@capillarytech/cap-ui-library/styled/variables';
6
+ import {
7
+ isDeepEmpty,
8
+ getSlideBoxWrapperMarginFromLiquidErrors,
9
+ computeLiquidFooterUpdateFromFormBuilder,
10
+ } from '../embeddedSlideboxUtils';
11
+ import { ANDROID, IOS, MOBILE_PUSH, LIQUID_ERROR_MSG, STANDARD_ERROR_MSG } from '../constants';
12
+
13
+ // ---------------------------------------------------------------------------
14
+ // isDeepEmpty
15
+ // ---------------------------------------------------------------------------
16
+
17
+ describe('isDeepEmpty', () => {
18
+ it('returns true for null', () => {
19
+ expect(isDeepEmpty(null)).toBe(true);
20
+ });
21
+
22
+ it('returns true for undefined', () => {
23
+ expect(isDeepEmpty(undefined)).toBe(true);
24
+ });
25
+
26
+ it('returns true for empty string', () => {
27
+ expect(isDeepEmpty('')).toBe(true);
28
+ });
29
+
30
+ it('returns false for non-empty string', () => {
31
+ expect(isDeepEmpty('hello')).toBe(false);
32
+ });
33
+
34
+ it('returns true for empty array', () => {
35
+ expect(isDeepEmpty([])).toBe(true);
36
+ });
37
+
38
+ it('returns false for non-empty array', () => {
39
+ expect(isDeepEmpty(['item'])).toBe(false);
40
+ });
41
+
42
+ it('returns true for empty object', () => {
43
+ expect(isDeepEmpty({})).toBe(true);
44
+ });
45
+
46
+ it('returns true for object where all values are deep-empty', () => {
47
+ expect(isDeepEmpty({ a: null, b: '', c: [] })).toBe(true);
48
+ });
49
+
50
+ it('returns false for object with at least one non-empty value', () => {
51
+ expect(isDeepEmpty({ a: null, b: 'something' })).toBe(false);
52
+ });
53
+
54
+ it('returns true for nested all-empty object', () => {
55
+ expect(isDeepEmpty({ a: { b: null, c: [] } })).toBe(true);
56
+ });
57
+
58
+ it('returns false for nested object with a non-empty leaf', () => {
59
+ expect(isDeepEmpty({ a: { b: 'value' } })).toBe(false);
60
+ });
61
+
62
+ it('returns false for a number (non-null, non-string, non-array, non-object)', () => {
63
+ expect(isDeepEmpty(0)).toBe(false);
64
+ expect(isDeepEmpty(42)).toBe(false);
65
+ });
66
+
67
+ it('returns false for a boolean false', () => {
68
+ expect(isDeepEmpty(false)).toBe(false);
69
+ });
70
+ });
71
+
72
+ // ---------------------------------------------------------------------------
73
+ // getSlideBoxWrapperMarginFromLiquidErrors
74
+ // ---------------------------------------------------------------------------
75
+
76
+ describe('getSlideBoxWrapperMarginFromLiquidErrors', () => {
77
+ it('returns 0 when liquidErrorMessage is null', () => {
78
+ expect(getSlideBoxWrapperMarginFromLiquidErrors(null)).toBe(0);
79
+ });
80
+
81
+ it('returns 0 when liquidErrorMessage is undefined', () => {
82
+ expect(getSlideBoxWrapperMarginFromLiquidErrors(undefined)).toBe(0);
83
+ });
84
+
85
+ it('returns 0 when both error arrays are empty', () => {
86
+ expect(getSlideBoxWrapperMarginFromLiquidErrors({
87
+ STANDARD_ERROR_MSG: [],
88
+ LIQUID_ERROR_MSG: [],
89
+ })).toBe(0);
90
+ });
91
+
92
+ it('returns 0 when neither error array is present', () => {
93
+ expect(getSlideBoxWrapperMarginFromLiquidErrors({})).toBe(0);
94
+ });
95
+
96
+ it('returns CAP_SPACE_64 when both STANDARD and LIQUID errors are present', () => {
97
+ expect(getSlideBoxWrapperMarginFromLiquidErrors({
98
+ STANDARD_ERROR_MSG: ['std error'],
99
+ LIQUID_ERROR_MSG: ['liquid error'],
100
+ })).toBe(CAP_SPACE_64);
101
+ });
102
+
103
+ it('returns CAP_SPACE_56 when only LIQUID errors are present', () => {
104
+ expect(getSlideBoxWrapperMarginFromLiquidErrors({
105
+ STANDARD_ERROR_MSG: [],
106
+ LIQUID_ERROR_MSG: ['liquid error'],
107
+ })).toBe(CAP_SPACE_56);
108
+ });
109
+
110
+ it('returns CAP_SPACE_32 when only STANDARD errors are present', () => {
111
+ expect(getSlideBoxWrapperMarginFromLiquidErrors({
112
+ STANDARD_ERROR_MSG: ['std error'],
113
+ LIQUID_ERROR_MSG: [],
114
+ })).toBe(CAP_SPACE_32);
115
+ });
116
+
117
+ it('returns CAP_SPACE_56 when LIQUID has multiple errors and STANDARD is absent', () => {
118
+ expect(getSlideBoxWrapperMarginFromLiquidErrors({
119
+ LIQUID_ERROR_MSG: ['err1', 'err2'],
120
+ })).toBe(CAP_SPACE_56);
121
+ });
122
+
123
+ it('returns CAP_SPACE_32 when STANDARD has multiple errors and LIQUID is absent', () => {
124
+ expect(getSlideBoxWrapperMarginFromLiquidErrors({
125
+ STANDARD_ERROR_MSG: ['err1', 'err2'],
126
+ })).toBe(CAP_SPACE_32);
127
+ });
128
+ });
129
+
130
+ // ---------------------------------------------------------------------------
131
+ // computeLiquidFooterUpdateFromFormBuilder
132
+ // ---------------------------------------------------------------------------
133
+
134
+ describe('computeLiquidFooterUpdateFromFormBuilder', () => {
135
+ const noErrors = { [LIQUID_ERROR_MSG]: [], [STANDARD_ERROR_MSG]: [] };
136
+ const liquidOnly = { [LIQUID_ERROR_MSG]: ['liquid err'], [STANDARD_ERROR_MSG]: [] };
137
+ const standardOnly = { [LIQUID_ERROR_MSG]: [], [STANDARD_ERROR_MSG]: ['std err'] };
138
+ const bothErrors = { [LIQUID_ERROR_MSG]: ['l'], [STANDARD_ERROR_MSG]: ['s'] };
139
+
140
+ describe('normal (non-null) returns', () => {
141
+ it('returns isLiquidValidationError=false when no errors', () => {
142
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 1, {
143
+ previousIsLiquidValidationError: false,
144
+ currentChannelUpper: 'SMS',
145
+ });
146
+ expect(result).not.toBeNull();
147
+ expect(result.isLiquidValidationError).toBe(false);
148
+ expect(result.liquidErrorMessage).toEqual(noErrors);
149
+ });
150
+
151
+ it('sets isLiquidValidationError=true when liquid errors present', () => {
152
+ const result = computeLiquidFooterUpdateFromFormBuilder(liquidOnly, 1, {
153
+ previousIsLiquidValidationError: false,
154
+ currentChannelUpper: 'SMS',
155
+ });
156
+ expect(result.isLiquidValidationError).toBe(true);
157
+ });
158
+
159
+ it('sets isLiquidValidationError=true when standard errors present', () => {
160
+ const result = computeLiquidFooterUpdateFromFormBuilder(standardOnly, 1, {
161
+ previousIsLiquidValidationError: false,
162
+ currentChannelUpper: 'SMS',
163
+ });
164
+ expect(result.isLiquidValidationError).toBe(true);
165
+ });
166
+
167
+ it('sets isLiquidValidationError=true when both errors present', () => {
168
+ const result = computeLiquidFooterUpdateFromFormBuilder(bothErrors, 1, {
169
+ previousIsLiquidValidationError: false,
170
+ currentChannelUpper: 'SMS',
171
+ });
172
+ expect(result.isLiquidValidationError).toBe(true);
173
+ });
174
+
175
+ it('maps tab 1 to ANDROID', () => {
176
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 1, {
177
+ previousIsLiquidValidationError: false,
178
+ currentChannelUpper: 'SMS',
179
+ });
180
+ expect(result.activeFormBuilderTab).toBe(ANDROID);
181
+ });
182
+
183
+ it('maps tab 2 to IOS', () => {
184
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 2, {
185
+ previousIsLiquidValidationError: false,
186
+ currentChannelUpper: 'SMS',
187
+ });
188
+ expect(result.activeFormBuilderTab).toBe(IOS);
189
+ });
190
+
191
+ it('maps tab 3 (or any other tab) to null', () => {
192
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 3, {
193
+ previousIsLiquidValidationError: false,
194
+ currentChannelUpper: 'SMS',
195
+ });
196
+ expect(result.activeFormBuilderTab).toBeNull();
197
+ });
198
+
199
+ it('maps undefined tab to null for activeFormBuilderTab', () => {
200
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, undefined, {
201
+ previousIsLiquidValidationError: false,
202
+ currentChannelUpper: 'SMS',
203
+ });
204
+ expect(result.activeFormBuilderTab).toBeNull();
205
+ });
206
+
207
+ it('does NOT return null for Mobile Push when errors ARE present', () => {
208
+ const result = computeLiquidFooterUpdateFromFormBuilder(liquidOnly, 1, {
209
+ previousIsLiquidValidationError: true,
210
+ currentChannelUpper: MOBILE_PUSH,
211
+ });
212
+ expect(result).not.toBeNull();
213
+ expect(result.isLiquidValidationError).toBe(true);
214
+ });
215
+
216
+ it('does NOT return null for non-Mobile Push channel even with previousIsLiquidValidationError', () => {
217
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 1, {
218
+ previousIsLiquidValidationError: true,
219
+ currentChannelUpper: 'SMS',
220
+ });
221
+ expect(result).not.toBeNull();
222
+ expect(result.isLiquidValidationError).toBe(false);
223
+ });
224
+
225
+ it('works without options argument (uses defaults)', () => {
226
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 1);
227
+ expect(result).not.toBeNull();
228
+ expect(result.isLiquidValidationError).toBe(false);
229
+ });
230
+ });
231
+
232
+ describe('Mobile Push OLD clear (returns null)', () => {
233
+ it('returns null when no errors and previousIsLiquidValidationError is true for MOBILEPUSH', () => {
234
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 1, {
235
+ previousIsLiquidValidationError: true,
236
+ currentChannelUpper: MOBILE_PUSH,
237
+ });
238
+ expect(result).toBeNull();
239
+ });
240
+
241
+ it('does NOT return null when previousIsLiquidValidationError is false for MOBILEPUSH', () => {
242
+ const result = computeLiquidFooterUpdateFromFormBuilder(noErrors, 1, {
243
+ previousIsLiquidValidationError: false,
244
+ currentChannelUpper: MOBILE_PUSH,
245
+ });
246
+ expect(result).not.toBeNull();
247
+ });
248
+
249
+ it('does NOT return null when only standard errors cleared but liquid error remains for MOBILEPUSH', () => {
250
+ const result = computeLiquidFooterUpdateFromFormBuilder(liquidOnly, 1, {
251
+ previousIsLiquidValidationError: true,
252
+ currentChannelUpper: MOBILE_PUSH,
253
+ });
254
+ // hasLiquid = true → condition !hasLiquid is false → does not return null
255
+ expect(result).not.toBeNull();
256
+ });
257
+ });
258
+ });