@trackunit/react-core-contexts-test 0.1.244 → 0.1.246
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/HookRenderer.cjs.js +9 -9
- package/HookRenderer.esm.js +9 -9
- package/index.cjs.js +1167 -38
- package/index.esm.js +1149 -14
- package/package.json +6 -5
- package/src/ApolloMockedProviderWithError.d.ts +1 -2
- package/src/TrackunitProvidersMockBuilder.d.ts +3 -3
- package/src/debugger.d.ts +1 -1
- package/src/utils/queryFor.d.ts +1 -1
- package/src/utils/routingUtils.d.ts +2 -2
- package/index.cjs2.js +0 -1208
- package/index.esm2.js +0 -1182
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.246",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@apollo/client": "3.10.4",
|
|
11
|
-
"@testing-library/react": "
|
|
12
|
-
"react": "
|
|
11
|
+
"@testing-library/react": "15.0.6",
|
|
12
|
+
"react": "18.3.1",
|
|
13
13
|
"@trackunit/react-core-contexts-api": "*",
|
|
14
14
|
"@trackunit/react-core-hooks": "*",
|
|
15
15
|
"lodash": "4.17.21",
|
|
@@ -18,5 +18,6 @@
|
|
|
18
18
|
"@trackunit/shared-utils": "*"
|
|
19
19
|
},
|
|
20
20
|
"module": "./index.esm.js",
|
|
21
|
-
"main": "./index.cjs.js"
|
|
22
|
-
|
|
21
|
+
"main": "./index.cjs.js",
|
|
22
|
+
"types": "./index.esm.d.ts"
|
|
23
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { MockLink } from "@apollo/client/testing";
|
|
3
2
|
/**
|
|
4
3
|
* This is a wrapper around the MockedProvider that logs errors to the console.
|
|
@@ -7,4 +6,4 @@ export declare function ApolloMockedProviderWithError(props: {
|
|
|
7
6
|
mocks: ConstructorParameters<typeof MockLink>[0];
|
|
8
7
|
forceDebugging?: boolean;
|
|
9
8
|
[k: string]: unknown;
|
|
10
|
-
}): JSX.Element;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -358,8 +358,8 @@ export declare class TrackunitProvidersMockBuilder<T extends AnyRoute> {
|
|
|
358
358
|
* @param testChildren - the child element being tested.
|
|
359
359
|
* @param addTestRootContainer - if you want to add a root container to the test.
|
|
360
360
|
*/
|
|
361
|
-
protected getMockedCompositionRoot(testChildren: React.ReactNode, forceDebugging?: boolean): JSX.Element;
|
|
362
|
-
protected getMockedCompositionRootWithRouter(testChildren: React.ReactNode, addTestRootContainer?: boolean, forceDebugging?: boolean): JSX.Element;
|
|
361
|
+
protected getMockedCompositionRoot(testChildren: React.ReactNode, forceDebugging?: boolean): import("react/jsx-runtime").JSX.Element;
|
|
362
|
+
protected getMockedCompositionRootWithRouter(testChildren: React.ReactNode, addTestRootContainer?: boolean, forceDebugging?: boolean): import("react/jsx-runtime").JSX.Element;
|
|
363
363
|
/**
|
|
364
364
|
* This will return the mocked composition root.
|
|
365
365
|
*/
|
|
@@ -374,7 +374,7 @@ export declare class TrackunitProvidersMockBuilder<T extends AnyRoute> {
|
|
|
374
374
|
/**
|
|
375
375
|
* This will return the children in the correct mocked hierarchy of context providers.
|
|
376
376
|
*/
|
|
377
|
-
storybook(child: React.ReactNode): JSX.Element;
|
|
377
|
+
storybook(child: React.ReactNode): import("react/jsx-runtime").JSX.Element;
|
|
378
378
|
}
|
|
379
379
|
/**
|
|
380
380
|
* This is the default mock builder for the TrackunitProviders.
|
package/src/debugger.d.ts
CHANGED
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, error?: ApolloError | Error) => MockedResponse<TData
|
|
33
|
+
export declare const queryFor: <TData, TVariables extends OperationVariables = OperationVariables>(document: TypedDocumentNode<TData, TVariables>, variables: TVariables, data?: TData | null, error?: ApolloError | Error) => MockedResponse<TData> & {
|
|
34
34
|
data: NonNullable<TData>;
|
|
35
35
|
};
|
|
36
36
|
type QueryReturn<TData, TVariables extends OperationVariables = OperationVariables> = ReturnType<typeof useQuery<TData, TVariables>>;
|
|
@@ -12,7 +12,7 @@ export type MemoryRouterProps<T extends AnyRoute> = {
|
|
|
12
12
|
/**
|
|
13
13
|
* This component is used to wrap the children of the RouterContainer to add a test root container
|
|
14
14
|
*/
|
|
15
|
-
export declare const RootRouteDebugger: () => JSX.Element;
|
|
15
|
+
export declare const RootRouteDebugger: () => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
/**
|
|
17
17
|
* This component is used to wrap the children of the RouterContainer to add a test root container
|
|
18
18
|
*/
|
|
@@ -27,7 +27,7 @@ export interface TestRenderChildrenProps {
|
|
|
27
27
|
* @param children children to be wrapped
|
|
28
28
|
* @returns React.ReactElement
|
|
29
29
|
*/
|
|
30
|
-
export declare const TestRenderChildren: ({ addTestRootContainer, children }: TestRenderChildrenProps) => JSX.Element;
|
|
30
|
+
export declare const TestRenderChildren: ({ addTestRootContainer, children }: TestRenderChildrenProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
export interface RouterContainerProps<T extends AnyRoute = AnyRoute> {
|
|
32
32
|
addTestRootContainer: boolean;
|
|
33
33
|
rootRoute?: T | null;
|