@capillarytech/creatives-library 7.17.117 → 7.17.118-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +16 -12
  3. package/v2Components/CapImageUpload/constants.js +6 -0
  4. package/v2Components/CapImageUpload/index.js +15 -16
  5. package/v2Components/CapImageUpload/messages.js +1 -5
  6. package/v2Components/CapVideoUpload/constants.js +5 -0
  7. package/v2Components/CapVideoUpload/index.js +28 -8
  8. package/v2Components/CapVideoUpload/index.scss +4 -1
  9. package/v2Components/CapVideoUpload/messages.js +4 -4
  10. package/v2Components/TemplatePreview/_templatePreview.scss +21 -0
  11. package/v2Components/TemplatePreview/index.js +56 -45
  12. package/v2Containers/CreativesContainer/SlideBoxContent.js +10 -4
  13. package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -0
  14. package/v2Containers/CreativesContainer/messages.js +4 -0
  15. package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +11 -0
  16. package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +225 -0
  17. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +35 -20
  18. package/v2Containers/Templates/_templates.scss +9 -4
  19. package/v2Containers/Templates/index.js +29 -8
  20. package/v2Containers/Viber/constants.js +58 -0
  21. package/v2Containers/Viber/index.js +409 -421
  22. package/v2Containers/Viber/index.scss +113 -0
  23. package/v2Containers/Viber/messages.js +68 -0
  24. package/v2Containers/Viber/style.js +20 -0
  25. package/v2Containers/Viber/tests/index.test.js +297 -0
  26. package/v2Containers/Viber/tests/mockData.js +134 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.117",
4
+ "version": "7.17.118-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -273,12 +273,8 @@ describe("Creatives testing template creation", () => {
273
273
  fireEvent.change(templateNameInput, {
274
274
  target: { value: 'viber_test_template' },
275
275
  });
276
-
277
- const templateTextInput = await creativesScreen.getByText(
278
- /Text message/,
279
- {},
280
- );
281
- const msgBox = templateTextInput.parentElement.nextSibling.firstChild;
276
+ const msgBox = screen.getByPlaceholderText(/Enter message/i);
277
+ msgBox.focus();
282
278
  //Enter a template text message
