@trackunit/react-core-contexts-test 1.7.80 → 1.7.83
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 -7
- package/HookRenderer.esm.js +6 -4
- package/index.cjs.js +38 -1375
- package/index.cjs2.js +14585 -0
- package/index.esm.js +17 -1358
- package/index.esm2.js +14544 -0
- package/package.json +5 -7
- package/src/TrackunitProvidersMockBuilder.d.ts +1 -1
- package/src/mocks/mockAnalyticsContext.d.ts +1 -1
- package/src/mocks/mockAssetSortingContext.d.ts +1 -1
- package/src/mocks/mockConfirmationDialogContext.d.ts +1 -1
- package/src/mocks/mockCurrentUserContext.d.ts +1 -1
- package/src/mocks/mockCurrentUserPreferenceContext.d.ts +1 -1
- package/src/mocks/mockEnvironmentContext.d.ts +1 -1
- package/src/mocks/mockErrorHandlerContext.d.ts +1 -1
- package/src/mocks/mockFilterBarContext.d.ts +1 -1
- package/src/mocks/mockModalDialogContext.d.ts +1 -1
- package/src/mocks/mockNavigationContext.d.ts +1 -1
- package/src/mocks/mockOemBrandingContext.d.ts +1 -1
- package/src/mocks/mockTimeRangeContext.d.ts +1 -1
- package/src/mocks/mockToastContext.d.ts +1 -1
- package/src/mocks/mockUserSubscriptionContext.d.ts +1 -1
- package/src/mocks/mockWidgetConfigContext.d.ts +1 -1
package/HookRenderer.cjs.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
require('@trackunit/react-core-contexts-api');
|
|
3
|
+
var index = require('./index.cjs2.js');
|
|
4
|
+
require('@trackunit/iris-app-runtime-core-api');
|
|
6
5
|
require('react/jsx-runtime');
|
|
6
|
+
require('react');
|
|
7
|
+
require('react-dom/test-utils');
|
|
8
|
+
require('react-dom');
|
|
9
|
+
require('react-dom/client');
|
|
7
10
|
require('@trackunit/react-core-hooks');
|
|
8
11
|
require('es-toolkit');
|
|
9
12
|
require('@apollo/client');
|
|
@@ -11,7 +14,6 @@ require('@apollo/client/dev');
|
|
|
11
14
|
require('@apollo/client/link/error');
|
|
12
15
|
require('@apollo/client/testing');
|
|
13
16
|
require('@trackunit/shared-utils');
|
|
14
|
-
require('react');
|
|
15
17
|
require('@apollo/client/react');
|
|
16
18
|
require('@tanstack/react-router');
|
|
17
19
|
require('graphql');
|
|
@@ -30,12 +32,12 @@ const reactHooksRenderHook = async (callback, getMockedCompositionRoot) => {
|
|
|
30
32
|
};
|
|
31
33
|
let renderedHook;
|
|
32
34
|
// This is added here to make storybook work and to ensure the right act is loaded for hooks.
|
|
33
|
-
|
|
34
|
-
renderedHook =
|
|
35
|
+
index.act(() => {
|
|
36
|
+
renderedHook = index.renderHook(callback, { wrapper });
|
|
35
37
|
});
|
|
36
38
|
const isUsingFakeTimers = setTimeout.toString().includes("clock[method]");
|
|
37
39
|
if (!isUsingFakeTimers) {
|
|
38
|
-
await
|
|
40
|
+
await index.act(async () => {
|
|
39
41
|
await index.flushPromises();
|
|
40
42
|
// rerender to make sure that all hooks can survive the rerender - this is like strict mode from react.
|
|
41
43
|
renderedHook.rerender();
|
package/HookRenderer.esm.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { act, renderHook } from '
|
|
2
|
-
import
|
|
3
|
-
import '@trackunit/react-core-contexts-api';
|
|
1
|
+
import { a as act, r as renderHook, f as flushPromises, b as flushPromisesInAct } from './index.esm2.js';
|
|
2
|
+
import '@trackunit/iris-app-runtime-core-api';
|
|
4
3
|
import 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'react-dom/test-utils';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
import 'react-dom/client';
|
|
5
8
|
import '@trackunit/react-core-hooks';
|
|
6
9
|
import 'es-toolkit';
|
|
7
10
|
import '@apollo/client';
|
|
@@ -9,7 +12,6 @@ import '@apollo/client/dev';
|
|
|
9
12
|
import '@apollo/client/link/error';
|
|
10
13
|
import '@apollo/client/testing';
|
|
11
14
|
import '@trackunit/shared-utils';
|
|
12
|
-
import 'react';
|
|
13
15
|
import '@apollo/client/react';
|
|
14
16
|
import '@tanstack/react-router';
|
|
15
17
|
import 'graphql';
|