@trackunit/react-core-contexts-test 0.1.201 → 0.1.205
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/index.cjs2.js +10 -2
- package/index.esm.d.ts +1 -0
- package/index.esm2.js +10 -2
- package/package.json +1 -1
- package/src/debugger.d.ts +3 -3
- package/src/utils/queryFor.d.ts +2 -2
package/index.cjs2.js
CHANGED
|
@@ -54,7 +54,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
54
54
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
55
55
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
56
56
|
});
|
|
57
|
-
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
60
|
+
var e = new Error(message);
|
|
61
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
62
|
+
};
|
|
58
63
|
|
|
59
64
|
const defaultOptions = {
|
|
60
65
|
mutate: {
|
|
@@ -211,7 +216,7 @@ const mockNavigationContext = {
|
|
|
211
216
|
gotoCustomer: (customerId) => {
|
|
212
217
|
return Promise.resolve(true);
|
|
213
218
|
},
|
|
214
|
-
gotoMyExports: () => {
|
|
219
|
+
gotoMyExports: (exportId) => {
|
|
215
220
|
return Promise.resolve(true);
|
|
216
221
|
},
|
|
217
222
|
gotoAdmin: () => {
|
|
@@ -352,6 +357,9 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
352
357
|
hasAccessTo: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
353
358
|
return true;
|
|
354
359
|
}),
|
|
360
|
+
showMarketplace: true,
|
|
361
|
+
showHelpCenter: true,
|
|
362
|
+
showAppLibrary: true,
|
|
355
363
|
client: null,
|
|
356
364
|
defaultUserRoute: "/",
|
|
357
365
|
isAuthenticated: true,
|
package/index.esm.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
package/index.esm2.js
CHANGED
|
@@ -47,7 +47,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
47
47
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
48
48
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
49
49
|
});
|
|
50
|
-
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
53
|
+
var e = new Error(message);
|
|
54
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
55
|
+
};
|
|
51
56
|
|
|
52
57
|
const defaultOptions = {
|
|
53
58
|
mutate: {
|
|
@@ -204,7 +209,7 @@ const mockNavigationContext = {
|
|
|
204
209
|
gotoCustomer: (customerId) => {
|
|
205
210
|
return Promise.resolve(true);
|
|
206
211
|
},
|
|
207
|
-
gotoMyExports: () => {
|
|
212
|
+
gotoMyExports: (exportId) => {
|
|
208
213
|
return Promise.resolve(true);
|
|
209
214
|
},
|
|
210
215
|
gotoAdmin: () => {
|
|
@@ -345,6 +350,9 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
345
350
|
hasAccessTo: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
346
351
|
return true;
|
|
347
352
|
}),
|
|
353
|
+
showMarketplace: true,
|
|
354
|
+
showHelpCenter: true,
|
|
355
|
+
showAppLibrary: true,
|
|
348
356
|
client: null,
|
|
349
357
|
defaultUserRoute: "/",
|
|
350
358
|
isAuthenticated: true,
|
package/package.json
CHANGED
package/src/debugger.d.ts
CHANGED
|
@@ -32,8 +32,8 @@ export declare const useDebugger: <P extends object>(propsToWatch: PropsToWatch<
|
|
|
32
32
|
*/
|
|
33
33
|
export declare const Debugger: ({ id, logPropsChanges, stop, children, }: {
|
|
34
34
|
children: React.ReactNode;
|
|
35
|
-
id?: string
|
|
36
|
-
stop?: boolean
|
|
37
|
-
logPropsChanges?: {}
|
|
35
|
+
id?: string;
|
|
36
|
+
stop?: boolean;
|
|
37
|
+
logPropsChanges?: {};
|
|
38
38
|
}) => JSX.Element;
|
|
39
39
|
export {};
|
package/src/utils/queryFor.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ type DeepPartialNullableArray<T> = DeepPartialNullable<T>[];
|
|
|
30
30
|
* expect(screen.getByText(`Brand: ${mock.data.asset?.brand}`)).toBeInTheDocument();
|
|
31
31
|
* });
|
|
32
32
|
*/
|
|
33
|
-
export declare const queryFor: <TData, TVariables extends OperationVariables = OperationVariables>(document: TypedDocumentNode<TData, TVariables>, variables: TVariables, data?: TData | null
|
|
33
|
+
export declare const queryFor: <TData, TVariables extends OperationVariables = OperationVariables>(document: TypedDocumentNode<TData, TVariables>, variables: TVariables, data?: TData | null, error?: ApolloError | Error) => MockedResponse<TData, Record<string, any>> & {
|
|
34
34
|
data: NonNullable<TData>;
|
|
35
35
|
};
|
|
36
36
|
type QueryReturn<TData, TVariables extends OperationVariables = OperationVariables> = ReturnType<typeof useQuery<TData, TVariables>>;
|
|
@@ -47,5 +47,5 @@ type QueryLazyReturn<TData, TVariables extends OperationVariables = OperationVar
|
|
|
47
47
|
* @returns {MockedResponse} that can be passed to the mocked ApolloProvider.
|
|
48
48
|
* @see [Testing React components using MockedProvider and associated APIs](https://www.apollographql.com/docs/react/development-testing/testing/)
|
|
49
49
|
*/
|
|
50
|
-
export declare const queryForHook: <TData, TVariables extends OperationVariables = OperationVariables>(hookFn: (baseOptions: QueryHookOptions<TData, TVariables>) =>
|
|
50
|
+
export declare const queryForHook: <TData, TVariables extends OperationVariables = OperationVariables>(hookFn: (baseOptions: QueryHookOptions<TData, TVariables>) => QueryReturn<TData, TVariables> | QueryLazyReturn<TData, TVariables>, document: TypedDocumentNode<TData, TVariables>, variables: TVariables, data: TData | null, error?: ApolloError | Error) => MockedResponse;
|
|
51
51
|
export {};
|