@capillarytech/creatives-library 8.0.334 → 8.0.335

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 (47) hide show
  1. package/package.json +1 -1
  2. package/utils/tests/tagValidations.test.js +0 -20
  3. package/v2Components/CapTagList/index.js +23 -28
  4. package/v2Components/CapTagList/style.scss +0 -29
  5. package/v2Components/CapTagListWithInput/index.js +0 -4
  6. package/v2Components/CapWhatsappCTA/index.js +0 -2
  7. package/v2Components/FormBuilder/index.js +2 -7
  8. package/v2Components/HtmlEditor/HTMLEditor.js +1 -6
  9. package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -1
  10. package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +2 -927
  11. package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +0 -3
  12. package/v2Containers/BeeEditor/index.js +16 -4
  13. package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -28
  14. package/v2Containers/CreativesContainer/index.js +0 -3
  15. package/v2Containers/Email/index.js +75 -39
  16. package/v2Containers/Email/reducer.js +2 -2
  17. package/v2Containers/Email/sagas.js +3 -1
  18. package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +2 -2
  19. package/v2Containers/Email/tests/sagas.test.js +230 -0
  20. package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1 -6
  21. package/v2Containers/EmailWrapper/components/EmailWrapperView.js +0 -3
  22. package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +2 -20
  23. package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +1 -16
  24. package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +2 -4
  25. package/v2Containers/EmailWrapper/index.js +0 -4
  26. package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -1
  27. package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +0 -9
  28. package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -1
  29. package/v2Containers/MobilePush/Create/index.js +0 -2
  30. package/v2Containers/MobilePush/Edit/index.js +0 -2
  31. package/v2Containers/MobilepushWrapper/index.js +1 -3
  32. package/v2Containers/Rcs/index.js +0 -1
  33. package/v2Containers/Sms/Create/index.js +0 -2
  34. package/v2Containers/Sms/Edit/index.js +0 -2
  35. package/v2Containers/SmsTrai/Edit/index.js +0 -2
  36. package/v2Containers/SmsWrapper/index.js +0 -2
  37. package/v2Containers/TagList/index.js +5 -62
  38. package/v2Containers/TagList/messages.js +0 -4
  39. package/v2Containers/TagList/tests/TagList.test.js +20 -124
  40. package/v2Containers/TagList/tests/mockdata.js +0 -17
  41. package/v2Containers/Viber/index.js +0 -3
  42. package/v2Containers/WebPush/Create/hooks/useTagManagement.js +2 -0
  43. package/v2Containers/WebPush/Create/index.js +1 -9
  44. package/v2Containers/Whatsapp/index.js +0 -5
  45. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -20
  46. package/v2Containers/Zalo/index.js +0 -2
  47. package/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +0 -63
@@ -94,28 +94,10 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
94
94
  }
95
95
 
96
96
  componentDidUpdate(prevProps) {
97
- const {
98
- tags,
99
- injectedTags,
100
- selectedOfferDetails,
101
- eventContextTags,
102
- waitEventContextTags,
103
- } = this.props;
104
- const {
105
- tags: prevTags,
106
- injectedTags: prevInjectedTags,
107
- selectedOfferDetails: prevSelectedOfferDetails,
108
- eventContextTags: prevEventContextTags,
109
- waitEventContextTags: prevWaitEventContextTags,
110
- } = prevProps;
111
-
112
- if (
113
- tags !== prevTags
114
- || injectedTags !== prevInjectedTags
115
- || selectedOfferDetails !== prevSelectedOfferDetails
116
- || !_.isEqual(eventContextTags, prevEventContextTags)
117
- || !_.isEqual(waitEventContextTags, prevWaitEventContextTags)
118
- ) {
97
+ const { tags, injectedTags, selectedOfferDetails } = this.props;
98
+ const { tags: prevTags, injectedTags: prevInjectedTags, selectedOfferDetails: prevSelectedOfferDetails } = prevProps;
99
+
100
+ if (tags !== prevTags || injectedTags !== prevInjectedTags || selectedOfferDetails !== prevSelectedOfferDetails) {
119
101
  this.generateTags(this.props);
120
102
  }
121
103
  }
@@ -180,7 +162,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
180
162
  let injectedTags = {};
181
163
  const eventContextTagsObj = {};
182
164
 
183
- const {selectedOfferDetails, eventContextTags, waitEventContextTags } = props;
165
+ const {selectedOfferDetails, eventContextTags } = props;
184
166
  if (props.injectedTags && !_.isEmpty(props.injectedTags)) {
185
167
  const formattedInjectedTags = handleInjectedData(
186
168
  props.injectedTags,
@@ -232,43 +214,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
232
214
  };
233
215
  });
