@itwin/reports-config-widget-react 0.4.0 → 0.5.0
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/CHANGELOG.json +15 -0
- package/CHANGELOG.md +11 -2
- package/coverage/clover.xml +111 -102
- package/coverage/coverage-final.json +12 -12
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +20 -20
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +2 -2
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +15 -15
- package/coverage/lcov-report/src/test/test-utils.tsx.html +194 -11
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +1 -1
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +13 -7
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +4 -4
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +3 -3
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +15 -15
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +34 -34
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +12 -9
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +4 -4
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +2 -2
- package/coverage/lcov-report/src/widget/components/index.html +18 -18
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +8 -8
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +4 -4
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +4 -4
- package/coverage/lcov-report/src/widget/context/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +1 -1
- package/coverage/lcov-report/src/widget/index.html +1 -1
- package/coverage/lcov.info +207 -194
- package/lib/cjs/reports-config-widget-react.js +5 -1
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +15 -64
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +5 -1
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +13 -62
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +19 -67
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +51 -47
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +30 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +64 -2
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +5 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +5 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +5 -1
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/Constants.d.ts +1 -0
- package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
- package/lib/cjs/widget/components/Constants.js +2 -1
- package/lib/cjs/widget/components/Constants.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +5 -1
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +5 -1
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +5 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +5 -1
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +5 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +5 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +5 -1
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.js +5 -1
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +7 -2
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +5 -1
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js +5 -1
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +6 -2
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js +5 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js +5 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +1 -54
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +2 -55
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +2 -54
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +28 -47
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +30 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +58 -0
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/components/Constants.d.ts +1 -0
- package/lib/esm/widget/components/Constants.d.ts.map +1 -1
- package/lib/esm/widget/components/Constants.js +1 -0
- package/lib/esm/widget/components/Constants.js.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +3 -2
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +1 -1
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/package.json +30 -29
- package/src/test/AddMappingModal.test.tsx +7 -57
- package/src/test/ReportMappingHorizontalTile.test.tsx +6 -58
- package/src/test/ReportMappings.test.tsx +7 -58
- package/src/test/Reports.test.tsx +32 -110
- package/src/test/test-utils.tsx +62 -1
- package/src/widget/components/Constants.ts +2 -0
- package/src/widget/components/ReportsConfigContext.tsx +3 -2
- package/src/widget/components/SelectIModel.tsx +1 -1
- package/.rush/temp/operation/rebuild/all.log +0 -9
- package/.rush/temp/operation/rebuild/state.json +0 -3
- package/.rush/temp/package-deps_rebuild.json +0 -68
- package/.rush/temp/shrinkwrap-deps.json +0 -898
- package/reports-config-widget-react.build.error.log +0 -14
- package/reports-config-widget-react.build.log +0 -63
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ReportsConfigContextProps } from "../widget/components/ReportsConfigContext";
|
|
3
|
+
import { IModelState } from "@itwin/imodels-client-management";
|
|
3
4
|
export declare const mockAccessToken: () => Promise<string>;
|
|
5
|
+
export declare const mockIModelId1 = "mockIModelId1";
|
|
6
|
+
export declare const mockIModelId2 = "mockIModelId2";
|
|
7
|
+
export declare const mockReportId = "mockReportId";
|
|
4
8
|
export declare const mockITwinId: string;
|
|
9
|
+
export declare const mockIModelsResponse: {
|
|
10
|
+
iModel: {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
createdDateTime: string;
|
|
16
|
+
state: IModelState;
|
|
17
|
+
iTwinId: string;
|
|
18
|
+
extent: null;
|
|
19
|
+
getCreator: () => Promise<undefined>;
|
|
20
|
+
_links: {
|
|
21
|
+
creator: {
|
|
22
|
+
href: string;
|
|
23
|
+
};
|
|
24
|
+
namedVersions: {
|
|
25
|
+
href: string;
|
|
26
|
+
};
|
|
27
|
+
changesets: {
|
|
28
|
+
href: string;
|
|
29
|
+
};
|
|
30
|
+
upload: undefined;
|
|
31
|
+
complete: undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}[];
|
|
5
35
|
declare function render(ui: React.ReactElement, contextProps?: Partial<ReportsConfigContextProps>, { ...options }?: {}): {
|
|
6
36
|
container: HTMLElement;
|
|
7
37
|
baseElement: HTMLElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/test/test-utils.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/test/test-utils.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAE3F,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,eAAO,MAAM,eAAe,uBAAgC,CAAC;AAE7D,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,WAAW,EAAE,MAAsB,CAAC;AAEjD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;GAqD/B,CAAC;AAMF,iBAAS,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,EAAE,EAAE,GAAG,OAAO,EAAE,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe7G;AAED,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -6,8 +6,66 @@ import * as React from "react";
|
|
|
6
6
|
import { render as rtlRender } from "@testing-library/react";
|
|
7
7
|
import userEvent from "@testing-library/user-event";
|
|
8
8
|
import { ReportsConfigContext } from "../widget/components/ReportsConfigContext";
|
|
9
|
+
import { IModelState } from "@itwin/imodels-client-management";
|
|
9
10
|
export const mockAccessToken = async () => "Bearer eyJhbGci";
|
|
11
|
+
export const mockIModelId1 = "mockIModelId1";
|
|
12
|
+
export const mockIModelId2 = "mockIModelId2";
|
|
13
|
+
export const mockReportId = "mockReportId";
|
|
10
14
|
export const mockITwinId = "mockiTwinId";
|
|
15
|
+
export const mockIModelsResponse = [
|
|
16
|
+
{
|
|
17
|
+
iModel: {
|
|
18
|
+
id: mockIModelId1,
|
|
19
|
+
displayName: "rAnDoMdIsPlAynAmE1",
|
|
20
|
+
name: "rAnDomName1",
|
|
21
|
+
description: "rAnDoMDeScRiPtIoN1",
|
|
22
|
+
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
23
|
+
state: IModelState.Initialized,
|
|
24
|
+
iTwinId: mockITwinId,
|
|
25
|
+
extent: null,
|
|
26
|
+
getCreator: async () => undefined,
|
|
27
|
+
_links: {
|
|
28
|
+
creator: {
|
|
29
|
+
href: "",
|
|
30
|
+
},
|
|
31
|
+
namedVersions: {
|
|
32
|
+
href: "",
|
|
33
|
+
},
|
|
34
|
+
changesets: {
|
|
35
|
+
href: "",
|
|
36
|
+
},
|
|
37
|
+
upload: undefined,
|
|
38
|
+
complete: undefined,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
iModel: {
|
|
44
|
+
id: mockIModelId2,
|
|
45
|
+
displayName: "rAnDoMdIsPlAynAmE2",
|
|
46
|
+
name: "rAnDomName2",
|
|
47
|
+
description: "rAnDoMDeScRiPtIoN2",
|
|
48
|
+
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
49
|
+
state: IModelState.Initialized,
|
|
50
|
+
iTwinId: mockITwinId,
|
|
51
|
+
extent: null,
|
|
52
|
+
getCreator: async () => undefined,
|
|
53
|
+
_links: {
|
|
54
|
+
creator: {
|
|
55
|
+
href: "",
|
|
56
|
+
},
|
|
57
|
+
namedVersions: {
|
|
58
|
+
href: "",
|
|
59
|
+
},
|
|
60
|
+
changesets: {
|
|
61
|
+
href: "",
|
|
62
|
+
},
|
|
63
|
+
upload: undefined,
|
|
64
|
+
complete: undefined,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
];
|
|
11
69
|
function render(ui, contextProps, { ...options } = {}) {
|
|
12
70
|
const Wrapper = ({ children }) => (React.createElement(ReportsConfigContext, { getAccessToken: mockAccessToken, iTwinId: contextProps?.iTwinId ?? mockITwinId, ...contextProps }, children));
|
|
13
71
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../../src/test/test-utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../../src/test/test-utils.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE,CAAC,iBAAiB,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAW,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC;QACE,MAAM,EAAE;YACN,EAAE,EAAE,aAAa;YACjB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,oBAAoB;YACjC,eAAe,EAAE,0BAA0B;YAC3C,KAAK,EAAE,WAAW,CAAC,WAAW;YAC9B,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;YACjC,MAAM,EAAE;gBACN,OAAO,EAAE;oBACP,IAAI,EAAE,EAAE;iBACT;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,EAAE;iBACT;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE;iBACT;gBACD,MAAM,EAAE,SAAS;gBACjB,QAAQ,EAAE,SAAS;aACpB;SACF;KACF;IACD;QACE,MAAM,EAAE;YACN,EAAE,EAAE,aAAa;YACjB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,oBAAoB;YACjC,eAAe,EAAE,0BAA0B;YAC3C,KAAK,EAAE,WAAW,CAAC,WAAW;YAC9B,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;YACjC,MAAM,EAAE;gBACN,OAAO,EAAE;oBACP,IAAI,EAAE,EAAE;iBACT;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,EAAE;iBACT;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE;iBACT;gBACD,MAAM,EAAE,SAAS;gBACjB,QAAQ,EAAE,SAAS;aACpB;SACF;KACF;CACF,CAAC;AAMF,SAAS,MAAM,CAAC,EAAsB,EAAE,YAAiD,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE;IAC5G,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAgB,EAAE,EAAE,CAAC,CAC9C,oBAAC,oBAAoB,IACnB,cAAc,EAAE,eAAe,EAC/B,OAAO,EAAE,YAAY,EAAE,OAAO,IAAI,WAAW,KACzC,YAAY,IAEf,QAAQ,CACY,CACxB,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE;QACvB,GAAG,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;KACnD,CAAC;AACJ,CAAC;AAED,cAAc,wBAAwB,CAAC;AACvC,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { render as rtlRender } from \"@testing-library/react\";\nimport userEvent from \"@testing-library/user-event\";\nimport type { ReportsConfigContextProps } from \"../widget/components/ReportsConfigContext\";\nimport { ReportsConfigContext } from \"../widget/components/ReportsConfigContext\";\nimport { IModelState } from \"@itwin/imodels-client-management\";\n\nexport const mockAccessToken = async () => \"Bearer eyJhbGci\";\n\nexport const mockIModelId1 = \"mockIModelId1\";\nexport const mockIModelId2 = \"mockIModelId2\";\n\nexport const mockReportId = \"mockReportId\";\nexport const mockITwinId: string = \"mockiTwinId\";\n\nexport const mockIModelsResponse = [\n {\n iModel: {\n id: mockIModelId1,\n displayName: \"rAnDoMdIsPlAynAmE1\",\n name: \"rAnDomName1\",\n description: \"rAnDoMDeScRiPtIoN1\",\n createdDateTime: \"2021-10-04T22:13:50.397Z\",\n state: IModelState.Initialized,\n iTwinId: mockITwinId,\n extent: null,\n getCreator: async () => undefined,\n _links: {\n creator: {\n href: \"\",\n },\n namedVersions: {\n href: \"\",\n },\n changesets: {\n href: \"\",\n },\n upload: undefined,\n complete: undefined,\n },\n },\n },\n {\n iModel: {\n id: mockIModelId2,\n displayName: \"rAnDoMdIsPlAynAmE2\",\n name: \"rAnDomName2\",\n description: \"rAnDoMDeScRiPtIoN2\",\n createdDateTime: \"2021-10-04T22:13:50.397Z\",\n state: IModelState.Initialized,\n iTwinId: mockITwinId,\n extent: null,\n getCreator: async () => undefined,\n _links: {\n creator: {\n href: \"\",\n },\n namedVersions: {\n href: \"\",\n },\n changesets: {\n href: \"\",\n },\n upload: undefined,\n complete: undefined,\n },\n },\n },\n];\n\ninterface WrapperProps {\n children?: React.ReactNode;\n}\n\nfunction render(ui: React.ReactElement, contextProps?: Partial<ReportsConfigContextProps>, { ...options } = {}) {\n const Wrapper = ({ children }: WrapperProps) => (\n <ReportsConfigContext\n getAccessToken={mockAccessToken}\n iTwinId={contextProps?.iTwinId ?? mockITwinId}\n {...contextProps}\n >\n {children}\n </ReportsConfigContext>\n );\n\n return {\n user: userEvent.setup(),\n ...rtlRender(ui, { wrapper: Wrapper, ...options }),\n };\n}\n\nexport * from \"@testing-library/react\";\n// override React Testing Library's render with our own\nexport { render };\n"]}
|