283
279
  fireEvent.change(msgBox, {
284
280
  target: { value: 'viber_template_message' },
@@ -306,24 +302,32 @@ describe("Creatives testing template creation", () => {
306
302
  // first click opens the popup, and second click closes it, clicking twice is intentional
307
303
  userEvent.click(addLabel);
308
304
  userEvent.click(addLabel);
305
+ const imageRadio = creativesScreen.getByRole('radio', {name: /image/i});
306
+ fireEvent.click(imageRadio);
309
307
  const imageUploader = creativesScreen.getByRole('button', {
310
- name: /drag and drop image here or your computer gallery/i,
308
+ name: /drag and drop image here or select from computer gallery/i,
311
309
  });
312
310
  expect(within(imageUploader).getByRole('button', {
313
- name: /your computer/i,
311
+ name: /select from computer/i,
314
312
  })).toBeInTheDocument();
315
313
  const galleryBtn = within(imageUploader).getByRole('button', {
316
314
  name: globalMessages.gallery.defaultMessage,
317
315
  });
318
316
 
319
317
  //configuring CTA button
320
- const btnText = creativesScreen.getByText(/button text/i);
321
- const btnTextBox = btnText.nextSibling.firstChild;
318
+ const ctaRadioBtn = creativesScreen.getByRole('radio', {
319
+ name: /call to action create a button that lets customers respond to your messages or take action/i,
320
+ });
321
+ fireEvent.click(ctaRadioBtn);
322
+ const btnTextBox = await creativesScreen.findByPlaceholderText(
323
+ 'Enter button text',
324
+ );
322
325
  fireEvent.change(btnTextBox, {
323
326
  target: { value: 'button' },
324
327
  });
325
- const btnUrl = creativesScreen.getByText(/button url/i);
326
- const btnUrlBox = btnUrl.nextSibling.firstChild;
328
+ const btnUrlBox = await creativesScreen.findByPlaceholderText(
329
+ 'Enter button url',
330
+ );
327
331
  fireEvent.change(btnUrlBox, {
328
332
  target: { value: 'button' },
329
333
  });
@@ -0,0 +1,6 @@
1
+ export const MAX_SUPPORTED_IMAGE_SIZE = {
2
+ VIBER: 10,
3
+ RCS: 2,
4
+ INAPP: 5,
5
+ WHATSAPP: 5,
6
+ };
@@ -20,7 +20,8 @@ import { injectIntl, FormattedMessage, intlShape} from 'react-intl';
20
20
  import { isEmpty, get } from 'lodash';
21
21
  import './index.scss';
22
22
  import Gallery from '../../v2Containers/Assets/Gallery';
23
- import { FACEBOOK, INAPP, RCS, WHATSAPP } from "../../v2Containers/CreativesContainer/constants";
23
+ import { MAX_SUPPORTED_IMAGE_SIZE } from './constants';
24
+ import { FACEBOOK, INAPP, RCS, WHATSAPP, VIBER } from "../../v2Containers/CreativesContainer/constants";
24
25
 
25
26
  import messages from './messages';
26
27
  function CapImageUpload(props) {
@@ -173,6 +174,17 @@ function CapImageUpload(props) {
173
174
  );
174
175
  }, []);
175
176
 
177
+ const getImageSizeLabel = () => (
178
+ <CapHeadingSpan type="label2">
179
+ <FormattedMessage
180
+ {...messages.imageSize}
181
+ values={{
182
+ size: MAX_SUPPORTED_IMAGE_SIZE[channel],
183
+ }}
184
+ />
185
+ </CapHeadingSpan>
186
+ );
187
+
176
188
  const getImageSection = useCallback(() => {
177
189
  if (imageSrc === "") {
178
190
  return (<>
@@ -244,9 +256,7 @@ function CapImageUpload(props) {
244
256
  <div className="image-info-wrapper">
245
257
  {channel === WHATSAPP && (
246
258
  <>
247
- <CapHeadingSpan type="label2">
248
- <FormattedMessage {...messages.maxImageSize} />
249
- </CapHeadingSpan>
259
+ {getImageSizeLabel}
250
260
  <CapHeadingSpan type="label2">
251
261
  <FormattedMessage {...messages.whatsappAspectRatio} />
252
262
  </CapHeadingSpan>
@@ -262,18 +272,7 @@ function CapImageUpload(props) {
262
272
  <FormattedMessage {...messages.aspectRatio} />
263
273
  </CapHeadingSpan>
264
274
  )}
265
- {channel === RCS && (
266
- <CapHeadingSpan type="label2" className="image-size">
267
- <FormattedMessage {...messages.imageSize} />
268
- </CapHeadingSpan>
269
- )}
270
- {
271
- channel === INAPP && (
272
- <CapHeadingSpan type="label2" className="image-size">
273
- <FormattedMessage {...messages.maxImageSize} />
274
- </CapHeadingSpan>
275
- )
276
- }
275
+ {[RCS, VIBER, INAPP].includes(channel) && getImageSizeLabel()}
277
276
  <CapHeadingSpan type="label2" className="image-format">
278
277
  {channel === INAPP ? <FormattedMessage {...messages.format2} /> : <FormattedMessage {...messages.format} />}
279
278
  </CapHeadingSpan>
@@ -2,10 +2,6 @@ import { defineMessages } from 'react-intl';
2
2
  const scope = `creatives.componentsV2.CapImageUpload`;
3
3
 
4
4
  export default defineMessages({
5
- maxImageSize: {
6
- id: `${scope}.maxImageSize`,
7
- defaultMessage: 'Size upto: 5MB',
8
- },
9
5
  whatsappAspectRatio: {
10
6
  id: `${scope}.whatsappAspectRatio`,
11
7
  defaultMessage: 'Max aspect ratio: 1.91:1',
@@ -61,6 +57,6 @@ export default defineMessages({
61
57
  },
62
58
  imageSize: {
63
59
  id: `${scope}.imageSize`,
64
- defaultMessage: 'Size upto: 2MB',
60
+ defaultMessage: 'Size upto: {size}MB',
65
61
  },
66
62
  });
@@ -1 +1,6 @@
1
1
  export const WHATSAPP = 'WHATSAPP';
2
+ export const DEFAULT = 'DEFAULT';
3
+ export const SUPPORTED_FILE_FORMATS = {
4
+ VIBER: '3GP, MP4, MOV, M4V',
5
+ DEFAULT: 'MP4',
6
+ };
@@ -19,8 +19,9 @@ import {
19
19
  } from '@capillarytech/cap-ui-library';
20
20
  import messages from './messages';
21
21
  import {bytes2Size, getDecodedFileName} from '../../utils/common';
22
- import { WHATSAPP } from './constants';
22
+ import { SUPPORTED_FILE_FORMATS, WHATSAPP, DEFAULT } from './constants';
23
23
  import './index.scss';
24
+ import { VIBER } from '../../v2Containers/CreativesContainer/constants';
24
25
 
25
26
  function CapVideoUpload(props) {
26
27
  const {
@@ -230,6 +231,7 @@ function CapVideoUpload(props) {
230
231
  videoWidth: metaVideoWidth,
231
232
  previewUrl,
232
233
  fileHandle,
234
+ videoDuration,
233
235
  }
234
236
  );
235
237
  }
@@ -276,6 +278,16 @@ function CapVideoUpload(props) {
276
278
  </Fragment>
277
279
  );
278
280
  };
281
+
282
+ const getVideoSizeDescription = () => (
283
+ <CapHeading.CapHeadingSpan type="label2">
284
+ <FormattedMessage
285
+ {...messages.videoSizeDescription}
286
+ values={{ size: bytes2Size(videoSize) }}
287
+ />
288
+ </CapHeading.CapHeadingSpan>
289
+ );
290
+
279
291
  return (
280
292
  <CapSpin spinning={isSpinning}>
281
293
  <div style={style} className="cap-custom-video-upload">
@@ -295,26 +307,34 @@ function CapVideoUpload(props) {
295
307
  onClose={() => updateTemplateDrawerRequirement(false)}
296
308
  />
297
309
  </form>
298
- {channel !== WHATSAPP ?
310
+ {![WHATSAPP, VIBER].includes(channel) &&
299
311
  <>
300
312
  <CapHeading.CapHeadingSpan type="h6" className="video-description">
301
313
  <FormattedMessage {...messages.videoRatioDescription} />
302
314
  </CapHeading.CapHeadingSpan>
303
315
  {' '}
304
316
  <CapHeading.CapHeadingSpan type="h6" className="video-description file-format">
305
- <FormattedMessage {...messages.fileFormat} />
306
-
317
+ <FormattedMessage {...messages.fileFormat} values={{ format: SUPPORTED_FILE_FORMATS[DEFAULT] }} />
307
318
  </CapHeading.CapHeadingSpan>
308
319
  <CapHeading.CapHeadingSpan type="h6" className="video-description video-details">
309
320
  <FormattedMessage {...messages.videoSizeDescription} values={{size: bytes2Size(videoSize)}} />
310
321
  </CapHeading.CapHeadingSpan>
311
- </> :
322
+ </>}
323
+ {channel === WHATSAPP &&
312
324
  <>
313
- <CapHeading.CapHeadingSpan type="label2" className="">
314
- <FormattedMessage {...messages.videoSizeDescription} values={{size: bytes2Size(videoSize)}} />
325
+ {getVideoSizeDescription()}
326
+ <CapHeading.CapHeadingSpan type="label2" className="whatsapp-format">
327
+ <FormattedMessage {...messages.fileFormat} values={{ format: SUPPORTED_FILE_FORMATS[DEFAULT] }} />
315
328
  </CapHeading.CapHeadingSpan>
329
+ </>}
330
+ {channel === VIBER &&
331
+ <>
332
+ {getVideoSizeDescription()}
316
333
  <CapHeading.CapHeadingSpan type="label2" className="whatsapp-format">
317
- <FormattedMessage {...messages.whatsappFileFormat} />
334
+ <FormattedMessage {...messages.fileFormat} values={{ format: SUPPORTED_FILE_FORMATS[channel] }} />
335
+ </CapHeading.CapHeadingSpan>
336
+ <CapHeading.CapHeadingSpan type="label2" className="video-duration">
337
+ <FormattedMessage {...messages.viberMaxDuration} />
318
338
  </CapHeading.CapHeadingSpan>
319
339
  </>}
320
340
  </div>
@@ -46,4 +46,7 @@ $classPrefix: cap-custom-video-upload;
46
46
  }
47
47
  .video-panel {
48
48
  display: flex;
49
- }
49
+ }
50
+ .video-duration {
51
+ margin-left: 8rem;
52
+ }
@@ -57,10 +57,10 @@ export default defineMessages({
57
57
  },
58
58
  fileFormat: {
59
59
  id: `${scope}.fileFormat`,
60
- defaultMessage: 'Format: MP4',
60
+ defaultMessage: 'Format: {format}',
61
61
  },
62
- whatsappFileFormat: {
63
- id: `${scope}.whatsappFileFormat`,
64
- defaultMessage: 'Format: MP4',
62
+ viberMaxDuration: {
63
+ id: `${scope}.viberMaxDuration`,
64
+ defaultMessage: 'Max Duration: 600 seconds',
65
65
  },
66
66
  });
@@ -991,4 +991,25 @@
991
991
  .media-img-inapp {
992
992
  width: 100%;
993
993
  height: 100%;
994
+ }
995
+ .empty-placeholder {
996
+ padding-bottom: $CAP_SPACE_16;
997
+ }
998
+ .viber-button-base {
999
+ border-radius: $CAP_SPACE_16;
1000
+ background-color: $CAP_PURPLE01;
1001
+ margin-top: $CAP_SPACE_12;
1002
+ text-align: center;
1003
+ width: 8.75rem;
1004
+ height: $CAP_SPACE_20;
1005
+ margin-left: $CAP_SPACE_08;
1006
+ }
1007
+ .viber-button-card-text {
1008
+ font-size: $CAP_SPACE_12;
1009
+ font-weight: 500;
1010
+ display: -webkit-box;
1011
+ -webkit-line-clamp: 1;
1012
+ -webkit-box-orient: vertical;
1013
+ overflow: hidden;
1014
+ color: $CAP_WHITE;
994
1015
  }
@@ -11,7 +11,17 @@ import _ from 'lodash';
11
11
  import { injectIntl, FormattedMessage, intlShape } from 'react-intl';
12
12
  // import styled from 'styled-components';
13
13
  import { CapColumn, CapRow, CapHeading, CapIcon, CapButton, CapImage, CapLabel, CapDivider, CapTooltip } from '@capillarytech/cap-ui-library';
14
- import { isEmpty } from 'lodash';
14
+ import {
15
+ CAP_COLOR_03,
16
+ CAP_WHITE,
17
+ FONT_COLOR_01,
18
+ CAP_G06,
19
+ CAP_G15,
20
+ CAP_PURPLE01,
21
+ CAP_G16,
22
+ CAP_SPACE_08,
23
+ } from '@capillarytech/cap-ui-library/styled/variables';
24
+ import isEmpty from 'lodash/isEmpty';
15
25
  import './_templatePreview.scss';
16
26
  import {updateCharCount} from '../../utils/smsCharCountV2';
17
27
  import messages from './messages';
@@ -36,6 +46,13 @@ import inAppMobileIOSFull from './assets/images/inapp_mobile_ios_full.svg';
36
46
  import videoPlay from '../../assets/videoPlay.svg';
37
47
  import zaloMessage from '../../v2Containers/Zalo/messages';
38
48
  import { handlePreviewInNewTab } from '../../utils/common';
49
+ import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
50
+ import CapFacebookPreview from '../../v2Containers/CapFacebookPreview';
51
+ import WhatsappStatusContainer from '../WhatsappStatusContainer';
52
+ import { getWhatsappQuickReply } from '../../v2Containers/Whatsapp/utils';
53
+ import { QUICK_REPLY } from '../../v2Containers/Whatsapp/constants';
54
+ import { ANDROID, INAPP_MESSAGE_LAYOUT_TYPES } from '../../v2Containers/InApp/constants';
55
+
39
56
  const wechatBodyNew = require('./assets/images/wechat_mobile_android.svg');
40
57
  const smsMobileAndroid = require('./assets/images/sms_mobile_android.svg');
41
58
  const smsMobileIos = require('./assets/images/sms_mobile_ios.svg');
@@ -49,23 +66,6 @@ const lineVideoPlaceholder = require('../../assets/rich-video-placeholder.svg');
49
66
  const androidPushMessagePhone = require('./assets/images/androidPushMessage.svg');
50
67
  const iPhonePushMessagePhone = require('./assets/images/iPhonePushMessage.svg');
51
68
 
52
- import {
53
- CAP_COLOR_03,
54
- CAP_WHITE,
55
- FONT_COLOR_01,
56
- CAP_G06,
57
- CAP_G15,
58
- CAP_PURPLE01,
59
- CAP_G16,
60
- CAP_SPACE_08,
61
- } from '@capillarytech/cap-ui-library/styled/variables';
62
- import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
63
- import CapFacebookPreview from '../../v2Containers/CapFacebookPreview';
64
- import WhatsappStatusContainer from '../WhatsappStatusContainer';
65
- import { getWhatsappQuickReply } from '../../v2Containers/Whatsapp/utils';
66
- import { QUICK_REPLY } from '../../v2Containers/Whatsapp/constants';
67
- import { ANDROID, INAPP_MESSAGE_LAYOUT_TYPES } from '../../v2Containers/InApp/constants';
68
-
69
69
  export class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
70
70
  onPreviewContentClicked = (channel) => {
71
71
  const IOSContent = (this.props.templateDataRaw && this.props.templateDataRaw.versions.base.IOS) ||
@@ -184,8 +184,14 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
184
184
  } = this.props;
185
185
  let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
186
186
  const { formatMessage } = intl;
187
- const { buttonText, imageURL, rcsPreviewContent, inAppPreviewContent, messageContent: viberMessageContent } = content || {};
187
+ const { rcsPreviewContent, inAppPreviewContent, viberPreviewContent } = content || {};
188
188
  const { rcsImageSrc, rcsTitle, rcsDesc, buttonText: rcsButtonText } = rcsPreviewContent || {};
189
+ const {
190
+ videoParams,
191
+ imageURL,
192
+ buttonText: viberButtonText,
193
+ messageContent: viberMessageContent,
194
+ } = viberPreviewContent || {};
189
195
  const {mediaPreview = {}, templateTitle = "", templateMsg = "", ctaData} = inAppPreviewContent || {};
190
196
  let smsDetails = {};
191
197
  // let smsText = '';
@@ -920,35 +926,40 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
920
926
  }}
921
927
  />
922
928
  )}
923
- {/* button viber preview */}
924
- {buttonText && (
925
- <div
926
- style={{
927
- "border-radius": "16px",
928
- "background-color": CAP_PURPLE01,
929
- "margin-top": "14px",
930
- "text-align": "center",
931
- width: "140px",
932
- height: "20px",
933
- "margin-left": "8px",
934
- }}
929
+ {/* Video Viber preview */}
930
+ {videoParams?.viberVideoSrc && (
931
+ <CapTooltip
932
+ title={formatMessage(messages.videoPreviewTooltip)}
935
933
  >
936
- <p
937
- style={{
938
- "font-size": "12px",
939
- "font-weight": "500",
940
- display: "-webkit-box",
941
- "-webkit-line-clamp": "1",
942
- "-webkit-box-orient": "vertical",
943
- overflow: "hidden",
944
- color: CAP_WHITE,
945
- }}
946
- >
947
- {buttonText || ""}
934
+ <div className="video-preview">
935
+ <CapImage
936
+ src={videoParams?.viberVideoPreviewImg}
937
+ className="whatsapp-image"
938
+ alt={formatMessage(messages.previewGenerated)}
939
+ rest={{
940
+ style: {
941
+ maxWidth: "100%",
942
+ marginBottom: 5,
943
+ },
944
+ }}
945
+ />
946
+ <div className="icon-position">
947
+ <CapImage
948
+ className="video-icon"
949
+ src={videoPlay} />
950
+ </div>
951
+ </div>
952
+ </CapTooltip>
953
+ )}
954
+ {/* button viber preview */}
955
+ {viberButtonText && (
956
+ <CapLabel className="viber-button-base">
957
+ <p className="viber-button-card-text">
958
+ {viberButtonText || ""}
948
959
  </p>
949
- </div>
960
+ </CapLabel>
950
961
  )}
951
- <div style={{ paddingBottom: 32 }}></div>
962
+ <div className="empty-placeholder"></div>
952
963
  </div>
953
964
  </div>
954
965
  </div>
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
4
  import get from 'lodash/get';
5
+ import isEmpty from 'lodash/isEmpty';
5
6
  import cloneDeep from 'lodash/cloneDeep';
6
7
  import TemplatesV2 from '../TemplatesV2';
7
8
  import TemplatePreview from '../../v2Components/TemplatePreview';
@@ -308,11 +309,16 @@ export function SlideBoxContent(props) {
308
309
  }
309
310
  case constants.VIBER: {
310
311
  const template = cloneDeep(templateDataObject);
311
- const { text = "", imageURL = "", buttonText = "" } = get(template, 'versions.base.content.viber', {});
312
+ const { text = "", button = {}, image = {}, video = {} } = get(template, 'versions.base.content.content', {});
313
+ const { url: viberImageUrl = "" } = image;
314
+ const { url: viberVideoUrl = "", thumbnailUrl = '' } = video;
312
315
  template.content = {
313
- messageContent: text,
314
- imageURL,
315
- buttonText,
316
+ viberPreviewContent: {
317
+ ...(!isEmpty(image) && { imageURL: viberImageUrl }),
318
+ ...(!isEmpty(video) && { videoParams: { viberVideoSrc: viberVideoUrl, viberVideoPreviewImg: thumbnailUrl }}),
319
+ buttonText: button?.text,
320
+ messageContent: text,
321
+ },
316
322
  };
317
323
  return template.content;
318
324
  }
@@ -70,6 +70,7 @@ export function SlideBoxHeader(props) {
70
70
  whatsapp: <FormattedMessage {...messages.whatsappTemplate} />,
71
71
  rcs: <FormattedMessage {...messages.rcsCreative} />,
72
72
  zalo: <FormattedMessage {...messages.zaloTemplate} />,
73
+ viber: <FormattedMessage {...messages.viberTemplate} />,
73
74
  };
74
75
  return labels[currentChannel.toLowerCase()];
75
76
  };
@@ -322,6 +322,10 @@ export default defineMessages({
322
322
  id: `${scope}.zaloTemplate`,
323
323
  defaultMessage: `Zalo template`,
324
324
  },
325
+ "viberTemplate": {
326
+ id: `${scope}.viberTemplate`,
327
+ defaultMessage: `Viber template`,
328
+ },
325
329
  "learnTips": {
326
330
  id: `${scope}.learnTips`,
327
331
  defaultMessage: `Learn tips to get approved`,
@@ -3,6 +3,7 @@ import { shallowWithIntl } from '../../../helpers/intl-enzym-test-helpers';
3
3
 
4
4
  import { SlideBoxContent } from '../SlideBoxContent';
5
5
  import mockdata from '../../mockdata';
6
+ import { templateDetailsImage, templateDetailsVideo, templateDetailsText, templateDetails_ } from '../../Viber/tests/mockData';
6
7
 
7
8
  const {
8
9
  whatsappEditTemplateData,
@@ -86,4 +87,14 @@ describe('Test SlideBoxContent container', () => {
86
87
  renderFunction('LINE', 'preview', linePreviewTemplateData2);
87
88
  expect(renderedComponent).toMatchSnapshot();
88
89
  });
90
+ it('Should render correct component for viber channel preview mode', () => {
91
+ renderFunction('VIBER', 'preview', templateDetails_);
92
+ expect(renderedComponent).toMatchSnapshot();
93
+ renderFunction('VIBER', 'preview', templateDetailsImage);
94
+ expect(renderedComponent).toMatchSnapshot();
95
+ renderFunction('VIBER', 'preview', templateDetailsVideo);
96
+ expect(renderedComponent).toMatchSnapshot();
97
+ renderFunction('VIBER', 'preview', templateDetailsText);
98
+ expect(renderedComponent).toMatchSnapshot();
99
+ });
89
100
  });