@capillarytech/creatives-library 7.10.51 → 7.10.52

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.
@@ -117,10 +117,9 @@ describe('Creatives Whatsapp test/>', () => {
117
117
  const sendForApprovalBtn = renderedComponent
118
118
  .find('CapButton.whatsapp-create-btn')
119
119
  .props();
120
- expect(sendForApprovalBtn.children.props.defaultMessage).toBe(
121
- 'Send for approval',
122
- );
123
120
  expect(sendForApprovalBtn.disabled).toBe(true);
121
+ sendForApprovalBtn.onClick();
122
+ expect(createWhatsappTemplate).toHaveBeenCalled();
124
123
  });
125
124
 
126
125
  it('Cancel Btn', () => {
@@ -128,7 +127,6 @@ describe('Creatives Whatsapp test/>', () => {
128
127
  const cancelBtn = renderedComponent
129
128
  .find('CapButton.whatsapp-cancel-btn')
130
129
  .props();
131
- expect(cancelBtn.children.props.defaultMessage).toBe('Cancel');
132
130
  cancelBtn.onClick();
133
131
  expect(renderedComponent).toMatchSnapshot();
134
132
  });
@@ -1,9 +1,6 @@
1
1
  import React from 'react';
2
- import { CapRow, CapStatus, CapColoredTag } from '@capillarytech/cap-ui-library';
3
2
  import { WHATSAPP } from '../CreativesContainer/constants';
4
3
  import {
5
- CATEGORY as WHATSAPP_CATEGORY,
6
- STATUS as WHATSAPP_STATUS,
7
4
  STATUS_OPTIONS,
8
5
  CATEGORY_OPTIONS,
9
6
  WHATSAPP_STATUSES,
@@ -42,48 +39,4 @@ export const getWhatsappStatus = (status) => {
42
39
  status = WHATSAPP_STATUSES.awaitingApproval;
43
40
  }
44
41
  return STATUS_OPTIONS.find((obj) => obj.value === status);
45
- }
46
-
47
- export const getWhatsappStatusContainer = (template) => {
48
- const {
49
- versions: {
50
- base: {
51
- content: {
52
- [WHATSAPP.toLowerCase()]: {
53
- [WHATSAPP_STATUS]: status,
54
- [WHATSAPP_CATEGORY]: category,
55
- } = {},
56
- } = {},
57
- } = {},
58
- } = {},
59
- } = template;
60
-
61
- const categoryObj = getWhatsappCategory(category) || {};
62
- const {
63
- label: categoryLabel,
64
- tagColor: categoryTagColor,
65
- tagTextColor: categoryTextColor,
66
- } = categoryObj;
67
- return (
68
- <CapRow type="flex" align="middle" className="whatsapp-status-container">
69
- <CapStatus
70
- type={status}
71
- text={getWhatsappStatus(status)?.label}
72
- labelType="label3"
73
- />
74
- {
75
- categoryLabel ? (
76
- <CapColoredTag
77
- tagColor={categoryTagColor}
78
- tagTextColor={categoryTextColor}
79
- tagHeight="20px"
80
- tagFontSize="12px"
81
- className="whatsapp-category-tag"
82
- >
83
- {categoryLabel}
84
- </CapColoredTag>
85
- ) : null
86
- }
87
- </CapRow>
88
- )
89
42
  }