@capillarytech/creatives-library 8.0.338 → 8.0.339
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/package.json +1 -1
- package/utils/tests/tagValidations.test.js +0 -20
- package/v2Components/CapTagList/index.js +23 -28
- package/v2Components/CapTagList/style.scss +0 -29
- package/v2Components/CapTagListWithInput/index.js +0 -4
- package/v2Components/CapWhatsappCTA/index.js +0 -2
- package/v2Components/FormBuilder/index.js +0 -7
- package/v2Components/HtmlEditor/HTMLEditor.js +1 -6
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +2 -927
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +0 -3
- package/v2Containers/BeeEditor/index.js +0 -3
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -28
- package/v2Containers/CreativesContainer/index.js +7 -9
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +0 -47
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -5
- package/v2Containers/Email/index.js +0 -1
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1 -6
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +0 -3
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +2 -20
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +1 -16
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +0 -3
- package/v2Containers/EmailWrapper/index.js +0 -4
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -1
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +0 -9
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -1
- package/v2Containers/MobilePush/Create/index.js +0 -2
- package/v2Containers/MobilePush/Edit/index.js +0 -2
- package/v2Containers/MobilepushWrapper/index.js +1 -3
- package/v2Containers/Rcs/index.js +7 -1
- package/v2Containers/Sms/Create/index.js +0 -2
- package/v2Containers/Sms/Edit/index.js +0 -2
- package/v2Containers/SmsTrai/Edit/index.js +0 -2
- package/v2Containers/SmsWrapper/index.js +0 -2
- package/v2Containers/TagList/index.js +5 -62
- package/v2Containers/TagList/messages.js +0 -4
- package/v2Containers/TagList/tests/TagList.test.js +20 -124
- package/v2Containers/TagList/tests/mockdata.js +0 -17
- package/v2Containers/Viber/index.js +0 -3
- package/v2Containers/WebPush/Create/hooks/useTagManagement.js +2 -0
- package/v2Containers/WebPush/Create/index.js +1 -9
- package/v2Containers/Whatsapp/index.js +0 -5
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -20
- package/v2Containers/Zalo/index.js +0 -2
- package/v2Components/CapTagListWithInput/__tests__/CapTagListWithInput.test.js +0 -63
|
@@ -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
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
...
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
51
|
-
initializeTagList({
|
|
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
|
|
@@ -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,
|
|
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
|
-
});
|