234
216
  }
235
- // Wait event context tags should be displayed in the Add Labels when node is next to Event based wait node.
236
- if (waitEventContextTags && Object.keys(waitEventContextTags)?.length) {
237
-
238
- Object.keys(waitEventContextTags).forEach((blockId) => {
239
- const WAIT_EVENT_HEADER_MSG_LABEL = `${waitEventContextTags[blockId].eventName} (${waitEventContextTags[blockId].blockName})`;
240
- eventContextTagsObj[blockId] = {
241
- "name": WAIT_EVENT_HEADER_MSG_LABEL,
242
- "desc": WAIT_EVENT_HEADER_MSG_LABEL,
243
- "resolved": true,
244
- 'tag-header': true,
245
- "subtags": {},
246
- };
247
-
248
- waitEventContextTags?.[blockId]?.tags?.forEach((tag) => {
249
- const {
250
- tagName, label, profileId, profileName, blockName, eventName
251
- } = tag || {};
252
- if (!profileId || !tagName || !label || !profileName) return;
253
- // Initializing the tags profile if it doesn't exist
254
- if (!eventContextTagsObj?.[blockId]?.subtags?.[profileId]) {
255
- eventContextTagsObj[blockId].subtags[profileId] = {
256
- "name": profileName,
257
- "desc": profileName,
258
- "resolved": true,
259
- 'tag-header': true,
260
- "subtags": {},
261
- };
262
- }
263
- // Adding the current tag to the profile group
264
- eventContextTagsObj[blockId].subtags[profileId].subtags[tagName] = {
265
- name: label,
266
- desc: label,
267
- resolved: true,
268
- };
269
- });
270
- });
271
- }
272
217
  this.setState({tags: _.merge( {}, tags, injectedTags, eventContextTagsObj )});
273
218
  }
274
219
 
@@ -487,7 +432,6 @@ TagList.defaultProps = {
487
432
  isNewVersionFlow: false,
488
433
  userLocale: 'en',
489
434
  eventContextTags: [],
490
- waitEventContextTags: {},
491
435
  };
492
436
 
