@applicaster/zapp-react-native-utils 15.1.6-alpha.3988508055 → 16.0.0-alpha.1020865559
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/README.md +0 -6
- package/actionUtils/index.ts +7 -0
- package/actionsExecutor/ActionExecutorContext.tsx +0 -4
- package/actionsExecutor/actions/__tests__/showToast.test.ts +29 -4
- package/actionsExecutor/actions/index.ts +0 -4
- package/actionsExecutor/actions/refreshComponent.ts +4 -35
- package/actionsExecutor/actions/showToast.ts +59 -6
- package/adsUtils/__tests__/createVMAP.test.ts +419 -0
- package/adsUtils/index.ts +2 -2
- package/analyticsUtils/README.md +1 -1
- package/appDataUtils/__tests__/urlScheme.test.ts +678 -0
- package/appUtils/HooksManager/__tests__/__snapshots__/hooksManager.test.js.snap +0 -188
- package/appUtils/HooksManager/__tests__/hooksManager.test.js +16 -2
- package/appUtils/HooksManager/index.ts +12 -18
- package/appUtils/RiverFocusManager/{index.js → index.ts} +25 -18
- package/appUtils/accessibilityManager/const.ts +4 -0
- package/appUtils/accessibilityManager/utils.ts +0 -1
- package/appUtils/contextKeysManager/__tests__/getKeys/failure.test.ts +7 -2
- package/appUtils/contextKeysManager/__tests__/getKeys/success.test.ts +48 -0
- package/appUtils/contextKeysManager/contextResolver.ts +51 -22
- package/appUtils/contextKeysManager/index.ts +65 -10
- package/appUtils/contextKeysManager/utils/index.ts +38 -25
- package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +3 -0
- package/appUtils/focusManager/index.ios.ts +43 -4
- package/appUtils/focusManager/treeDataStructure/Tree/__tests__/Tree.test.js +46 -0
- package/appUtils/focusManager/treeDataStructure/Tree/index.js +18 -18
- package/appUtils/focusManagerAux/utils/index.ios.ts +122 -0
- package/appUtils/focusManagerAux/utils/index.ts +11 -3
- package/appUtils/focusManagerAux/utils/utils.ios.ts +202 -3
- package/appUtils/keyCodes/keys/keys.web.ts +1 -4
- package/appUtils/orientationHelper.ts +2 -4
- package/appUtils/platform/platformUtils.ts +12 -1
- package/appUtils/playerManager/player.ts +4 -0
- package/appUtils/playerManager/playerNative.ts +30 -21
- package/appUtils/playerManager/usePlayerState.tsx +14 -2
- package/arrayUtils/__tests__/{anyThruthy.test.ts → anyTruthy.test.ts} +8 -0
- package/arrayUtils/__tests__/arrayUtils.test.ts +165 -108
- package/arrayUtils/__tests__/isEmptyArray.test.ts +11 -0
- package/arrayUtils/__tests__/isFilledArray.test.ts +12 -0
- package/arrayUtils/__tests__/isFirst.test.ts +17 -0
- package/arrayUtils/__tests__/isIndexInRange.test.ts +14 -0
- package/arrayUtils/__tests__/isLast.test.ts +31 -0
- package/arrayUtils/__tests__/makeListOf.test.ts +31 -0
- package/arrayUtils/__tests__/makeListOfIndexes.test.ts +20 -0
- package/arrayUtils/__tests__/sample.test.ts +61 -0
- package/arrayUtils/index.ts +57 -20
- package/cloudEventsUtils/__tests__/index.test.ts +529 -0
- package/cloudEventsUtils/index.ts +65 -1
- package/componentsUtils/index.ts +8 -0
- package/configurationUtils/__tests__/manifestKeyParser.test.ts +26 -26
- package/enumUtils/__tests__/getEnumKeyByEnumValue.test.ts +207 -0
- package/errorUtils/__tests__/GeneralError.test.ts +97 -0
- package/errorUtils/__tests__/HttpStatusCode.test.ts +344 -0
- package/errorUtils/__tests__/MissingPluginError.test.ts +113 -0
- package/errorUtils/__tests__/NetworkError.test.ts +202 -0
- package/errorUtils/__tests__/getParsedResponse.test.ts +188 -0
- package/errorUtils/__tests__/invariant.test.ts +112 -0
- package/focusManager/aux/index.ts +1 -1
- package/headersUtils/__tests__/headersUtils.test.js +11 -1
- package/headersUtils/index.ts +2 -1
- package/manifestUtils/_internals/__tests__/index.test.js +41 -0
- package/manifestUtils/_internals/index.js +33 -0
- package/manifestUtils/defaultManifestConfigurations/player.js +59 -1
- package/manifestUtils/index.js +3 -1
- package/manifestUtils/keys.js +236 -0
- package/manifestUtils/mobileAction/button/__tests__/mobileActionButton.test.js +168 -0
- package/manifestUtils/mobileAction/button/index.js +156 -0
- package/manifestUtils/mobileAction/container/__tests__/mobileActionButtonsContainer.test.js +102 -0
- package/manifestUtils/mobileAction/container/index.js +75 -0
- package/manifestUtils/mobileAction/groups/__tests__/buildMobileActionButtonGroups.test.js +127 -0
- package/manifestUtils/mobileAction/groups/defaults.js +78 -0
- package/manifestUtils/mobileAction/groups/index.js +80 -0
- package/manifestUtils/tvAction/container/index.js +1 -1
- package/modalState/index.ts +83 -30
- package/numberUtils/__tests__/isMinusZero.test.ts +20 -0
- package/numberUtils/__tests__/isZero.test.ts +27 -0
- package/numberUtils/__tests__/requireNumber.test.ts +50 -0
- package/numberUtils/__tests__/toNumber.test.ts +54 -0
- package/numberUtils/__tests__/toNumberWithDefault.test.ts +64 -0
- package/numberUtils/__tests__/toNumberWithDefaultZero.test.ts +48 -0
- package/numberUtils/__tests__/toPositiveNumber.test.ts +193 -0
- package/numberUtils/index.ts +46 -5
- package/package.json +4 -4
- package/pluginUtils/index.ts +4 -0
- package/reactHooks/advertising/index.ts +2 -2
- package/reactHooks/analytics/__tests__/useSendAnalyticsOnPress.test.ts +537 -0
- package/reactHooks/app/__tests__/useAppState.test.ts +1 -1
- package/reactHooks/autoscrolling/__tests__/useTrackCurrentAutoScrollingElement.test.ts +1 -1
- package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +1 -2
- package/reactHooks/cell-click/__tests__/index.test.js +1 -3
- package/reactHooks/cell-click/index.ts +15 -7
- package/reactHooks/configuration/__tests__/index.test.tsx +1 -1
- package/reactHooks/connection/__tests__/index.test.js +1 -1
- package/reactHooks/debugging/__tests__/index.test.js +4 -4
- package/reactHooks/dev/__tests__/useReRenderLog.test.ts +188 -0
- package/reactHooks/device/useIsTablet.tsx +14 -19
- package/reactHooks/device/useMemoizedIsTablet.ts +3 -3
- package/reactHooks/feed/__mocks__/useMarkPipesDataStale.ts +4 -0
- package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +32 -23
- package/reactHooks/feed/__tests__/useBuildPipesUrl.test.tsx +19 -19
- package/reactHooks/feed/__tests__/useEntryScreenId.test.tsx +4 -1
- package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +42 -30
- package/reactHooks/feed/__tests__/useInflatedUrl.test.tsx +1 -1
- package/reactHooks/feed/index.ts +5 -3
- package/reactHooks/feed/useBatchLoading.ts +17 -3
- package/reactHooks/feed/useEntryScreenId.ts +2 -2
- package/reactHooks/feed/{usePipesCacheReset.ts → useMarkPipesDataStale.ts} +14 -4
- package/reactHooks/flatList/useLoadNextPageIfNeeded.ts +13 -16
- package/reactHooks/layout/__tests__/index.test.tsx +1 -1
- package/reactHooks/layout/__tests__/useLayoutVersion.test.tsx +1 -1
- package/reactHooks/layout/useDimensions/__tests__/{useDimensions.test.ts → useDimensions.test.tsx} +105 -25
- package/reactHooks/layout/useDimensions/useDimensions.ts +2 -2
- package/reactHooks/navigation/__tests__/index.test.tsx +2 -4
- package/reactHooks/navigation/index.ts +7 -6
- package/reactHooks/navigation/useRoute.ts +8 -6
- package/reactHooks/player/TVSeekControlller/TVSeekController.ts +27 -10
- package/reactHooks/player/__tests__/useAutoSeek._test.tsx +1 -1
- package/reactHooks/player/__tests__/useTapSeek._test.ts +1 -1
- package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +1 -1
- package/reactHooks/resolvers/__tests__/useComponentResolver.test.tsx +1 -1
- package/reactHooks/resolvers/useCellResolver.ts +6 -2
- package/reactHooks/resolvers/useComponentResolver.ts +8 -2
- package/reactHooks/screen/__tests__/useCurrentScreenData.test.tsx +2 -2
- package/reactHooks/screen/__tests__/useIsStandaloneFullscreen.test.ts +114 -0
- package/reactHooks/screen/__tests__/useScreenBackgroundColor.test.tsx +1 -1
- package/reactHooks/screen/__tests__/useScreenData.test.tsx +1 -1
- package/reactHooks/screen/__tests__/useTargetScreenData.test.tsx +12 -4
- package/reactHooks/screen/useTargetScreenData.ts +4 -2
- package/reactHooks/state/useComponentScreenState.ts +1 -1
- package/reactHooks/state/useRivers.ts +1 -1
- package/reactHooks/ui/__tests__/useFadeOutWhenBlurred.test.ts +580 -0
- package/reactHooks/usePluginConfiguration.ts +2 -2
- package/reactHooks/utils/__tests__/index.test.js +1 -1
- package/reactHooks/utils/index.ts +3 -2
- package/rectUtils/__tests__/index.test.ts +549 -0
- package/rectUtils/index.ts +2 -2
- package/refreshUtils/RefreshCoordinator/__tests__/refreshCoordinator.test.ts +206 -0
- package/refreshUtils/RefreshCoordinator/index.ts +245 -0
- package/refreshUtils/RefreshCoordinator/utils/__tests__/getDataRefreshConfig.test.ts +104 -0
- package/refreshUtils/RefreshCoordinator/utils/index.ts +29 -0
- package/riverComponetsMeasurementProvider/index.tsx +1 -1
- package/screenPickerUtils/__tests__/index.test.ts +333 -0
- package/screenState/__tests__/index.test.ts +1 -1
- package/screenUtils/index.ts +3 -0
- package/searchUtils/const.ts +7 -0
- package/searchUtils/index.ts +3 -0
- package/stringUtils/index.ts +1 -1
- package/testUtils/index.tsx +30 -21
- package/time/__tests__/BackgroundTimer.test.ts +156 -0
- package/time/__tests__/Timer.test.ts +236 -0
- package/typeGuards/__tests__/isString.test.ts +21 -0
- package/typeGuards/index.ts +4 -0
- package/utils/__tests__/mergeRight.test.ts +48 -0
- package/utils/__tests__/path.test.ts +7 -0
- package/utils/__tests__/selectors.test.ts +124 -0
- package/utils/index.ts +13 -0
- package/utils/mergeRight.ts +5 -0
- package/utils/path.ts +6 -3
- package/utils/pathOr.ts +5 -1
- package/utils/selectors.ts +46 -0
- package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +1 -1
- package/zappFrameworkUtils/HookCallback/hookCallbackManifestExtensions.config.js +1 -1
- package/zappFrameworkUtils/__tests__/localStorageHelper.test.ts +146 -0
- package/zappFrameworkUtils/localStorageHelper.ts +19 -15
- package/zappFrameworkUtils/loginPluginUtils.ts +1 -1
- package/actionsExecutor/actions/__tests__/dismissBottomSheet.test.ts +0 -22
- package/actionsExecutor/actions/__tests__/loadItemsFromSource.test.ts +0 -88
- package/actionsExecutor/actions/__tests__/openBottomSheet.customContent.test.ts +0 -76
- package/actionsExecutor/actions/dismissBottomSheet.ts +0 -22
- package/actionsExecutor/actions/openBottomSheet.ts +0 -318
- package/modalState/ContentViewModel.ts +0 -111
- package/modalState/EditableCollection.ts +0 -17
- package/modalState/EditableCollectionRegistry.ts +0 -51
- package/modalState/ModalOrchestrator.ts +0 -198
- package/modalState/RemoteEditableCollection.ts +0 -189
- package/modalState/__tests__/ContentViewModel.editable.test.ts +0 -69
- package/modalState/__tests__/ContentViewModel.test.ts +0 -165
- package/modalState/__tests__/EditableCollectionRegistry.test.ts +0 -112
- package/modalState/__tests__/ModalOrchestrator.phase3.test.ts +0 -28
- package/modalState/__tests__/RemoteEditableCollection.test.ts +0 -259
- package/modalState/__tests__/useBottomSheetContent.test.ts +0 -372
- package/modalState/store.ts +0 -102
- package/modalState/types.ts +0 -110
- package/modalState/useBottomSheetContent.ts +0 -98
- package/reactHooks/componentsMap/index.ts +0 -55
- package/reactHooks/feed/__mocks__/usePipesCacheReset.ts +0 -1
- package/reactHooks/feed/__tests__/useFeedRefresh.test.tsx +0 -75
- package/reactHooks/feed/useFeedRefresh.tsx +0 -65
package/arrayUtils/index.ts
CHANGED
|
@@ -3,17 +3,16 @@ import * as R from "ramda";
|
|
|
3
3
|
import { invariant } from "@applicaster/zapp-react-native-utils/errorUtils";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @returns {Array<T>}
|
|
6
|
+
* Shifts an array by the given offset and returns a new array (does not mutate).
|
|
7
|
+
* A positive offset moves items from the head to the tail;
|
|
8
|
+
* a negative offset moves items from the tail to the head.
|
|
9
|
+
* An offset of `0` leaves the order unchanged.
|
|
10
|
+
*
|
|
11
|
+
* Curried (Ramda): `shiftArray(offset)(array)` or `shiftArray(offset, array)`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* shiftArray(-1, [1, 2, 3, 4]) // => [4, 1, 2, 3]
|
|
15
|
+
* shiftArray(1, [1, 2, 3, 4]) // => [2, 3, 4, 1]
|
|
17
16
|
*/
|
|
18
17
|
export const shiftArray = R.curry(
|
|
19
18
|
<T extends unknown>(offset: number, array: T[]): T[] => {
|
|
@@ -25,10 +24,9 @@ export const shiftArray = R.curry(
|
|
|
25
24
|
);
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @returns {Array<any>}
|
|
27
|
+
* Removes the first item equal to `item` from `list` (Ramda `equals` / deep equality).
|
|
28
|
+
* If the item is not found, returns the same list reference; otherwise returns a new
|
|
29
|
+
* array without that element.
|
|
32
30
|
*/
|
|
33
31
|
export function removeItemFromList<T extends unknown>(item: T, list: T[]): T[] {
|
|
34
32
|
return R.compose(
|
|
@@ -37,6 +35,12 @@ export function removeItemFromList<T extends unknown>(item: T, list: T[]): T[] {
|
|
|
37
35
|
)(list);
|
|
38
36
|
}
|
|
39
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Maps each value to a promise and resolves them all in parallel via `Promise.all`.
|
|
40
|
+
* The mapper receives `(value, index)`.
|
|
41
|
+
*
|
|
42
|
+
* Curried (Ramda): `mapPromises(fn)(values)` or `mapPromises(fn, values)`.
|
|
43
|
+
*/
|
|
40
44
|
export const mapPromises = R.curry(
|
|
41
45
|
<T extends unknown, S extends unknown>(
|
|
42
46
|
fn: (value: T, index?: number) => Promise<S>,
|
|
@@ -44,6 +48,10 @@ export const mapPromises = R.curry(
|
|
|
44
48
|
): Promise<S[]> => Promise.all(R.addIndex(R.map)(R.nAry(2, fn), values))
|
|
45
49
|
);
|
|
46
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Awaits `previousPromise`, then runs `fn(currentValue, previousValue, index)`.
|
|
53
|
+
* Used internally by `reducePromises` as a Ramda-indexed reducer step.
|
|
54
|
+
*/
|
|
47
55
|
const waitForPromiseAndRun = R.curryN(
|
|
48
56
|
3,
|
|
49
57
|
async <T extends unknown, S extends unknown>(
|
|
@@ -58,6 +66,14 @@ const waitForPromiseAndRun = R.curryN(
|
|
|
58
66
|
}
|
|
59
67
|
);
|
|
60
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Reduces a list by applying an async function sequentially.
|
|
71
|
+
* Each step awaits the previous result, then calls `fn(current, previous, index)`.
|
|
72
|
+
* An empty list resolves to `initialValue` without calling `fn`.
|
|
73
|
+
*
|
|
74
|
+
* Curried (Ramda): `reducePromises(fn)(initialValue)(values)` or
|
|
75
|
+
* `reducePromises(fn, initialValue, values)`.
|
|
76
|
+
*/
|
|
61
77
|
export const reducePromises = R.curry(
|
|
62
78
|
<T extends unknown, S extends unknown>(
|
|
63
79
|
fn: (current: T, previous: S, index?: number) => Promise<S>,
|
|
@@ -71,18 +87,32 @@ export const reducePromises = R.curry(
|
|
|
71
87
|
)
|
|
72
88
|
);
|
|
73
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Returns a function that maps a list with `mapperFn`, then splits the result
|
|
92
|
+
* into chunks of size `chunks` (`R.splitEvery`).
|
|
93
|
+
*
|
|
94
|
+
* Curried (Ramda): `mapAndSplit(mapperFn, chunks)(values)`.
|
|
95
|
+
*/
|
|
74
96
|
export const mapAndSplit = R.curry(
|
|
75
97
|
<T extends unknown, S extends unknown>(
|
|
76
|
-
mapperFn: (T) => S,
|
|
98
|
+
mapperFn: (value: T) => S,
|
|
77
99
|
chunks: number
|
|
78
|
-
): S[][] =>
|
|
100
|
+
): ((values: T[]) => S[][]) =>
|
|
101
|
+
(values: T[]) =>
|
|
102
|
+
R.splitEvery(chunks, R.map(mapperFn, values))
|
|
79
103
|
);
|
|
80
104
|
|
|
105
|
+
/** Returns `true` when `index` is at or past the last position (`length - 1`). */
|
|
81
106
|
export const isLast = (index: number, length: number): boolean =>
|
|
82
107
|
index >= length - 1;
|
|
83
108
|
|
|
109
|
+
/** Returns `true` when `index` is `0` or negative. */
|
|
84
110
|
export const isFirst = (index: number): boolean => index <= 0;
|
|
85
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Returns `true` when `index` is a valid zero-based index for a list of the
|
|
114
|
+
* given `length`. Returns `false` for empty/negative lengths or negative indexes.
|
|
115
|
+
*/
|
|
86
116
|
export const isIndexInRange = (index: number, length: number): boolean => {
|
|
87
117
|
if (length <= 0) return false;
|
|
88
118
|
if (index < 0) return false;
|
|
@@ -90,24 +120,29 @@ export const isIndexInRange = (index: number, length: number): boolean => {
|
|
|
90
120
|
return index + 1 <= length;
|
|
91
121
|
};
|
|
92
122
|
|
|
123
|
+
/** Builds `[0, 1, ..., size - 1]`. Negative or zero `size` yields `[]`. */
|
|
93
124
|
export const makeListOfIndexes = (size: number): number[] =>
|
|
94
125
|
Array.from({ length: size }, (_, index) => index);
|
|
95
126
|
|
|
127
|
+
/** Builds an array of the given `size` filled with `value`. */
|
|
96
128
|
export const makeListOf = <T>(value: T, size: number): T[] => {
|
|
97
129
|
return Array(size).fill(value);
|
|
98
130
|
};
|
|
99
131
|
|
|
100
|
-
/** Checks if a value is a non-empty array */
|
|
132
|
+
/** Checks if a value is a non-empty array. */
|
|
101
133
|
export function isFilledArray(value: unknown): boolean {
|
|
102
134
|
return Array.isArray(value) && value.length > 0;
|
|
103
135
|
}
|
|
104
136
|
|
|
105
|
-
/** Checks if a value is
|
|
137
|
+
/** Checks if a value is an empty array. */
|
|
106
138
|
export function isEmptyArray(value: unknown): boolean {
|
|
107
139
|
return Array.isArray(value) && value.length === 0;
|
|
108
140
|
}
|
|
109
141
|
|
|
110
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Returns a random item from a non-empty array.
|
|
144
|
+
* Throws (in development via `invariant`) if the input is not an array or is empty.
|
|
145
|
+
*/
|
|
111
146
|
export const sample = (xs: unknown[]): unknown => {
|
|
112
147
|
invariant(Array.isArray(xs), `input value is not an array: ${xs}`);
|
|
113
148
|
invariant(isFilledArray(xs), `input array is empty: ${xs}`);
|
|
@@ -117,7 +152,9 @@ export const sample = (xs: unknown[]): unknown => {
|
|
|
117
152
|
return xs[index];
|
|
118
153
|
};
|
|
119
154
|
|
|
155
|
+
/** Returns `true` when `xs` is non-empty and every value is truthy. */
|
|
120
156
|
export const allTruthy = (xs: boolean[]) =>
|
|
121
157
|
isFilledArray(xs) && xs.every(Boolean);
|
|
122
158
|
|
|
159
|
+
/** Returns `true` when at least one value in `xs` is truthy. */
|
|
123
160
|
export const anyTruthy = (xs: boolean[]) => xs.some(Boolean);
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
// Mock dependencies are set up before requiring the module
|
|
2
|
+
// The module is required dynamically in beforeEach to allow test-specific setup
|
|
3
|
+
// and state is reset using resetCloudEventsSource() between tests
|
|
4
|
+
jest.mock("uuid", () => ({
|
|
5
|
+
v4: jest.fn(() => "test-uuid-1234"),
|
|
6
|
+
}));
|
|
7
|
+
|
|
8
|
+
jest.mock("@applicaster/zapp-pipes-v2-client", () => ({
|
|
9
|
+
RequestBuilder: jest.fn().mockImplementation(() => ({
|
|
10
|
+
setUrl: jest.fn().mockReturnThis(),
|
|
11
|
+
setMethod: jest.fn().mockReturnThis(),
|
|
12
|
+
addBodyParams: jest.fn().mockReturnThis(),
|
|
13
|
+
call: jest.fn().mockResolvedValue({ success: true }),
|
|
14
|
+
})),
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
jest.mock(
|
|
18
|
+
"@applicaster/zapp-react-native-bridge/ZappStorage/SessionStorage",
|
|
19
|
+
() => ({
|
|
20
|
+
sessionStorage: {
|
|
21
|
+
getItem: jest.fn(),
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
jest.mock("@applicaster/zapp-react-native-utils/appDataUtils", () => ({
|
|
27
|
+
getAppUrlScheme: jest.fn(),
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
import { v4 as uuid } from "uuid";
|
|
31
|
+
import { RequestBuilder } from "@applicaster/zapp-pipes-v2-client";
|
|
32
|
+
import { sessionStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/SessionStorage";
|
|
33
|
+
import { getAppUrlScheme } from "@applicaster/zapp-react-native-utils/appDataUtils";
|
|
34
|
+
import type { CloudEvent, CreateCloudEventParams } from "../index";
|
|
35
|
+
|
|
36
|
+
describe("cloudEventsUtils", () => {
|
|
37
|
+
const mockGetAppUrlScheme = getAppUrlScheme as jest.MockedFunction<
|
|
38
|
+
typeof getAppUrlScheme
|
|
39
|
+
>;
|
|
40
|
+
|
|
41
|
+
const mockSessionStorageGetItem =
|
|
42
|
+
sessionStorage.getItem as jest.MockedFunction<
|
|
43
|
+
typeof sessionStorage.getItem
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
const mockUuid = uuid as jest.MockedFunction<typeof uuid>;
|
|
47
|
+
|
|
48
|
+
let createCloudEvent: <T = any>(
|
|
49
|
+
params: CreateCloudEventParams<T>
|
|
50
|
+
) => Promise<CloudEvent<T>>;
|
|
51
|
+
|
|
52
|
+
let sendCloudEvent: <T = any>(
|
|
53
|
+
cloudEvent: CloudEvent<T>,
|
|
54
|
+
url: string
|
|
55
|
+
) => Promise<any>;
|
|
56
|
+
|
|
57
|
+
beforeEach(() => {
|
|
58
|
+
jest.clearAllMocks();
|
|
59
|
+
|
|
60
|
+
// Setup default mocks
|
|
61
|
+
mockGetAppUrlScheme.mockReturnValue("myapp");
|
|
62
|
+
|
|
63
|
+
mockSessionStorageGetItem
|
|
64
|
+
.mockResolvedValueOnce("com.example.app") // bundleId
|
|
65
|
+
.mockResolvedValueOnce("1.0.0"); // appVersion
|
|
66
|
+
|
|
67
|
+
mockUuid.mockReturnValue("test-uuid-1234");
|
|
68
|
+
|
|
69
|
+
const utils = require("../");
|
|
70
|
+
createCloudEvent = utils.createCloudEvent;
|
|
71
|
+
sendCloudEvent = utils.sendCloudEvent;
|
|
72
|
+
utils.resetCloudEventsSource();
|
|
73
|
+
|
|
74
|
+
// Note: Source caching means tests will reuse the source from the first test
|
|
75
|
+
// Tests that need specific source values or error conditions should run in isolation
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe("createCloudEvent", () => {
|
|
79
|
+
it("should create a cloud event with all required fields", async () => {
|
|
80
|
+
const { createCloudEvent } = require("../index");
|
|
81
|
+
|
|
82
|
+
const event = await createCloudEvent({
|
|
83
|
+
type: "user.action",
|
|
84
|
+
subject: "button.click",
|
|
85
|
+
data: { buttonId: "submit" },
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
expect(event).toHaveProperty("specversion", "1.0");
|
|
89
|
+
expect(event).toHaveProperty("type", "user.action");
|
|
90
|
+
expect(event).toHaveProperty("subject", "button.click");
|
|
91
|
+
expect(event).toHaveProperty("datacontenttype", "application/json");
|
|
92
|
+
expect(event).toHaveProperty("source");
|
|
93
|
+
expect(event).toHaveProperty("time");
|
|
94
|
+
expect(event).toHaveProperty("id", "test-uuid-1234");
|
|
95
|
+
expect(event).toHaveProperty("data", { buttonId: "submit" });
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("should generate source from appUrlScheme, bundleId, and appVersion", async () => {
|
|
99
|
+
mockGetAppUrlScheme.mockReset();
|
|
100
|
+
mockGetAppUrlScheme.mockReturnValue("testapp");
|
|
101
|
+
|
|
102
|
+
mockSessionStorageGetItem.mockReset();
|
|
103
|
+
|
|
104
|
+
mockSessionStorageGetItem
|
|
105
|
+
.mockResolvedValueOnce("com.test.bundle")
|
|
106
|
+
.mockResolvedValueOnce("2.3.4");
|
|
107
|
+
|
|
108
|
+
const { createCloudEvent } = require("../index");
|
|
109
|
+
|
|
110
|
+
const event = await createCloudEvent({
|
|
111
|
+
type: "test.event",
|
|
112
|
+
subject: "test",
|
|
113
|
+
data: {},
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
expect(event.source).toBe("testapp://com.test.bundle/versions/2.3.4");
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("should generate unique ID using uuid", async () => {
|
|
120
|
+
mockUuid.mockReturnValueOnce("uuid-1").mockReturnValueOnce("uuid-2");
|
|
121
|
+
|
|
122
|
+
const { createCloudEvent } = require("../index");
|
|
123
|
+
|
|
124
|
+
const event1 = await createCloudEvent({
|
|
125
|
+
type: "event1",
|
|
126
|
+
subject: "subject1",
|
|
127
|
+
data: {},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const event2 = await createCloudEvent({
|
|
131
|
+
type: "event2",
|
|
132
|
+
subject: "subject2",
|
|
133
|
+
data: {},
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
expect(event1.id).toBe("uuid-1");
|
|
137
|
+
expect(event2.id).toBe("uuid-2");
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it("should generate ISO timestamp for time field", async () => {
|
|
141
|
+
const event = await createCloudEvent({
|
|
142
|
+
type: "test.event",
|
|
143
|
+
subject: "test",
|
|
144
|
+
data: {},
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Verify ISO 8601 format
|
|
148
|
+
expect(event.time).toMatch(
|
|
149
|
+
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
// Verify it's a valid date
|
|
153
|
+
expect(new Date(event.time).getTime()).toBeGreaterThan(0);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it("should include custom data in event", async () => {
|
|
157
|
+
const customData = {
|
|
158
|
+
userId: "user123",
|
|
159
|
+
action: "purchase",
|
|
160
|
+
amount: 99.99,
|
|
161
|
+
items: ["item1", "item2"],
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const event = await createCloudEvent({
|
|
165
|
+
type: "commerce.purchase",
|
|
166
|
+
subject: "order.completed",
|
|
167
|
+
data: customData,
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
expect(event.data).toEqual(customData);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it("should throw error when appUrlScheme is missing", async () => {
|
|
174
|
+
jest.clearAllMocks();
|
|
175
|
+
mockSessionStorageGetItem.mockReset();
|
|
176
|
+
mockGetAppUrlScheme.mockReturnValue(null as any);
|
|
177
|
+
|
|
178
|
+
mockSessionStorageGetItem
|
|
179
|
+
.mockResolvedValueOnce("com.example.app")
|
|
180
|
+
.mockResolvedValueOnce("1.0.0");
|
|
181
|
+
|
|
182
|
+
mockUuid.mockReturnValue("test-uuid-1234");
|
|
183
|
+
|
|
184
|
+
const { createCloudEvent: freshCreate } = require("../index");
|
|
185
|
+
|
|
186
|
+
await expect(
|
|
187
|
+
freshCreate({
|
|
188
|
+
type: "test",
|
|
189
|
+
subject: "test",
|
|
190
|
+
data: {},
|
|
191
|
+
})
|
|
192
|
+
).rejects.toThrow("Can not create client data addSource");
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it("should throw error when bundleId is missing", async () => {
|
|
196
|
+
jest.clearAllMocks();
|
|
197
|
+
mockSessionStorageGetItem.mockReset();
|
|
198
|
+
mockGetAppUrlScheme.mockReturnValue("myapp");
|
|
199
|
+
|
|
200
|
+
mockSessionStorageGetItem
|
|
201
|
+
.mockResolvedValueOnce(null) // bundleId
|
|
202
|
+
.mockResolvedValueOnce("1.0.0");
|
|
203
|
+
|
|
204
|
+
mockUuid.mockReturnValue("test-uuid-1234");
|
|
205
|
+
|
|
206
|
+
const { createCloudEvent: freshCreate } = require("../index");
|
|
207
|
+
|
|
208
|
+
await expect(
|
|
209
|
+
freshCreate({
|
|
210
|
+
type: "test",
|
|
211
|
+
subject: "test",
|
|
212
|
+
data: {},
|
|
213
|
+
})
|
|
214
|
+
).rejects.toThrow("Can not create client data addSource");
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it("should throw error when appVersion is missing", async () => {
|
|
218
|
+
jest.clearAllMocks();
|
|
219
|
+
mockSessionStorageGetItem.mockReset();
|
|
220
|
+
mockGetAppUrlScheme.mockReturnValue("myapp");
|
|
221
|
+
|
|
222
|
+
mockSessionStorageGetItem
|
|
223
|
+
.mockResolvedValueOnce("com.example.app")
|
|
224
|
+
.mockResolvedValueOnce(null); // appVersion
|
|
225
|
+
|
|
226
|
+
mockUuid.mockReturnValue("test-uuid-1234");
|
|
227
|
+
|
|
228
|
+
const { createCloudEvent: freshCreate } = require("../index");
|
|
229
|
+
|
|
230
|
+
await expect(
|
|
231
|
+
freshCreate({
|
|
232
|
+
type: "test",
|
|
233
|
+
subject: "test",
|
|
234
|
+
data: {},
|
|
235
|
+
})
|
|
236
|
+
).rejects.toThrow("Can not create client data addSource");
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it("should cache source after first call", async () => {
|
|
240
|
+
jest.clearAllMocks();
|
|
241
|
+
mockGetAppUrlScheme.mockReturnValue("myapp");
|
|
242
|
+
|
|
243
|
+
mockSessionStorageGetItem.mockReset();
|
|
244
|
+
|
|
245
|
+
mockSessionStorageGetItem
|
|
246
|
+
.mockResolvedValueOnce("com.example.app")
|
|
247
|
+
.mockResolvedValueOnce("1.0.0");
|
|
248
|
+
|
|
249
|
+
mockUuid.mockReturnValueOnce("uuid-1").mockReturnValueOnce("uuid-2");
|
|
250
|
+
|
|
251
|
+
const freshUtils = require("../index");
|
|
252
|
+
freshUtils.resetCloudEventsSource();
|
|
253
|
+
|
|
254
|
+
const { createCloudEvent: freshCreate } = freshUtils;
|
|
255
|
+
|
|
256
|
+
const event1 = await freshCreate({
|
|
257
|
+
type: "event1",
|
|
258
|
+
subject: "subject1",
|
|
259
|
+
data: {},
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
const event2 = await freshCreate({
|
|
263
|
+
type: "event2",
|
|
264
|
+
subject: "subject2",
|
|
265
|
+
data: {},
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
expect(event1.source).toBe(event2.source);
|
|
269
|
+
expect(mockGetAppUrlScheme).toHaveBeenCalledTimes(1);
|
|
270
|
+
expect(mockSessionStorageGetItem).toHaveBeenCalledTimes(2);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it("should handle empty data object", async () => {
|
|
274
|
+
const event = await createCloudEvent({
|
|
275
|
+
type: "test.event",
|
|
276
|
+
subject: "test.subject",
|
|
277
|
+
data: {},
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
expect(event.data).toEqual({});
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it("should handle null data", async () => {
|
|
284
|
+
const event = await createCloudEvent({
|
|
285
|
+
type: "test.event",
|
|
286
|
+
subject: "test.subject",
|
|
287
|
+
data: null,
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
expect(event.data).toBeNull();
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it("should handle complex nested data", async () => {
|
|
294
|
+
const complexData = {
|
|
295
|
+
level1: {
|
|
296
|
+
level2: {
|
|
297
|
+
level3: {
|
|
298
|
+
value: "deep",
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
array: [1, 2, { nested: true }],
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const event = await createCloudEvent({
|
|
306
|
+
type: "test.event",
|
|
307
|
+
subject: "test.subject",
|
|
308
|
+
data: complexData,
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
expect(event.data).toEqual(complexData);
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
describe("sendCloudEvent", () => {
|
|
316
|
+
let mockRequestBuilder: any;
|
|
317
|
+
|
|
318
|
+
beforeEach(() => {
|
|
319
|
+
mockRequestBuilder = {
|
|
320
|
+
setUrl: jest.fn().mockReturnThis(),
|
|
321
|
+
setMethod: jest.fn().mockReturnThis(),
|
|
322
|
+
addBodyParams: jest.fn().mockReturnThis(),
|
|
323
|
+
call: jest.fn().mockResolvedValue({ success: true, data: "response" }),
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
(
|
|
327
|
+
RequestBuilder as jest.MockedClass<typeof RequestBuilder>
|
|
328
|
+
).mockImplementation(() => mockRequestBuilder);
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it("should send cloud event to specified URL", async () => {
|
|
332
|
+
const cloudEvent: CloudEvent = {
|
|
333
|
+
specversion: "1.0" as const,
|
|
334
|
+
type: "test.event",
|
|
335
|
+
subject: "test",
|
|
336
|
+
source: "test://source",
|
|
337
|
+
id: "123",
|
|
338
|
+
time: new Date().toISOString(),
|
|
339
|
+
datacontenttype: "application/json" as const,
|
|
340
|
+
data: {},
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const url = "https://api.example.com/events";
|
|
344
|
+
|
|
345
|
+
await sendCloudEvent(cloudEvent, url);
|
|
346
|
+
|
|
347
|
+
expect(mockRequestBuilder.setUrl).toHaveBeenCalledWith(url);
|
|
348
|
+
expect(mockRequestBuilder.setMethod).toHaveBeenCalledWith("POST");
|
|
349
|
+
expect(mockRequestBuilder.addBodyParams).toHaveBeenCalledWith(cloudEvent);
|
|
350
|
+
expect(mockRequestBuilder.call).toHaveBeenCalled();
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it("should return response from API call", async () => {
|
|
354
|
+
const cloudEvent: CloudEvent = {
|
|
355
|
+
specversion: "1.0" as const,
|
|
356
|
+
type: "test.event",
|
|
357
|
+
subject: "test",
|
|
358
|
+
source: "test://source",
|
|
359
|
+
id: "123",
|
|
360
|
+
time: new Date().toISOString(),
|
|
361
|
+
datacontenttype: "application/json" as const,
|
|
362
|
+
data: {},
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
const expectedResponse = { success: true, eventId: "evt-123" };
|
|
366
|
+
mockRequestBuilder.call.mockResolvedValue(expectedResponse);
|
|
367
|
+
|
|
368
|
+
const result = await sendCloudEvent(
|
|
369
|
+
cloudEvent,
|
|
370
|
+
"https://api.example.com/events"
|
|
371
|
+
);
|
|
372
|
+
|
|
373
|
+
expect(result).toEqual(expectedResponse);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it("should throw error when URL is missing", async () => {
|
|
377
|
+
const cloudEvent: CloudEvent = {
|
|
378
|
+
specversion: "1.0" as const,
|
|
379
|
+
type: "test.event",
|
|
380
|
+
subject: "test",
|
|
381
|
+
source: "test://source",
|
|
382
|
+
id: "123",
|
|
383
|
+
time: new Date().toISOString(),
|
|
384
|
+
datacontenttype: "application/json" as const,
|
|
385
|
+
data: {},
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
await expect(sendCloudEvent(cloudEvent, "")).rejects.toThrow(
|
|
389
|
+
"Feed locator is missing"
|
|
390
|
+
);
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
it("should throw error when URL is null", async () => {
|
|
394
|
+
const cloudEvent: CloudEvent = {
|
|
395
|
+
specversion: "1.0" as const,
|
|
396
|
+
type: "test.event",
|
|
397
|
+
subject: "test",
|
|
398
|
+
source: "test://source",
|
|
399
|
+
id: "123",
|
|
400
|
+
time: new Date().toISOString(),
|
|
401
|
+
datacontenttype: "application/json" as const,
|
|
402
|
+
data: {},
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
await expect(sendCloudEvent(cloudEvent, null as any)).rejects.toThrow(
|
|
406
|
+
"Feed locator is missing"
|
|
407
|
+
);
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
it("should throw error when URL is undefined", async () => {
|
|
411
|
+
const cloudEvent: CloudEvent = {
|
|
412
|
+
specversion: "1.0" as const,
|
|
413
|
+
type: "test.event",
|
|
414
|
+
subject: "test",
|
|
415
|
+
source: "test://source",
|
|
416
|
+
id: "123",
|
|
417
|
+
time: new Date().toISOString(),
|
|
418
|
+
datacontenttype: "application/json" as const,
|
|
419
|
+
data: {},
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
await expect(
|
|
423
|
+
sendCloudEvent(cloudEvent, undefined as any)
|
|
424
|
+
).rejects.toThrow("Feed locator is missing");
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
it("should handle API errors", async () => {
|
|
428
|
+
const cloudEvent: CloudEvent = {
|
|
429
|
+
specversion: "1.0" as const,
|
|
430
|
+
type: "test.event",
|
|
431
|
+
subject: "test",
|
|
432
|
+
source: "test://source",
|
|
433
|
+
id: "123",
|
|
434
|
+
time: new Date().toISOString(),
|
|
435
|
+
datacontenttype: "application/json" as const,
|
|
436
|
+
data: {},
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
mockRequestBuilder.call.mockRejectedValue(new Error("Network error"));
|
|
440
|
+
|
|
441
|
+
await expect(
|
|
442
|
+
sendCloudEvent(cloudEvent, "https://api.example.com/events")
|
|
443
|
+
).rejects.toThrow("Network error");
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
it("should send event with all cloud event properties", async () => {
|
|
447
|
+
const cloudEvent: CloudEvent = {
|
|
448
|
+
specversion: "1.0" as const,
|
|
449
|
+
type: "user.created",
|
|
450
|
+
subject: "user/123",
|
|
451
|
+
source: "app://com.example/versions/1.0.0",
|
|
452
|
+
id: "uuid-123",
|
|
453
|
+
time: "2023-01-01T00:00:00.000Z",
|
|
454
|
+
datacontenttype: "application/json" as const,
|
|
455
|
+
data: {
|
|
456
|
+
userId: "123",
|
|
457
|
+
username: "testuser",
|
|
458
|
+
},
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
await sendCloudEvent(cloudEvent, "https://api.example.com/events");
|
|
462
|
+
|
|
463
|
+
expect(mockRequestBuilder.addBodyParams).toHaveBeenCalledWith(cloudEvent);
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
it("should handle different URL formats", async () => {
|
|
467
|
+
const cloudEvent: CloudEvent = {
|
|
468
|
+
specversion: "1.0" as const,
|
|
469
|
+
type: "test.event",
|
|
470
|
+
subject: "test",
|
|
471
|
+
source: "test://source",
|
|
472
|
+
id: "123",
|
|
473
|
+
time: new Date().toISOString(),
|
|
474
|
+
datacontenttype: "application/json" as const,
|
|
475
|
+
data: {},
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
const urls = [
|
|
479
|
+
"https://api.example.com/events",
|
|
480
|
+
"http://localhost:3000/events",
|
|
481
|
+
"https://api.example.com/v1/events?apiKey=123",
|
|
482
|
+
];
|
|
483
|
+
|
|
484
|
+
for (const url of urls) {
|
|
485
|
+
mockRequestBuilder.setUrl.mockClear();
|
|
486
|
+
await sendCloudEvent(cloudEvent, url);
|
|
487
|
+
expect(mockRequestBuilder.setUrl).toHaveBeenCalledWith(url);
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
describe("integration", () => {
|
|
493
|
+
it("should create and send cloud event together", async () => {
|
|
494
|
+
const mockResponse = { success: true, eventId: "evt-123" };
|
|
495
|
+
|
|
496
|
+
const mockRequestBuilder = {
|
|
497
|
+
setUrl: jest.fn().mockReturnThis(),
|
|
498
|
+
setMethod: jest.fn().mockReturnThis(),
|
|
499
|
+
addBodyParams: jest.fn().mockReturnThis(),
|
|
500
|
+
call: jest.fn().mockResolvedValue(mockResponse),
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
(
|
|
504
|
+
RequestBuilder as jest.MockedClass<typeof RequestBuilder>
|
|
505
|
+
).mockImplementation(() => mockRequestBuilder as any);
|
|
506
|
+
|
|
507
|
+
const event = await createCloudEvent({
|
|
508
|
+
type: "user.action",
|
|
509
|
+
subject: "button.click",
|
|
510
|
+
data: { buttonId: "submit" },
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
const response = await sendCloudEvent(
|
|
514
|
+
event,
|
|
515
|
+
"https://api.example.com/events"
|
|
516
|
+
);
|
|
517
|
+
|
|
518
|
+
expect(mockRequestBuilder.addBodyParams).toHaveBeenCalledWith(
|
|
519
|
+
expect.objectContaining({
|
|
520
|
+
type: "user.action",
|
|
521
|
+
subject: "button.click",
|
|
522
|
+
data: { buttonId: "submit" },
|
|
523
|
+
})
|
|
524
|
+
);
|
|
525
|
+
|
|
526
|
+
expect(response).toEqual(mockResponse);
|
|
527
|
+
});
|
|
528
|
+
});
|
|
529
|
+
});
|