@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.
Files changed (140) hide show
  1. package/CHANGELOG.json +15 -0
  2. package/CHANGELOG.md +11 -2
  3. package/coverage/clover.xml +111 -102
  4. package/coverage/coverage-final.json +12 -12
  5. package/coverage/lcov-report/favicon.png +0 -0
  6. package/coverage/lcov-report/index.html +20 -20
  7. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  8. package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +2 -2
  9. package/coverage/lcov-report/src/index.html +1 -1
  10. package/coverage/lcov-report/src/test/index.html +15 -15
  11. package/coverage/lcov-report/src/test/test-utils.tsx.html +194 -11
  12. package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +1 -1
  13. package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +1 -1
  14. package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +1 -1
  15. package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +1 -1
  16. package/coverage/lcov-report/src/widget/components/Constants.ts.html +13 -7
  17. package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +4 -4
  18. package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +1 -1
  19. package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +1 -1
  20. package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +1 -1
  21. package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +1 -1
  22. package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +1 -1
  23. package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
  24. package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +1 -1
  25. package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +1 -1
  26. package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +3 -3
  27. package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +1 -1
  28. package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +1 -1
  29. package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +15 -15
  30. package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +1 -1
  31. package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +1 -1
  32. package/coverage/lcov-report/src/widget/components/Reports.tsx.html +34 -34
  33. package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +12 -9
  34. package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +1 -1
  35. package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +1 -1
  36. package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +1 -1
  37. package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +4 -4
  38. package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +2 -2
  39. package/coverage/lcov-report/src/widget/components/index.html +18 -18
  40. package/coverage/lcov-report/src/widget/components/utils.tsx.html +8 -8
  41. package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +4 -4
  42. package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +4 -4
  43. package/coverage/lcov-report/src/widget/context/index.html +1 -1
  44. package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
  45. package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +1 -1
  46. package/coverage/lcov-report/src/widget/index.html +1 -1
  47. package/coverage/lcov.info +207 -194
  48. package/lib/cjs/reports-config-widget-react.js +5 -1
  49. package/lib/cjs/reports-config-widget-react.js.map +1 -1
  50. package/lib/cjs/test/AddMappingModal.test.js +15 -64
  51. package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
  52. package/lib/cjs/test/BulkExtractor.test.js +5 -1
  53. package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
  54. package/lib/cjs/test/ReportMappingHorizontalTile.test.js +13 -62
  55. package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
  56. package/lib/cjs/test/ReportMappings.test.js +19 -67
  57. package/lib/cjs/test/ReportMappings.test.js.map +1 -1
  58. package/lib/cjs/test/Reports.test.js +51 -47
  59. package/lib/cjs/test/Reports.test.js.map +1 -1
  60. package/lib/cjs/test/test-utils.d.ts +30 -0
  61. package/lib/cjs/test/test-utils.d.ts.map +1 -1
  62. package/lib/cjs/test/test-utils.js +64 -2
  63. package/lib/cjs/test/test-utils.js.map +1 -1
  64. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  65. package/lib/cjs/widget/ReportsConfigUiProvider.js +5 -1
  66. package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
  67. package/lib/cjs/widget/components/ActionPanel.js +5 -1
  68. package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
  69. package/lib/cjs/widget/components/AddMappingsModal.js +5 -1
  70. package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
  71. package/lib/cjs/widget/components/Constants.d.ts +1 -0
  72. package/lib/cjs/widget/components/Constants.d.ts.map +1 -1
  73. package/lib/cjs/widget/components/Constants.js +2 -1
  74. package/lib/cjs/widget/components/Constants.js.map +1 -1
  75. package/lib/cjs/widget/components/DeleteModal.js +5 -1
  76. package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
  77. package/lib/cjs/widget/components/ExtractionStatus.js +5 -1
  78. package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
  79. package/lib/cjs/widget/components/LocalizedTablePaginator.js +5 -1
  80. package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -1
  81. package/lib/cjs/widget/components/ReportAction.js +5 -1
  82. package/lib/cjs/widget/components/ReportAction.js.map +1 -1
  83. package/lib/cjs/widget/components/ReportHorizontalTile.js +5 -1
  84. package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
  85. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +5 -1
  86. package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
  87. package/lib/cjs/widget/components/ReportMappings.js +5 -1
  88. package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
  89. package/lib/cjs/widget/components/Reports.js +5 -1
  90. package/lib/cjs/widget/components/Reports.js.map +1 -1
  91. package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
  92. package/lib/cjs/widget/components/ReportsConfigContext.js +7 -2
  93. package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
  94. package/lib/cjs/widget/components/ReportsContainer.js +5 -1
  95. package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
  96. package/lib/cjs/widget/components/SearchBar.js +5 -1
  97. package/lib/cjs/widget/components/SearchBar.js.map +1 -1
  98. package/lib/cjs/widget/components/SelectIModel.js +6 -2
  99. package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
  100. package/lib/cjs/widget/context/BulkExtractorContext.js +5 -1
  101. package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
  102. package/lib/cjs/widget/context/ReportsConfigApiContext.js +5 -1
  103. package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
  104. package/lib/esm/test/AddMappingModal.test.js +1 -54
  105. package/lib/esm/test/AddMappingModal.test.js.map +1 -1
  106. package/lib/esm/test/ReportMappingHorizontalTile.test.js +2 -55
  107. package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
  108. package/lib/esm/test/ReportMappings.test.js +2 -54
  109. package/lib/esm/test/ReportMappings.test.js.map +1 -1
  110. package/lib/esm/test/Reports.test.js +28 -47
  111. package/lib/esm/test/Reports.test.js.map +1 -1
  112. package/lib/esm/test/test-utils.d.ts +30 -0
  113. package/lib/esm/test/test-utils.d.ts.map +1 -1
  114. package/lib/esm/test/test-utils.js +58 -0
  115. package/lib/esm/test/test-utils.js.map +1 -1
  116. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  117. package/lib/esm/widget/components/Constants.d.ts +1 -0
  118. package/lib/esm/widget/components/Constants.d.ts.map +1 -1
  119. package/lib/esm/widget/components/Constants.js +1 -0
  120. package/lib/esm/widget/components/Constants.js.map +1 -1
  121. package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
  122. package/lib/esm/widget/components/ReportsConfigContext.js +3 -2
  123. package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
  124. package/lib/esm/widget/components/SelectIModel.js +1 -1
  125. package/lib/esm/widget/components/SelectIModel.js.map +1 -1
  126. package/package.json +30 -29
  127. package/src/test/AddMappingModal.test.tsx +7 -57
  128. package/src/test/ReportMappingHorizontalTile.test.tsx +6 -58
  129. package/src/test/ReportMappings.test.tsx +7 -58
  130. package/src/test/Reports.test.tsx +32 -110
  131. package/src/test/test-utils.tsx +62 -1
  132. package/src/widget/components/Constants.ts +2 -0
  133. package/src/widget/components/ReportsConfigContext.tsx +3 -2
  134. package/src/widget/components/SelectIModel.tsx +1 -1
  135. package/.rush/temp/operation/rebuild/all.log +0 -9
  136. package/.rush/temp/operation/rebuild/state.json +0 -3
  137. package/.rush/temp/package-deps_rebuild.json +0 -68
  138. package/.rush/temp/shrinkwrap-deps.json +0 -898
  139. package/reports-config-widget-react.build.error.log +0 -14
  140. 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;AAG3F,eAAO,MAAM,eAAe,uBAAgC,CAAC;AAK7D,eAAO,MAAM,WAAW,EAAE,MAAsB,CAAC;AAEjD,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"}
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;AAEjF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE,CAAC,iBAAiB,CAAC;AAK7D,MAAM,CAAC,MAAM,WAAW,GAAW,aAAa,CAAC;AAEjD,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\";\n\nexport const mockAccessToken = async () => \"Bearer eyJhbGci\";\n\ninterface WrapperProps {\n children?: React.ReactNode;\n}\nexport const mockITwinId: string = \"mockiTwinId\";\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"]}
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"]}