493
437
  TagList.propTypes = {
@@ -508,7 +452,6 @@ TagList.propTypes = {
508
452
  disabled: PropTypes.bool,
509
453
  fetchingSchemaError: PropTypes.bool,
510
454
  eventContextTags: PropTypes.array,
511
- waitEventContextTags: PropTypes.object,
512
455
  popoverPlacement: PropTypes.string,
513
456
  // message to show when Add Label button is disabled (e.g. personalization restriction)
514
457
  disableTooltipMsg: PropTypes.string,
@@ -19,8 +19,4 @@ export default defineMessages({
19
19
  id: `${scope}.personalizationNotSupportedAnonymous`,
20
20
  defaultMessage: 'Personalization tags are not supported for anonymous customers',
21
21
  },
22
- waitEvent: {
23
- id: `${scope}.waitEvent`,
24
- defaultMessage: 'Wait Event',
25
- },
26
22
  });
@@ -5,34 +5,28 @@ import { initialReducer } from '../../../initialReducer';
5
5
  import { injectIntl } from "react-intl";
6
6
  import { fireEvent } from "@testing-library/react";
7
7
  import { TagList } from '../index';
8
- import { TagListData, eventContextTags, waitEventContextTags } from './mockdata';
9
- import { OfferTag, badgesTags, offer } from '../../../utils/tests/common.mockdata';
10
- import * as commonUtils from "../../../utils/common";
8
+ import { TagListData, eventContextTags } from './mockdata';
11
9
  import { Provider } from 'react-redux';
12
10
  import { screen, render } from '../../../utils/test-utils';
13
11
  import history from '../../../utils/history';
14
12
  const { getByText, queryByText } = screen;
15
13
 
16
- const buildProps = (props = {}) => ({
17
- ...TagListData,
18
- onTagSelect: jest.fn(),
19
- ...props,
20
- });
21
14
 
22
- const initializeTagList = (props = {}) => {
15
+ const initializeTagList = (props) => {
23
16
  const store = configureStore({}, initialReducer, history);
24
17
  const Component = injectIntl(TagList);
25
- const propsObj = buildProps(props);
26
- return {
27
- ...render(
28
- <Provider store={store}>
29
- <Component {...propsObj} />
30
- </Provider>
31
- ),
32
- store,
33
- Component,
34
- propsObj,
18
+
19
+ const propsObj = {
20
+ ...TagListData,
21
+ onTagSelect: jest.fn(),
22
+ ...props,
35
23
  };
24
+
25
+ return render(
26
+ <Provider store={store}>
27
+ <Component {...propsObj} />
28
+ </Provider>
29
+ );
36
30
  };
37
31
 
38
32
  const addLabelBtnAssertion = () => {
@@ -47,117 +41,19 @@ describe("TagList test : UNIT", () => {
47
41
  addLabelBtnAssertion();
48
42
  });
49
43
 
50
- it('should render event context tag section from generateTags', () => {
51
- initializeTagList({ eventContextTags, moduleFilterEnabled: false });
44
+ it('should render event context tags correctly from generateTags and show tags under profile', () => {
45
+ initializeTagList({eventContextTags});
52
46
  addLabelBtnAssertion();
53
47
  const EVENT_CONTEXT_TAG_HEADER = getByText(/Entry event/i);
54
48
  expect(EVENT_CONTEXT_TAG_HEADER).toBeInTheDocument();
49
+ fireEvent.click(EVENT_CONTEXT_TAG_HEADER);
50
+ // Customer profile tags
51
+ const CUSTOMER_PROFILE = getByText(/Current Customer/i);
52
+ fireEvent.click(CUSTOMER_PROFILE);
53
+ expect(getByText(/lifetimePurchases/i)).toBeInTheDocument();
55
54
 
56
55
  // Behavioural event profile tags should not be visible as label and profile name is not present
57
56
  const BEHAVIOURAL_EVENT_PROFILE = queryByText(/Behavioural event/i);
58
57
  expect(BEHAVIOURAL_EVENT_PROFILE).not.toBeInTheDocument();
59
58
  });
60
-
61
- it('should render wait event context section when waitEventContextTags is provided', () => {
62
- initializeTagList({ waitEventContextTags, moduleFilterEnabled: false });
63
- addLabelBtnAssertion();
64
- const WAIT_EVENT_HEADER = getByText(/Order Placed \(Wait Block\)/i);
65
- expect(WAIT_EVENT_HEADER).toBeInTheDocument();
66
- });
67
-
68
- it('should merge empty waitEventContextTags with entry event tags', () => {
69
- initializeTagList({ eventContextTags, waitEventContextTags: {}, moduleFilterEnabled: false });
70
- addLabelBtnAssertion();
71
- expect(getByText(/Entry event/i)).toBeInTheDocument();
72
- });
73
-
74
- it('calls parent onContextChange with Outbound when tags and injectedTags are empty on popover open', () => {
75
- const onContextChange = jest.fn();
76
- initializeTagList({
77
- tags: [],
78
- injectedTags: {},
79
- onContextChange,
80
- onTagSelect: jest.fn(),
81
- });
82
- // Default fetch is triggered when the Add Label popover opens (not on mount)
83
- addLabelBtnAssertion();
84
- expect(onContextChange).toHaveBeenCalledWith('Outbound');
85
- });
86
-
87
- it('applies fetchingSchemaError from props via componentWillReceiveProps', () => {
88
- const { rerender, Component, propsObj, store } = initializeTagList({ fetchingSchemaError: false });
89
- addLabelBtnAssertion();
90
- rerender(
91
- <Provider store={store}>
92
- <Component {...propsObj} fetchingSchemaError />
93
- </Provider>
94
- );
95
- expect(screen.getByText(/add label/i)).toBeInTheDocument();
96
- });
97
-
98
- it('disables Add label when restrictPersonalization is true', () => {
99
- initializeTagList({
100
- restrictPersonalization: true,
101
- disabled: false,
102
- moduleFilterEnabled: false,
103
- });
104
- const btn = screen.getByText(/add label/i).closest('button');
105
- expect(btn).toBeDisabled();
106
- });
107
-
108
- it('calls transformCouponTags when selectedOfferDetails and coupon tags are present', () => {
109
- const spy = jest.spyOn(TagList.prototype, 'transformCouponTags');
110
- initializeTagList({
111
- tags: OfferTag,
112
- injectedTags: {},
113
- selectedOfferDetails: [{ id: 'c1', couponName: 'Promo Coupon', couponSeriesId: 'c1' }],
114
- moduleFilterEnabled: false,
115
- });
116
- expect(spy).toHaveBeenCalled();
117
- spy.mockRestore();
118
- });
119
-
120
- it('calls transformBadgeTags from common when badge offer and Badge tags are present', () => {
121
- const spy = jest.spyOn(commonUtils, 'transformBadgeTags');
122
- initializeTagList({
123
- tags: badgesTags,
124
- injectedTags: {},
125
- selectedOfferDetails: offer,
126
- moduleFilterEnabled: false,
127
- });
128
- expect(spy).toHaveBeenCalled();
129
- spy.mockRestore();
130
- });
131
-
132
- it('unmounts without throwing', () => {
133
- const { unmount } = initializeTagList();
134
- expect(() => unmount()).not.toThrow();
135
- });
136
-
137
- it('regenerates tags when props.tags change (componentDidUpdate)', () => {
138
- const { rerender, Component, store } = initializeTagList({ tags: TagListData.tags });
139
- const extra = [
140
- ...TagListData.tags,
141
- {
142
- _id: 'extra-tag',
143
- type: 'TAG',
144
- definition: {
145
- label: { en: 'Extra' },
146
- value: 'extra_value',
147
- subtags: [],
148
- 'tag-header': false,
149
- supportedModules: [{ context: 'default', layout: 'sms', mandatory: false }],
150
- },
151
- scope: { tag: 'STANDARD', orgId: -1, verticals: [] },
152
- isActive: true,
153
- },
154
- ];
155
- rerender(
156
- <Provider store={store}>
157
- <Component {...buildProps({ tags: extra })} />
158
- </Provider>
159
- );
160
- addLabelBtnAssertion();
161
- expect(screen.getByText(/add label/i)).toBeInTheDocument();
162
- });
163
59
  });
@@ -149,20 +149,3 @@ export const eventContextTags = [
149
149
  "isDynamicFact": false
150
150
  }
151
151
  ];
152
-
153
- export const waitEventContextTags = {
154
- block1: {
155
- eventName: 'Order Placed',
156
- blockName: 'Wait Block',
157
- tags: [
158
- {
159
- tagName: 'waitEvent.orderId',
160
- label: 'Order ID',
161
- profileId: 'ORDER_PROFILE',
162
- profileName: 'Order Profile',
163
- blockName: 'Wait Block',
164
- eventName: 'Order Placed',
165
- },
166
- ],
167
- },
168
- };
@@ -82,7 +82,6 @@ export const Viber = (props) => {
82
82
  viberData = {},
83
83
  selectedOfferDetails = [],
84
84
  eventContextTags,
85
- waitEventContextTags,
86
85
  // TestAndPreviewSlidebox props
87
86
  showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
88
87
  handleTestAndPreview: propsHandleTestAndPreview,
@@ -288,7 +287,6 @@ export const Viber = (props) => {
288
287
  userLocale={localStorage.getItem("jlocale") || "en"}
289
288
  selectedOfferDetails={selectedOfferDetails}
290
289
  eventContextTags={eventContextTags}
291
- waitEventContextTags={waitEventContextTags}
292
290
  />
293
291
  </CapColumn>
294
292
  <div className="viber-textarea-wrapper">
@@ -594,7 +592,6 @@ export const Viber = (props) => {
594
592
  userLocale={localStorage.getItem("jlocale") || "en"}
595
593
  selectedOfferDetails={selectedOfferDetails}
596
594
  eventContextTags={eventContextTags}
597
- waitEventContextTags={waitEventContextTags}
598
595
  />
599
596
  <CapColumn className="cta-actions">
600
597
  <CapButton
@@ -22,6 +22,8 @@ export const useTagManagement = ({
22
22
  metaEntities,
23
23
  getDefaultTags,
24
24
  supportedTags = EMPTY_ARRAY,
25
+ injectedTags,
26
+ eventContextTags = EMPTY_ARRAY,
25
27
  }) => {
26
28
  const [tags, setTags] = useState([]);
27
29
  const tagFetchKeyRef = useRef(null);
@@ -84,7 +84,6 @@ const MemoizedTagList = memo(({
84
84
  injectedTags,
85
85
  selectedOfferDetails,
86
86
  eventContextTags,
87
- waitEventContextTags,
88
87
  forwardedTags,
89
88
  onTagSelect,
90
89
  restrictPersonalization = false,
@@ -100,7 +99,6 @@ const MemoizedTagList = memo(({
100
99
  injectedTags={injectedTags}
101
100
  selectedOfferDetails={selectedOfferDetails}
102
101
  eventContextTags={eventContextTags}
103
- waitEventContextTags={waitEventContextTags}
104
102
  forwardedTags={forwardedTags}
105
103
  onTagSelect={onTagSelect}
106
104
  restrictPersonalization={restrictPersonalization}
@@ -118,7 +116,6 @@ const MemoizedTagList = memo(({
118
116
  && prevProps.injectedTags === nextProps.injectedTags
119
117
  && prevProps.selectedOfferDetails === nextProps.selectedOfferDetails
120
118
  && prevProps.eventContextTags === nextProps.eventContextTags
121
- && prevProps.waitEventContextTags === nextProps.waitEventContextTags
122
119
  && prevProps.forwardedTags === nextProps.forwardedTags
123
120
  && prevProps.onTagSelect === nextProps.onTagSelect
124
121
  && prevProps.restrictPersonalization === nextProps.restrictPersonalization
@@ -155,7 +152,6 @@ const WebPushCreate = ({
155
152
  forwardedTags,
156
153
  selectedOfferDetails = [],
157
154
  eventContextTags = [],
158
- waitEventContextTags = {},
159
155
  templateActions: templateActionsProps,
160
156
  Templates,
161
157
  restrictPersonalization = false,
@@ -236,7 +232,6 @@ const WebPushCreate = ({
236
232
  supportedTags: memoizedSupportedTags,
237
233
  injectedTags,
238
234
  eventContextTags,
239
- waitEventContextTags,
240
235
  });
241
236
  const { tags, handleOnTagsContextChange, validationConfig } = tagState;
242
237
  const { weCrmAccounts } = Templates;
@@ -842,13 +837,12 @@ const WebPushCreate = ({
842
837
  injectedTags,
843
838
  selectedOfferDetails,
844
839
  eventContextTags,
845
- waitEventContextTags,
846
840
  forwardedTags,
847
841
  restrictPersonalization,
848
842
  disabled: restrictPersonalization,
849
843
  disableTooltipMsg: restrictPersonalization ? formatMessage(messages.personalizationNotSupportedAnonymous) : undefined,
850
844
  }),
851
- [tags, injectedTags, selectedOfferDetails, eventContextTags, waitEventContextTags, forwardedTags, restrictPersonalization, formatMessage],
845
+ [tags, injectedTags, selectedOfferDetails, eventContextTags, forwardedTags, restrictPersonalization, formatMessage],
852
846
  );
853
847
 
854
848
  // Memoized TagList components with optimized props
@@ -1089,7 +1083,6 @@ WebPushCreate.propTypes = {
1089
1083
  forwardedTags: PropTypes.object,
1090
1084
  selectedOfferDetails: PropTypes.array,
1091
1085
  eventContextTags: PropTypes.array,
1092
- waitEventContextTags: PropTypes.object,
1093
1086
  templateActions: PropTypes.object,
1094
1087
  restrictPersonalization: PropTypes.bool,
1095
1088
  };
@@ -1118,7 +1111,6 @@ WebPushCreate.defaultProps = {
1118
1111
  forwardedTags: {},
1119
1112
  selectedOfferDetails: [],
1120
1113
  eventContextTags: [],
1121
- waitEventContextTags: {},
1122
1114
  templateActions: {},
1123
1115
  Templates: {},
1124
1116
  restrictPersonalization: false,
@@ -180,7 +180,6 @@ export const Whatsapp = (props) => {
180
180
  getFormData,
181
181
  selectedOfferDetails,
182
182
  eventContextTags,
183
- waitEventContextTags = {},
184
183
  metaDataStatus = "",
185
184
  showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
186
185
  handleTestAndPreview: propsHandleTestAndPreview,
@@ -951,7 +950,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
951
950
  injectedTags={injectedTags || {}}
952
951
  selectedOfferDetails={selectedOfferDetails}
953
952
  eventContextTags={eventContextTags}
954
- waitEventContextTags={waitEventContextTags}
955
953
  />
956
954
  )}
957
955
  </>
@@ -1953,7 +1951,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
1953
1951
  injectedTags={injectedTags || {}}
1954
1952
  selectedOfferDetails={selectedOfferDetails}
1955
1953
  eventContextTags={eventContextTags}
1956
- waitEventContextTags={waitEventContextTags}
1957
1954
  />
1958
1955
  )
1959
1956
  : !isAuthenticationTemplate && (
@@ -2760,7 +2757,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
2760
2757
  injectedTags={injectedTags || {}}
2761
2758
  selectedOfferDetails={selectedOfferDetails}
2762
2759
  eventContextTags={eventContextTags}
2763
- waitEventContextTags={waitEventContextTags}
2764
2760
  />
2765
2761
  )
2766
2762
  }
@@ -2879,7 +2875,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
2879
2875
  injectedTags={injectedTags || {}}
2880
2876
  selectedOfferDetails={selectedOfferDetails}
2881
2877
  eventContextTags={eventContextTags}
2882
- waitEventContextTags={waitEventContextTags}
2883
2878
  />
2884
2879
  )}
2885
2880
  {isBtnTypeQuickReply && (
@@ -258543,7 +258543,6 @@ Click {{3}} to unsubscribe'",
258543
258543
  onContextChange={[Function]}
258544
258544
  onTagSelect={[Function]}
258545
258545
  tags={Array []}
258546
- waitEventContextTags={Object {}}
258547
258546
  />
258548
258547
  }
258549
258548
  title={
@@ -258596,7 +258595,6 @@ Click {{3}} to unsubscribe'",
258596
258595
  onContextChange={[Function]}
258597
258596
  onTagSelect={[Function]}
258598
258597
  tags={Array []}
258599
- waitEventContextTags={Object {}}
258600
258598
  >
258601
258599
  <div
258602
258600
  className="tag-mock"
@@ -258614,7 +258612,6 @@ Click {{3}} to unsubscribe'",
258614
258612
  onContextChange={[Function]}
258615
258613
  onTagSelect={[Function]}
258616
258614
  tags={Array []}
258617
- waitEventContextTags={Object {}}
258618
258615
  >
258619
258616
  TagList
258620
258617
  </div>
@@ -260164,7 +260161,6 @@ T&C'
260164
260161
  key=".2"
260165
260162
  tags={Array []}
260166
260163
  updateHandler={[Function]}
260167
- waitEventContextTags={Object {}}
260168
260164
  >
260169
260165
  <CapWhatsappCTA
260170
260166
  ctaData={
@@ -262440,7 +262436,6 @@ new message content.",
262440
262436
  isEditFlow={true}
262441
262437
  tags={Array []}
262442
262438
  updateHandler={[Function]}
262443
- waitEventContextTags={Object {}}
262444
262439
  >
262445
262440
  <CapRow
262446
262441
  align="middle"
@@ -311079,7 +311074,6 @@ Click {{3}} to unsubscribe'",
311079
311074
  onContextChange={[Function]}
311080
311075
  onTagSelect={[Function]}
311081
311076
  tags={Array []}
311082
- waitEventContextTags={Object {}}
311083
311077
  />
311084
311078
  }
311085
311079
  title={
@@ -311132,7 +311126,6 @@ Click {{3}} to unsubscribe'",
311132
311126
  onContextChange={[Function]}
311133
311127
  onTagSelect={[Function]}
311134
311128
  tags={Array []}
311135
- waitEventContextTags={Object {}}
311136
311129
  >
311137
311130
  <div
311138
311131
  className="tag-mock"
@@ -311150,7 +311143,6 @@ Click {{3}} to unsubscribe'",
311150
311143
  onContextChange={[Function]}
311151
311144
  onTagSelect={[Function]}
311152
311145
  tags={Array []}
311153
- waitEventContextTags={Object {}}
311154
311146
  >
311155
311147
  TagList
311156
311148
  </div>
@@ -312700,7 +312692,6 @@ T&C'
312700
312692
  key=".2"
312701
312693
  tags={Array []}
312702
312694
  updateHandler={[Function]}
312703
- waitEventContextTags={Object {}}
312704
312695
  >
312705
312696
  <CapWhatsappCTA
312706
312697
  ctaData={
@@ -314976,7 +314967,6 @@ new message content.",
314976
314967
  isEditFlow={true}
314977
314968
  tags={Array []}
314978
314969
  updateHandler={[Function]}
314979
- waitEventContextTags={Object {}}
314980
314970
  >
314981
314971
  <CapRow
314982
314972
  align="middle"
@@ -337753,7 +337743,6 @@ Click {{unsubscribe}} to unsubscribe",
337753
337743
  onContextChange={[Function]}
337754
337744
  onTagSelect={[Function]}
337755
337745
  tags={Array []}
337756
- waitEventContextTags={Object {}}
337757
337746
  />
337758
337747
  }
337759
337748
  title={
@@ -337806,7 +337795,6 @@ Click {{unsubscribe}} to unsubscribe",
337806
337795
  onContextChange={[Function]}
337807
337796
  onTagSelect={[Function]}
337808
337797
  tags={Array []}
337809
- waitEventContextTags={Object {}}
337810
337798
  >
337811
337799
  <div
337812
337800
  className="tag-mock"
@@ -337824,7 +337812,6 @@ Click {{unsubscribe}} to unsubscribe",
337824
337812
  onContextChange={[Function]}
337825
337813
  onTagSelect={[Function]}
337826
337814
  tags={Array []}
337827
- waitEventContextTags={Object {}}
337828
337815
  >
337829
337816
  TagList
337830
337817
  </div>
@@ -339237,7 +339224,6 @@ Click {{unsubscribe}} to unsubscribe",
339237
339224
  key=".2"
339238
339225
  tags={Array []}
339239
339226
  updateHandler={[Function]}
339240
- waitEventContextTags={Object {}}
339241
339227
  >
339242
339228
  <CapWhatsappCTA
339243
339229
  ctaData={
@@ -341513,7 +341499,6 @@ new message content.",
341513
341499
  isEditFlow={true}
341514
341500
  tags={Array []}
341515
341501
  updateHandler={[Function]}
341516
- waitEventContextTags={Object {}}
341517
341502
  >
341518
341503
  <CapRow
341519
341504
  align="middle"
@@ -363111,7 +363096,6 @@ new message content.",
363111
363096
  onContextChange={[Function]}
363112
363097
  onTagSelect={[Function]}
363113
363098
  tags={Array []}
363114
- waitEventContextTags={Object {}}
363115
363099
  />
363116
363100
  }
363117
363101
  title={
@@ -363164,7 +363148,6 @@ new message content.",
363164
363148
  onContextChange={[Function]}
363165
363149
  onTagSelect={[Function]}
363166
363150
  tags={Array []}
363167
- waitEventContextTags={Object {}}
363168
363151
  >
363169
363152
  <div
363170
363153
  className="tag-mock"
@@ -363182,7 +363165,6 @@ new message content.",
363182
363165
  onContextChange={[Function]}
363183
363166
  onTagSelect={[Function]}
363184
363167
  tags={Array []}
363185
- waitEventContextTags={Object {}}
363186
363168
  >
363187
363169
  TagList
363188
363170
  </div>
@@ -364594,7 +364576,6 @@ new message content.",
364594
364576
  key=".2"
364595
364577
  tags={Array []}
364596
364578
  updateHandler={[Function]}
364597
- waitEventContextTags={Object {}}
364598
364579
  >
364599
364580
  <CapWhatsappCTA
364600
364581
  ctaData={
@@ -366861,7 +366842,6 @@ new message content.",
366861
366842
  isEditFlow={true}
366862
366843
  tags={Array []}
366863
366844
  updateHandler={[Function]}
366864
- waitEventContextTags={Object {}}
366865
366845
  >
366866
366846
  <CapRow
366867
366847
  align="middle"
@@ -76,7 +76,6 @@ export const Zalo = (props) => {
76
76
  selectedOfferDetails,
77
77
  hostName: zaloHostName = '',
78
78
  eventContextTags,
79
- waitEventContextTags,
80
79
  metaDataStatus = "",
81
80
  // TestAndPreviewSlidebox props
82
81
  showTestAndPreviewSlidebox: propsShowTestAndPreviewSlidebox,
@@ -520,7 +519,6 @@ export const Zalo = (props) => {
520
519
  injectedTags={injectedTags || {}}
521
520
  selectedOfferDetails={selectedOfferDetails}
522
521
  eventContextTags={eventContextTags}
523
- waitEventContextTags={waitEventContextTags}
524
522
  />
525
523
  }
526
524
  />
@@ -1,63 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import '@testing-library/jest-dom';
4
- import { IntlProvider } from 'react-intl';
5
- import CapTagListWithInput from '../index';
6
-
7
- const capturedTagListProps = { current: null };
8
-
9
- jest.mock('../../../v2Containers/TagList', () => {
10
- const React = require('react');
11
- const Mock = (props) => {
12
- capturedTagListProps.current = props;
13
- return <div data-testid="mock-tag-list">TagList</div>;
14
- };
15
- return Mock;
16
- });
17
-
18
- jest.mock('@capillarytech/cap-ui-library/CapRow', () => ({ children }) => <div>{children}</div>);
19
- jest.mock('@capillarytech/cap-ui-library/CapColumn', () => ({ children }) => <div>{children}</div>);
20
- jest.mock('@capillarytech/cap-ui-library/CapHeading', () => () => null);
21
- jest.mock('@capillarytech/cap-ui-library/CapInput', () => () => <input data-testid="cap-input" />);
22
-
23
- const waitMap = {
24
- b1: { eventName: 'Order Placed', blockName: 'Wait', tags: [] },
25
- };
26
-
27
- describe('CapTagListWithInput', () => {
28
- beforeEach(() => {
29
- capturedTagListProps.current = null;
30
- });
31
-
32
- it('forwards waitEventContextTags to TagList', () => {
33
- render(
34
- <IntlProvider locale="en" messages={{}}>
35
- <CapTagListWithInput
36
- inputId="test-url"
37
- inputOnChange={jest.fn()}
38
- waitEventContextTags={waitMap}
39
- onTagSelect={jest.fn()}
40
- onContextChange={jest.fn()}
41
- />
42
- </IntlProvider>
43
- );
44
-
45
- expect(screen.getByTestId('mock-tag-list')).toBeInTheDocument();
46
- expect(capturedTagListProps.current.waitEventContextTags).toEqual(waitMap);
47
- });
48
-
49
- it('uses default empty object for waitEventContextTags when omitted', () => {
50
- render(
51
- <IntlProvider locale="en" messages={{}}>
52
- <CapTagListWithInput
53
- inputId="test-url"
54
- inputOnChange={jest.fn()}
55
- onTagSelect={jest.fn()}
56
- onContextChange={jest.fn()}
57
- />
58
- </IntlProvider>
59
- );
60
-
61
- expect(capturedTagListProps.current.waitEventContextTags).toEqual({});
62
- });
63
- });