@capillarytech/creatives-library 8.0.26 → 8.0.27
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/containers/Cap/selectors.js +1 -2
- package/containers/Cap/tests/__snapshots__/index.test.js.snap +8 -0
- package/containers/Cap/tests/selectors.test.js +28 -0
- package/containers/LanguageProvider/tests/index.test.js +8 -30
- package/package.json +5 -8
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +5 -2
- package/tests/store.test.js +5 -4
- package/utils/ApiCaller.js +0 -12
- package/utils/test-utils.js +4 -8
- package/utils/tests/cdnTransformation.test.js +1 -1
- package/v2Components/CapDeviceContent/tests/index.test.js +5 -12
- package/v2Components/Ckeditor/tests/index.test.js +3 -15
- package/v2Components/FormBuilder/tests/index.test.js +3 -2
- package/v2Components/NavigationBar/tests/index.test.js +3 -2
- package/v2Components/NewCallTask/tests/index.test.js +3 -2
- package/v2Containers/Cap/index.js +0 -5
- package/v2Containers/Cap/tests/Cap.test.js +7 -16
- package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +8 -0
- package/v2Containers/Cap/tests/selectors.test.js +26 -27
- package/v2Containers/CreativesContainer/index.js +1 -1
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +3 -2
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +9 -9
- package/v2Containers/Email/tests/sagas.test.js +27 -23
- package/v2Containers/InApp/tests/index.test.js +3 -11
- package/v2Containers/InApp/tests/sagas.test.js +10 -13
- package/v2Containers/LanguageProvider/tests/index.test.js +11 -19
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +90 -287
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +58 -116
- package/v2Containers/Line/Container/ImageCarousel/tests/content.test.js +3 -2
- package/v2Containers/Line/Container/ImageCarousel/tests/index.test.js +3 -2
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +396 -254
- package/v2Containers/Line/Container/Wrapper/tests/index.test.js +3 -11
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +215 -395
- package/v2Containers/Line/Container/tests/index.test.js +4 -3
- package/v2Containers/MobilePush/Edit/index.js +7 -8
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +133186 -146971
- package/v2Containers/Rcs/tests/index.test.js +4 -12
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +169 -31
- package/v2Containers/SmsTrai/Create/tests/index.test.js +10 -15
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +1457 -817
- package/v2Containers/SmsTrai/Edit/tests/index.test.js +3 -14
- package/v2Containers/TagList/tests/TagList.test.js +3 -2
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +20 -14
- package/v2Containers/TemplatesV2/index.js +55 -80
- package/v2Containers/TemplatesV2/tests/index.test.js +4 -3
- package/v2Containers/Viber/tests/index.test.js +3 -10
- package/v2Containers/Whatsapp/index.js +0 -1
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +32562 -5611
- package/v2Containers/Whatsapp/tests/index.test.js +12 -31
- package/v2Containers/Zalo/tests/index.test.js +3 -11
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { configureStore } from '@capillarytech/vulcan-react-sdk/utils';
|
|
3
|
-
import
|
|
3
|
+
import { createBrowserHistory } from 'history';
|
|
4
4
|
import { initialReducer } from '../../../initialReducer';
|
|
5
5
|
import { Provider } from 'react-redux';
|
|
6
|
-
import { mountWithIntl
|
|
6
|
+
import { mountWithIntl } from '../../../../app/helpers/intl-enzym-test-helpers';
|
|
7
7
|
import { Whatsapp } from '../index';
|
|
8
8
|
import { mockData } from './mockData';
|
|
9
9
|
import * as constants from '../constants';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
jest.mock('../../../v2Containers/TagList/index.js', () => ({
|
|
14
|
-
__esModule: true,
|
|
15
|
-
default: (props) => (
|
|
16
|
-
<div className="tag-mock" {...props}>
|
|
17
|
-
TagList
|
|
18
|
-
</div>
|
|
19
|
-
),
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
11
|
let store;
|
|
12
|
+
let browserHistory = createBrowserHistory();
|
|
23
13
|
beforeAll(() => {
|
|
24
|
-
store = configureStore({}, initialReducer,
|
|
14
|
+
store = configureStore({}, initialReducer, browserHistory);
|
|
25
15
|
});
|
|
26
16
|
|
|
27
|
-
jest.mock('../../../v2Containers/TagList/index.js', () => ({
|
|
28
|
-
__esModule: true,
|
|
29
|
-
default: (props) => (
|
|
30
|
-
<div className="tag-mock" {...props}>
|
|
31
|
-
TagList
|
|
32
|
-
</div>
|
|
33
|
-
),
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
17
|
describe('Creatives Whatsapp test1/>', () => {
|
|
37
18
|
let renderedComponent;
|
|
38
19
|
const createWhatsappTemplate = jest.fn();
|
|
@@ -255,19 +236,19 @@ describe('Creatives Whatsapp test1/>', () => {
|
|
|
255
236
|
.onChange(event);
|
|
256
237
|
expect(renderedComponent).toMatchSnapshot();
|
|
257
238
|
});
|
|
258
|
-
it('check unsubscribe',
|
|
239
|
+
it('check unsubscribe', () => {
|
|
259
240
|
renderHelper({});
|
|
260
|
-
expect(
|
|
261
|
-
await renderedComponent
|
|
262
|
-
.find('CapCheckbox.whatsapp-unsubscribe-checkbox')
|
|
263
|
-
.props().checked,
|
|
264
|
-
).toBe(false);
|
|
265
241
|
let event = { target: { checked: true } };
|
|
266
|
-
|
|
242
|
+
renderedComponent
|
|
267
243
|
.find('CapCheckbox.whatsapp-unsubscribe-checkbox')
|
|
268
244
|
.props()
|
|
269
245
|
.onChange(event);
|
|
270
|
-
|
|
246
|
+
renderedComponent.update();
|
|
247
|
+
expect(
|
|
248
|
+
renderedComponent
|
|
249
|
+
.find('CapCheckbox.whatsapp-unsubscribe-checkbox')
|
|
250
|
+
.props().checked,
|
|
251
|
+
).toBe(true);
|
|
271
252
|
expect(renderedComponent).toMatchSnapshot();
|
|
272
253
|
});
|
|
273
254
|
it('should render edit mode in various cases', () => {
|
|
@@ -3,7 +3,7 @@ import { injectIntl } from 'react-intl';
|
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
4
|
import { Provider } from 'react-redux';
|
|
5
5
|
import { configureStore } from '@capillarytech/vulcan-react-sdk/utils';
|
|
6
|
-
import
|
|
6
|
+
import { createBrowserHistory } from 'history';
|
|
7
7
|
import { initialReducer } from '../../../initialReducer';
|
|
8
8
|
import { Zalo } from '..';
|
|
9
9
|
import {
|
|
@@ -26,18 +26,10 @@ const mockGlobalActions = {
|
|
|
26
26
|
fetchSchemaForEntity: jest.fn(),
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
jest.mock('../../../v2Containers/TagList/index.js', () => ({
|
|
30
|
-
__esModule: true,
|
|
31
|
-
default: (props) => (
|
|
32
|
-
<div className="tag-mock" {...props}>
|
|
33
|
-
TagList
|
|
34
|
-
</div>
|
|
35
|
-
),
|
|
36
|
-
}));
|
|
37
|
-
|
|
38
29
|
let store;
|
|
30
|
+
let browserHistory = createBrowserHistory();
|
|
39
31
|
beforeAll(() => {
|
|
40
|
-
store = configureStore({}, initialReducer,
|
|
32
|
+
store = configureStore({}, initialReducer, browserHistory);
|
|
41
33
|
});
|
|
42
34
|
|
|
43
35
|
const ComponentToRender = injectIntl(Zalo);
|