@capillarytech/creatives-library 7.14.41 → 7.15.3

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 (51) hide show
  1. package/containers/Cap/tests/__snapshots__/index.test.js.snap +4 -193
  2. package/containers/LanguageProvider/index.js +0 -2
  3. package/containers/LanguageProvider/tests/index.test.js +0 -1
  4. package/i18n.js +8 -11
  5. package/package.json +1 -1
  6. package/reducers.js +0 -2
  7. package/services/api.js +1 -9
  8. package/translations/en.json +4 -192
  9. package/translations/zh.json +3 -191
  10. package/v2Components/CapActionButton/index.js +0 -1
  11. package/v2Components/CapVideoUpload/index.scss +5 -0
  12. package/v2Components/FormBuilder/index.js +4 -28
  13. package/v2Containers/Assets/Gallery/index.js +1 -1
  14. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +4 -193
  15. package/v2Containers/CreativesContainer/constants.js +0 -2
  16. package/v2Containers/CreativesContainer/index.js +2 -2
  17. package/v2Containers/CreativesContainer/selectors.js +2 -2
  18. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -8
  19. package/v2Containers/CreativesContainer/tests/index.test.js +0 -28
  20. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +12 -582
  21. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +8 -386
  22. package/v2Containers/Line/Container/Text/index.js +2 -3
  23. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +68 -3285
  24. package/v2Containers/Line/Container/index.js +1 -1
  25. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +72 -3474
  26. package/v2Containers/Rcs/index.js +0 -3
  27. package/v2Containers/Rcs/messages.js +1 -1
  28. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +253 -9383
  29. package/v2Containers/Sms/Create/actions.js +0 -9
  30. package/v2Containers/Sms/Create/constants.js +0 -2
  31. package/v2Containers/Sms/Create/index.js +0 -12
  32. package/v2Containers/Sms/Create/sagas.js +3 -19
  33. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +16 -772
  34. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +32 -1544
  35. package/v2Containers/Templates/index.js +3 -2
  36. package/v2Containers/Templates/messages.js +2 -2
  37. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +0 -16
  38. package/v2Containers/TemplatesV2/index.js +1 -1
  39. package/v2Containers/Viber/index.js +0 -1
  40. package/v2Containers/Whatsapp/index.js +1 -0
  41. package/v2Containers/Whatsapp/messages.js +1 -1
  42. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +284 -13755
  43. package/v2Containers/mockdata.js +0 -128
  44. package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +0 -420
  45. package/tests/integration/TemplateCreation/api-response.js +0 -1663
  46. package/tests/integration/TemplateCreation/helper.js +0 -23
  47. package/tests/integration/TemplateCreation/mocks/initialState.js +0 -428
  48. package/tests/integration/TemplateCreation/msw-handler.js +0 -48
  49. package/translations/ja-JP.json +0 -2013
  50. package/v2Containers/Sms/Create/tests/sagas.test.js +0 -82
  51. package/v2Containers/SmsTrai/Create/tests/selectors.test.js +0 -10
@@ -1,82 +0,0 @@
1
- import { expectSaga } from "redux-saga-test-plan";
2
- import { take, cancel, takeLatest } from "redux-saga/effects";
3
- import * as matchers from "redux-saga-test-plan/matchers";
4
- import { LOCATION_CHANGE } from "react-router-redux";
5
- import { throwError } from "redux-saga-test-plan/providers";
6
- import { createMockTask } from "redux-saga/utils";
7
- import * as types from "../constants";
8
- import { watchAiSuggestions, getAiSuggestions } from "../sagas";
9
- import * as Api from "../../../../services/api";
10
-
11
- describe("getAiSuggestions saga", () => {
12
- it("Should handle valid response from api", () => {
13
- const successCallback = () => {};
14
- const failureCallback = () => {};
15
- const action = {
16
- type: types.GET_AI_SUGGESTIONS,
17
- prompt: {},
18
- successCallback,
19
- failureCallback,
20
- };
21
- expectSaga(getAiSuggestions, action)
22
- .provide([
23
- [
24
- matchers.call.fn(Api.getAiSuggestions),
25
- {
26
- success: true,
27
- status: {
28
- isError: false,
29
- code: 200,
30
- message: "success",
31
- },
32
- message: "Meta data fetched successfully",
33
- response: {
34
- "https://response.com": 1400,
35
- },
36
- },
37
- ],
38
- [matchers.call.fn(successCallback)],
39
- ])
40
- .run();
41
- });
42
-
43
- it("Should handles error thrown from api", () => {
44
- const successCallback = () => {};
45
- const failureCallback = () => {};
46
- const action = {
47
- type: types.GET_AI_SUGGESTIONS,
48
- prompt: {},
49
- successCallback,
50
- failureCallback,
51
- };
52
- expectSaga(getAiSuggestions, action)
53
- .provide([[matchers.call.fn(Api.getAiSuggestions), throwError()]])
54
- .run();
55
- });
56
- });
57
-
58
- describe("watchAiSuggestions saga", () => {
59
- let generator = null;
60
- beforeEach(() => {
61
- generator = watchAiSuggestions();
62
- });
63
- it("Should handle valid response from api", () => {
64
- const progress1 = generator.next();
65
- const mockTask = takeLatest(types.GET_AI_SUGGESTIONS, getAiSuggestions);
66
- expect(progress1.value).toEqual(mockTask);
67
- const progress2 = generator.next();
68
- expect(progress2.value).toEqual(take(LOCATION_CHANGE));
69
- });
70
-
71
- it("Should handle LOCATION_CHANGE action and cancel the watcher", () => {
72
- generator = watchAiSuggestions();
73
- const mockTask = createMockTask();
74
-
75
- expect(generator.next().value).toEqual(
76
- takeLatest(types.GET_AI_SUGGESTIONS, getAiSuggestions)
77
- );
78
- expect(generator.next(mockTask).value).toEqual(take(LOCATION_CHANGE));
79
- expect(generator.next().value).toEqual(cancel(mockTask));
80
- expect(generator.next().done).toEqual(true);
81
- });
82
- });
@@ -1,10 +0,0 @@
1
- import { fromJS } from 'immutable';
2
-
3
- import makeSelectSmsTrai from '../selectors';
4
-
5
- describe('selectLanguage', () => {
6
- it('should select the global state', () => {
7
- const mockedState = fromJS({});
8
- expect(makeSelectSmsTrai()(mockedState)).toEqual(undefined);
9
- });
10
- });