@itwin/reports-config-widget-react 0.8.2 → 0.9.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 +16 -1
- package/CHANGELOG.md +10 -2
- package/api/reports-config-widget-react.api.md +5 -7
- package/api/reports-config-widget-react.exports.csv +13 -13
- package/api/temp/reports-config-widget-react.api.md +5 -7
- package/coverage/{lcov-report/block-navigation.js → block-navigation.js} +1 -1
- package/coverage/clover.xml +1422 -442
- package/coverage/coverage-final.json +34 -32
- package/coverage/{lcov-report/index.html → index.html} +79 -79
- package/coverage/{lcov-report/sorter.js → sorter.js} +21 -7
- package/coverage/{lcov-report/src → src}/ReportsConfigWidget.ts.html +30 -30
- package/coverage/{lcov-report/src → src}/index.html +35 -20
- package/coverage/src/reports-config-widget-react.ts.html +127 -0
- package/coverage/{lcov-report/src → src}/test/index.html +34 -19
- package/coverage/src/test/setup.ts.html +100 -0
- package/coverage/{lcov-report/src → src}/test/test-utils.tsx.html +109 -109
- package/coverage/{lcov-report/src → src}/widget/ReportsConfigUiProvider.tsx.html +40 -40
- package/coverage/{lcov-report/src → src}/widget/components/ActionPanel.tsx.html +37 -37
- package/coverage/{lcov-report/src → src}/widget/components/AddMappingsModal.tsx.html +90 -90
- package/coverage/{lcov-report/src → src}/widget/components/BulkExtractor.ts.html +96 -96
- package/coverage/{lcov-report/src → src}/widget/components/Constants.ts.html +15 -15
- package/coverage/{lcov-report/src → src}/widget/components/DeleteModal.tsx.html +49 -49
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionStates/FailedExtractionState.tsx.html +40 -40
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +19 -19
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionStates/RunningExtractionState.tsx.html +17 -17
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionStates/StartingExtractionState.tsx.html +19 -19
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +28 -28
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionStates/index.html +54 -54
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionStatus.tsx.html +52 -52
- package/coverage/{lcov-report/src → src}/widget/components/ExtractionToast.tsx.html +53 -53
- package/coverage/{lcov-report/src → src}/widget/components/HorizontalTile.tsx.html +38 -38
- package/coverage/{lcov-report/src → src}/widget/components/LocalizedTablePaginator.tsx.html +29 -29
- package/coverage/{lcov-report/src → src}/widget/components/ReportAction.tsx.html +90 -90
- package/coverage/{lcov-report/src → src}/widget/components/ReportHorizontalTile.tsx.html +105 -105
- package/coverage/{lcov-report/src → src}/widget/components/ReportMappingHorizontalTile.tsx.html +87 -87
- package/coverage/{lcov-report/src → src}/widget/components/ReportMappings.tsx.html +166 -166
- package/coverage/{lcov-report/src → src}/widget/components/Reports.tsx.html +117 -117
- package/coverage/{lcov-report/src → src}/widget/components/ReportsConfigContext.tsx.html +78 -78
- package/coverage/{lcov-report/src → src}/widget/components/ReportsContainer.tsx.html +51 -51
- package/coverage/{lcov-report/src → src}/widget/components/ReportsHeader.tsx.html +19 -19
- package/coverage/{lcov-report/src → src}/widget/components/ReportsRouter.tsx.html +85 -85
- package/coverage/{lcov-report/src → src}/widget/components/SearchBar.tsx.html +60 -60
- package/coverage/{lcov-report/src → src}/widget/components/SelectIModel.tsx.html +53 -53
- package/coverage/src/widget/components/index.html +416 -0
- package/coverage/{lcov-report/src → src}/widget/components/utils.tsx.html +76 -76
- package/coverage/{lcov-report/src → src}/widget/context/BulkExtractorContext.tsx.html +20 -20
- package/coverage/{lcov-report/src → src}/widget/context/ReportsConfigApiContext.tsx.html +30 -30
- package/coverage/{lcov-report/src → src}/widget/context/index.html +29 -29
- package/coverage/{lcov-report/src → src}/widget/hooks/index.html +18 -18
- package/coverage/{lcov-report/src → src}/widget/hooks/useValidator.ts.html +45 -45
- package/coverage/{lcov-report/src → src}/widget/index.html +20 -20
- package/eslint.config.cjs +40 -0
- package/lib/cjs/ReportsConfigWidget.js +2 -0
- package/lib/cjs/ReportsConfigWidget.js.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.d.ts +1 -1
- package/lib/cjs/test/AddMappingModal.test.d.ts.map +1 -1
- package/lib/cjs/test/AddMappingModal.test.js +7 -7
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -1
- package/lib/cjs/test/BulkExtractor.test.js +10 -9
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -1
- package/lib/cjs/test/DeleteModal.test.d.ts +1 -1
- package/lib/cjs/test/DeleteModal.test.d.ts.map +1 -1
- package/lib/cjs/test/DeleteModal.test.js +4 -4
- package/lib/cjs/test/DeleteModal.test.js.map +1 -1
- package/lib/cjs/test/ReportAction.test.d.ts +1 -1
- package/lib/cjs/test/ReportAction.test.d.ts.map +1 -1
- package/lib/cjs/test/ReportAction.test.js +14 -14
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +5 -5
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/cjs/test/ReportMappings.test.d.ts +1 -1
- package/lib/cjs/test/ReportMappings.test.d.ts.map +1 -1
- package/lib/cjs/test/ReportMappings.test.js +19 -19
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.d.ts +1 -1
- package/lib/cjs/test/Reports.test.d.ts.map +1 -1
- package/lib/cjs/test/Reports.test.js +8 -8
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.d.ts +1 -1
- package/lib/cjs/test/WidgetHeader.test.d.ts.map +1 -1
- package/lib/cjs/test/WidgetHeader.test.js +2 -2
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -1
- package/lib/cjs/test/setup.d.ts +2 -0
- package/lib/cjs/test/setup.d.ts.map +1 -0
- package/lib/cjs/test/setup.js +8 -0
- package/lib/cjs/test/setup.js.map +1 -0
- package/lib/cjs/test/test-utils.d.ts +3 -3
- package/lib/cjs/test/test-utils.d.ts.map +1 -1
- package/lib/cjs/test/test-utils.js +11 -6
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +2 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +1 -2
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +1 -2
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +12 -6
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts +0 -1
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts +0 -1
- package/lib/cjs/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts +0 -1
- package/lib/cjs/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts +0 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts +0 -1
- package/lib/cjs/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts +0 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts +0 -1
- package/lib/cjs/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts +0 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts +0 -1
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts +0 -1
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts +0 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts +0 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts +2 -3
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts +1 -2
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +1 -2
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts +0 -1
- package/lib/cjs/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts +0 -1
- package/lib/cjs/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsRouter.js.map +1 -1
- package/lib/cjs/widget/components/SearchBar.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts +0 -1
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.d.ts.map +1 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -1
- package/lib/esm/ReportsConfigWidget.js +2 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -1
- package/lib/esm/test/AddMappingModal.test.d.ts +1 -1
- package/lib/esm/test/AddMappingModal.test.d.ts.map +1 -1
- package/lib/esm/test/AddMappingModal.test.js +7 -7
- package/lib/esm/test/AddMappingModal.test.js.map +1 -1
- package/lib/esm/test/BulkExtractor.test.js +10 -9
- package/lib/esm/test/BulkExtractor.test.js.map +1 -1
- package/lib/esm/test/DeleteModal.test.d.ts +1 -1
- package/lib/esm/test/DeleteModal.test.d.ts.map +1 -1
- package/lib/esm/test/DeleteModal.test.js +4 -4
- package/lib/esm/test/DeleteModal.test.js.map +1 -1
- package/lib/esm/test/ReportAction.test.d.ts +1 -1
- package/lib/esm/test/ReportAction.test.d.ts.map +1 -1
- package/lib/esm/test/ReportAction.test.js +14 -14
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +5 -5
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -1
- package/lib/esm/test/ReportMappings.test.d.ts +1 -1
- package/lib/esm/test/ReportMappings.test.d.ts.map +1 -1
- package/lib/esm/test/ReportMappings.test.js +19 -19
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.d.ts +1 -1
- package/lib/esm/test/Reports.test.d.ts.map +1 -1
- package/lib/esm/test/Reports.test.js +8 -8
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/test/WidgetHeader.test.d.ts +1 -1
- package/lib/esm/test/WidgetHeader.test.d.ts.map +1 -1
- package/lib/esm/test/WidgetHeader.test.js +2 -2
- package/lib/esm/test/WidgetHeader.test.js.map +1 -1
- package/lib/esm/test/setup.d.ts +2 -0
- package/lib/esm/test/setup.d.ts.map +1 -0
- package/lib/esm/test/setup.js +6 -0
- package/lib/esm/test/setup.js.map +1 -0
- package/lib/esm/test/test-utils.d.ts +3 -3
- package/lib/esm/test/test-utils.d.ts.map +1 -1
- package/lib/esm/test/test-utils.js +2 -2
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +2 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +1 -2
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.d.ts +1 -2
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +12 -6
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.d.ts +0 -1
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts +0 -1
- package/lib/esm/widget/components/ExtractionStates/FailedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts +0 -1
- package/lib/esm/widget/components/ExtractionStates/QueuedExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts +0 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts +0 -1
- package/lib/esm/widget/components/ExtractionStates/StartingExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts +0 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts +0 -1
- package/lib/esm/widget/components/ExtractionStatus.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.js.map +1 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts +0 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts +0 -1
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts +0 -1
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts +0 -1
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts +0 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts +2 -3
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts +1 -2
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +1 -2
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts +0 -1
- package/lib/esm/widget/components/ReportsHeader.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.d.ts +0 -1
- package/lib/esm/widget/components/ReportsRouter.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsRouter.js.map +1 -1
- package/lib/esm/widget/components/SearchBar.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.d.ts +0 -1
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.d.ts.map +1 -1
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.d.ts.map +1 -1
- package/lib/esm/widget/context/BulkExtractorContext.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -1
- package/lib/esm/widget/hooks/useValidator.js.map +1 -1
- package/package.json +37 -61
- package/src/test/AddMappingModal.test.tsx +7 -7
- package/src/test/BulkExtractor.test.ts +10 -9
- package/src/test/DeleteModal.test.tsx +4 -4
- package/src/test/ReportAction.test.tsx +14 -14
- package/src/test/ReportMappingHorizontalTile.test.tsx +5 -5
- package/src/test/ReportMappings.test.tsx +19 -19
- package/src/test/Reports.test.tsx +8 -8
- package/src/test/WidgetHeader.test.tsx +2 -2
- package/{__mocks__/fileMock.js → src/test/setup.ts} +1 -1
- package/src/test/test-utils.tsx +2 -2
- package/tsconfig.json +2 -1
- package/vitest.config.ts +29 -0
- package/coverage/lcov-report/src/widget/components/index.html +0 -416
- package/coverage/lcov.info +0 -1629
- package/jest.config.js +0 -24
- /package/coverage/{lcov-report/base.css → base.css} +0 -0
- /package/coverage/{lcov-report/favicon.png → favicon.png} +0 -0
- /package/coverage/{lcov-report/prettify.css → prettify.css} +0 -0
- /package/coverage/{lcov-report/prettify.js → prettify.js} +0 -0
- /package/coverage/{lcov-report/sort-arrow-sprite.png → sort-arrow-sprite.png} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/reports-config-widget-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Bentley",
|
|
@@ -34,29 +34,12 @@
|
|
|
34
34
|
"cover": "npm test -- --coverage",
|
|
35
35
|
"dual-build": "npm run -s build:cjs && npm run -s build:esm",
|
|
36
36
|
"extract-api": "betools extract-api --entry=reports-config-widget-react --apiReportFolder=./api --apiReportTempFolder=./api/temp --apiSummaryFolder=./api",
|
|
37
|
-
"lint": "eslint
|
|
37
|
+
"lint": "eslint \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
38
38
|
"lint:fix": "npm run lint -- --fix",
|
|
39
39
|
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
|
|
40
40
|
"rebuild": "npm run clean && npm run build",
|
|
41
|
-
"test": "
|
|
42
|
-
"test:watch": "
|
|
43
|
-
},
|
|
44
|
-
"eslintConfig": {
|
|
45
|
-
"plugins": [
|
|
46
|
-
"@itwin"
|
|
47
|
-
],
|
|
48
|
-
"extends": [
|
|
49
|
-
"plugin:@itwin/ui",
|
|
50
|
-
"prettier"
|
|
51
|
-
],
|
|
52
|
-
"rules": {
|
|
53
|
-
"no-duplicate-imports": "off",
|
|
54
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
55
|
-
"deprecation/deprecation": "error",
|
|
56
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
|
57
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
|
58
|
-
"jsx-a11y/anchor-is-valid": "off"
|
|
59
|
-
}
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"test:watch": "vitest"
|
|
60
43
|
},
|
|
61
44
|
"dependencies": {
|
|
62
45
|
"@itwin/imodels-access-common": "^4.1.4",
|
|
@@ -71,65 +54,58 @@
|
|
|
71
54
|
},
|
|
72
55
|
"devDependencies": {
|
|
73
56
|
"@faker-js/faker": "6.2.0",
|
|
74
|
-
"@itwin/appui-abstract": "^
|
|
75
|
-
"@itwin/appui-
|
|
76
|
-
"@itwin/
|
|
77
|
-
"@itwin/
|
|
78
|
-
"@itwin/
|
|
79
|
-
"@itwin/core-
|
|
80
|
-
"@itwin/core-
|
|
81
|
-
"@itwin/core-
|
|
82
|
-
"@itwin/core-
|
|
83
|
-
"@itwin/core-
|
|
84
|
-
"@itwin/core-
|
|
85
|
-
"@itwin/core-
|
|
86
|
-
"@itwin/
|
|
87
|
-
"@itwin/
|
|
88
|
-
"@itwin/
|
|
89
|
-
"@itwin/
|
|
90
|
-
"@itwin/
|
|
91
|
-
"@itwin/
|
|
92
|
-
"@itwin/presentation-frontend": "^4.0.0",
|
|
93
|
-
"@itwin/webgl-compatibility": "^4.0.0",
|
|
57
|
+
"@itwin/appui-abstract": "^5.6.0",
|
|
58
|
+
"@itwin/appui-react": "^5.6.0",
|
|
59
|
+
"@itwin/build-tools": "^5.6.0",
|
|
60
|
+
"@itwin/components-react": "^5.6.0",
|
|
61
|
+
"@itwin/core-bentley": "^5.6.0",
|
|
62
|
+
"@itwin/core-common": "^5.6.0",
|
|
63
|
+
"@itwin/core-frontend": "^5.6.0",
|
|
64
|
+
"@itwin/core-geometry": "^5.6.0",
|
|
65
|
+
"@itwin/core-markup": "^5.6.0",
|
|
66
|
+
"@itwin/core-orbitgt": "^5.6.0",
|
|
67
|
+
"@itwin/core-quantity": "^5.6.0",
|
|
68
|
+
"@itwin/core-react": "^5.6.0",
|
|
69
|
+
"@itwin/ecschema-metadata": "^5.6.0",
|
|
70
|
+
"@itwin/eslint-plugin": "^6.0.0",
|
|
71
|
+
"@itwin/imodel-components-react": "^5.6.0",
|
|
72
|
+
"@itwin/presentation-common": "^5.6.0",
|
|
73
|
+
"@itwin/presentation-frontend": "^5.6.0",
|
|
74
|
+
"@itwin/webgl-compatibility": "^5.6.0",
|
|
94
75
|
"@testing-library/dom": "^8.12.0",
|
|
95
|
-
"@testing-library/jest-dom": "^
|
|
76
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
96
77
|
"@testing-library/react": "^12.1.4",
|
|
97
78
|
"@testing-library/user-event": "^14.1.1",
|
|
98
79
|
"@types/chai": "4.2.11",
|
|
99
80
|
"@types/i18next": "^8.4.2",
|
|
100
|
-
"@types/jest": "^27.4.1",
|
|
101
81
|
"@types/node": "^14.14.20",
|
|
102
82
|
"@types/react": "^17.0.19",
|
|
103
83
|
"@types/react-dom": "^17.0.9",
|
|
104
84
|
"@types/react-table": "^7.7.0",
|
|
105
|
-
"@types/testing-library__jest-dom": "^5.14.3",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
107
|
-
"@typescript-eslint/parser": "^5.10.1",
|
|
108
85
|
"chai": "^4.2.0",
|
|
109
86
|
"cpx2": "^3.0.0",
|
|
110
|
-
"eslint": "^
|
|
111
|
-
"eslint-config-prettier": "^
|
|
112
|
-
"eslint-plugin-
|
|
113
|
-
"eslint-plugin-react": "^7.
|
|
114
|
-
"eslint-plugin-
|
|
115
|
-
"
|
|
116
|
-
"jest-cli": "^27.5.1",
|
|
117
|
-
"jest-transform-stub": "^2.0.0",
|
|
87
|
+
"eslint": "^9.39.2",
|
|
88
|
+
"eslint-config-prettier": "^10.1.8",
|
|
89
|
+
"eslint-plugin-import": "^2.32.0",
|
|
90
|
+
"eslint-plugin-react": "^7.37.5",
|
|
91
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
92
|
+
"jsdom": "^25.0.0",
|
|
118
93
|
"react": "^17.0.2",
|
|
119
94
|
"react-dom": "^17.0.2",
|
|
120
95
|
"react-redux": "^7.2.2",
|
|
121
96
|
"redux": "^4.1.0",
|
|
122
97
|
"rimraf": "^3.0.2",
|
|
123
|
-
"
|
|
98
|
+
"sass-embedded": "^1.86.0",
|
|
124
99
|
"typemoq": "^2.1.0",
|
|
125
|
-
"typescript": "~
|
|
126
|
-
"
|
|
100
|
+
"typescript": "~5.6.0",
|
|
101
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
102
|
+
"vitest": "^3.0.0"
|
|
127
103
|
},
|
|
128
104
|
"peerDependencies": {
|
|
129
|
-
"@itwin/appui-abstract": "^
|
|
130
|
-
"@itwin/appui-react": "^
|
|
131
|
-
"@itwin/core-bentley": "^
|
|
132
|
-
"@itwin/core-frontend": "^
|
|
105
|
+
"@itwin/appui-abstract": "^5.0.0",
|
|
106
|
+
"@itwin/appui-react": "^5.0.0",
|
|
107
|
+
"@itwin/core-bentley": "^5.0.0",
|
|
108
|
+
"@itwin/core-frontend": "^5.0.0",
|
|
133
109
|
"react": "^17.0.2 || ^18.0.0",
|
|
134
110
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
135
111
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
|
+
import { vi } from "vitest";
|
|
6
7
|
import faker from "@faker-js/faker";
|
|
7
|
-
import "@testing-library/jest-dom";
|
|
8
8
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
9
9
|
import { mockIModelId1, mockIModelId2, mockIModelsResponse, mockITwinId, mockReportId, render, screen, waitFor, within } from "./test-utils";
|
|
10
10
|
import * as moq from "typemoq";
|
|
@@ -134,15 +134,15 @@ const mockReportMappingsAndMappingsFactory = (mockMappings: MappingContainer[],
|
|
|
134
134
|
return reportMappingsAndMapping;
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
...
|
|
139
|
-
toArray:
|
|
137
|
+
vi.mock("@itwin/imodels-client-management", async () => ({
|
|
138
|
+
...(await vi.importActual("@itwin/imodels-client-management")),
|
|
139
|
+
toArray: vi.fn().mockImplementation(async () => {
|
|
140
140
|
return mockProjectIModels.iModels;
|
|
141
141
|
}),
|
|
142
142
|
}));
|
|
143
143
|
|
|
144
|
-
const mockGetMappings =
|
|
145
|
-
const mockCreateReportMapping =
|
|
144
|
+
const mockGetMappings = vi.fn();
|
|
145
|
+
const mockCreateReportMapping = vi.fn();
|
|
146
146
|
|
|
147
147
|
const mockIModelsClient = moq.Mock.ofType<IModelsClient>();
|
|
148
148
|
const mockIModelsClientOperations = moq.Mock.ofType<IModelOperations<OperationOptions>>();
|
|
@@ -181,7 +181,7 @@ describe("Add Mapping Modal", () => {
|
|
|
181
181
|
show={true}
|
|
182
182
|
reportId={mockReportId}
|
|
183
183
|
existingMappings={mockReportMappingsAndMappings}
|
|
184
|
-
onClose={
|
|
184
|
+
onClose={vi.fn()}
|
|
185
185
|
defaultIModelId={mockIModelId1}
|
|
186
186
|
/>,
|
|
187
187
|
{ iTwinId: mockITwinId, reportsClient: mockReportsClient.object, mappingsClient: mockMappingsClient.object, iModelsClient: mockIModelsClient.object },
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { vi } from "vitest";
|
|
5
6
|
import { BulkExtractor } from "../widget/components/BulkExtractor";
|
|
6
7
|
import { ExtractionStates } from "../widget/components/ExtractionStatus";
|
|
7
8
|
import { assert } from "chai";
|
|
@@ -10,25 +11,25 @@ import { ExtractionClient, ExtractionState, ReportsClient } from "@itwin/insight
|
|
|
10
11
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
11
12
|
import type { ExtractionRequestDetails } from "@itwin/insights-client";
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
vi.mock("../widget/components/Constants.ts", () => ({
|
|
14
15
|
STATUS_CHECK_INTERVAL: -1,
|
|
15
16
|
}));
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
FailedExtractionToast:
|
|
19
|
-
SuccessfulExtractionToast:
|
|
18
|
+
vi.mock("../widget/components/ExtractionToast.tsx", () => ({
|
|
19
|
+
FailedExtractionToast: vi.fn(),
|
|
20
|
+
SuccessfulExtractionToast: vi.fn(),
|
|
20
21
|
}));
|
|
21
22
|
|
|
22
23
|
const mockRunExtraction = moq.Mock.ofType<(accessToken: AccessToken, extractionRequest: ExtractionRequestDetails) => Promise<{ id: string }>>();
|
|
23
24
|
const mockGetStatus = moq.Mock.ofType<(accessToken: AccessToken, jobId: string) => Promise<{ state: ExtractionState }>>();
|
|
24
25
|
const mockGetReportMappings = moq.Mock.ofType<(accessToken: AccessToken, reportId: string) => Promise<{ imodelId: string; mappingId: string }[]>>();
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
...
|
|
28
|
-
ReportsClient:
|
|
27
|
+
vi.mock("@itwin/insights-client", async () => ({
|
|
28
|
+
...(await vi.importActual("@itwin/insights-client")),
|
|
29
|
+
ReportsClient: vi.fn().mockImplementation(() => ({
|
|
29
30
|
getReportMappings: mockGetReportMappings.object,
|
|
30
31
|
})),
|
|
31
|
-
ExtractionClient:
|
|
32
|
+
ExtractionClient: vi.fn().mockImplementation(() => ({
|
|
32
33
|
runExtraction: mockRunExtraction.object,
|
|
33
34
|
getExtractionStatus: mockGetStatus.object,
|
|
34
35
|
})),
|
|
@@ -39,7 +40,7 @@ afterEach(() => {
|
|
|
39
40
|
mockGetStatus.reset();
|
|
40
41
|
});
|
|
41
42
|
|
|
42
|
-
const mockToastCallback =
|
|
43
|
+
const mockToastCallback = vi.fn();
|
|
43
44
|
|
|
44
45
|
const mockGetAccessToken = async () => "mockAccessToken";
|
|
45
46
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
|
-
import "
|
|
6
|
+
import { vi } from "vitest";
|
|
7
7
|
import { render, screen } from "./test-utils";
|
|
8
8
|
import DeleteModal from "../widget/components/DeleteModal";
|
|
9
9
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
@@ -16,13 +16,13 @@ beforeAll(async () => {
|
|
|
16
16
|
|
|
17
17
|
describe("Delete modal", () => {
|
|
18
18
|
it("should render", () => {
|
|
19
|
-
const { container } = render(<DeleteModal entityName="test" onDelete={
|
|
19
|
+
const { container } = render(<DeleteModal entityName="test" onDelete={vi.fn()} refresh={vi.fn()} onClose={vi.fn()} />);
|
|
20
20
|
expect(container).toBeTruthy();
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
it("should call onDelete when delete button is clicked", async () => {
|
|
24
|
-
const onDelete =
|
|
25
|
-
const { user } = render(<DeleteModal entityName="test" onDelete={onDelete} refresh={
|
|
24
|
+
const onDelete = vi.fn();
|
|
25
|
+
const { user } = render(<DeleteModal entityName="test" onDelete={onDelete} refresh={vi.fn()} onClose={vi.fn()} />);
|
|
26
26
|
const deleteButton = screen.getByRole("button", {
|
|
27
27
|
name: /delete/i,
|
|
28
28
|
});
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
|
+
import { vi } from "vitest";
|
|
6
7
|
import faker from "@faker-js/faker";
|
|
7
|
-
import "@testing-library/jest-dom";
|
|
8
8
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
9
9
|
import { render, screen, waitForElementToBeRemoved } from "./test-utils";
|
|
10
10
|
import { ReportAction } from "../widget/components/ReportAction";
|
|
@@ -20,9 +20,9 @@ beforeAll(async () => {
|
|
|
20
20
|
|
|
21
21
|
describe("Reports Action", () => {
|
|
22
22
|
it("required fields should be filled out", async () => {
|
|
23
|
-
const mockReturnFn =
|
|
23
|
+
const mockReturnFn = vi.fn();
|
|
24
24
|
|
|
25
|
-
render(<ReportAction onClickCancel={
|
|
25
|
+
render(<ReportAction onClickCancel={vi.fn()} onSaveSuccess={mockReturnFn} />);
|
|
26
26
|
|
|
27
27
|
const addButton = screen.getByRole("button", {
|
|
28
28
|
name: /add/i,
|
|
@@ -36,7 +36,7 @@ describe("Reports Action", () => {
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it("should be able to add report", async () => {
|
|
39
|
-
const mockReturnFn =
|
|
39
|
+
const mockReturnFn = vi.fn();
|
|
40
40
|
const mockReport: Report = {
|
|
41
41
|
id: faker.datatype.uuid(),
|
|
42
42
|
displayName: "mOcKRePoRt1",
|
|
@@ -54,7 +54,7 @@ describe("Reports Action", () => {
|
|
|
54
54
|
|
|
55
55
|
const reportsClient = new ReportsClient();
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
vi.spyOn(reportsClient, "createReport").mockImplementation(
|
|
58
58
|
async () =>
|
|
59
59
|
new Promise((resolve) =>
|
|
60
60
|
setTimeout(() => {
|
|
@@ -63,7 +63,7 @@ describe("Reports Action", () => {
|
|
|
63
63
|
),
|
|
64
64
|
);
|
|
65
65
|
|
|
66
|
-
const { user } = render(<ReportAction onClickCancel={
|
|
66
|
+
const { user } = render(<ReportAction onClickCancel={vi.fn()} onSaveSuccess={mockReturnFn} />, { reportsClient });
|
|
67
67
|
|
|
68
68
|
const addButton = screen.getByRole("button", {
|
|
69
69
|
name: /add/i,
|
|
@@ -95,9 +95,9 @@ describe("Reports Action", () => {
|
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
it("No duplicate underscores in the beginning of name", async () => {
|
|
98
|
-
const mockReturnFn =
|
|
98
|
+
const mockReturnFn = vi.fn();
|
|
99
99
|
|
|
100
|
-
const { user } = render(<ReportAction onClickCancel={
|
|
100
|
+
const { user } = render(<ReportAction onClickCancel={vi.fn()} onSaveSuccess={mockReturnFn} />);
|
|
101
101
|
|
|
102
102
|
const addButton = screen.getByRole("button", {
|
|
103
103
|
name: /add/i,
|
|
@@ -113,9 +113,9 @@ describe("Reports Action", () => {
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
it("Only begin with letters or underscores of name", async () => {
|
|
116
|
-
const mockReturnFn =
|
|
116
|
+
const mockReturnFn = vi.fn();
|
|
117
117
|
|
|
118
|
-
const { user } = render(<ReportAction onClickCancel={
|
|
118
|
+
const { user } = render(<ReportAction onClickCancel={vi.fn()} onSaveSuccess={mockReturnFn} />);
|
|
119
119
|
|
|
120
120
|
const addButton = screen.getByRole("button", {
|
|
121
121
|
name: /add/i,
|
|
@@ -131,9 +131,9 @@ describe("Reports Action", () => {
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
it("Only letters underscores and digits of name", async () => {
|
|
134
|
-
const mockReturnFn =
|
|
134
|
+
const mockReturnFn = vi.fn();
|
|
135
135
|
|
|
136
|
-
const { user } = render(<ReportAction onClickCancel={
|
|
136
|
+
const { user } = render(<ReportAction onClickCancel={vi.fn()} onSaveSuccess={mockReturnFn} />);
|
|
137
137
|
|
|
138
138
|
const addButton = screen.getByRole("button", {
|
|
139
139
|
name: /add/i,
|
|
@@ -149,9 +149,9 @@ describe("Reports Action", () => {
|
|
|
149
149
|
});
|
|
150
150
|
|
|
151
151
|
it("check for character limits of name", async () => {
|
|
152
|
-
const mockReturnFn =
|
|
152
|
+
const mockReturnFn = vi.fn();
|
|
153
153
|
|
|
154
|
-
const { user } = render(<ReportAction onClickCancel={
|
|
154
|
+
const { user } = render(<ReportAction onClickCancel={vi.fn()} onSaveSuccess={mockReturnFn} />);
|
|
155
155
|
|
|
156
156
|
const addButton = screen.getByRole("button", {
|
|
157
157
|
name: /add/i,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
|
+
import { vi } from "vitest";
|
|
6
7
|
import faker from "@faker-js/faker";
|
|
7
|
-
import "@testing-library/jest-dom";
|
|
8
8
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
9
9
|
import { fireEvent, mockIModelId1, mockIModelsResponse, mockReportId, render, screen, waitFor, within } from "./test-utils";
|
|
10
10
|
import * as moq from "typemoq";
|
|
@@ -120,8 +120,8 @@ const mockReportMappingsAndMappingsFactory = (): ReportMappingAndMapping[] => {
|
|
|
120
120
|
const mockBulkExtractor = moq.Mock.ofType<BulkExtractor>();
|
|
121
121
|
const mockIModelsClient = moq.Mock.ofType<IModelOperations<OperationOptions>>();
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
...
|
|
123
|
+
vi.mock("../widget/components/Constants.ts", async () => ({
|
|
124
|
+
...(await vi.importActual("../widget/components/Constants.ts")),
|
|
125
125
|
STATUS_CHECK_INTERVAL: 10,
|
|
126
126
|
}));
|
|
127
127
|
|
|
@@ -220,7 +220,7 @@ describe("Report Mapping Horizontal Tile", () => {
|
|
|
220
220
|
.setup(async (x) => x.getIModelState(firstMockMapping.imodelId, firstMockMapping.iModelName, mockOdataFeedUrl))
|
|
221
221
|
.returns(async () => ExtractionStates.None);
|
|
222
222
|
|
|
223
|
-
const mockOnClickDelete =
|
|
223
|
+
const mockOnClickDelete = vi.fn();
|
|
224
224
|
|
|
225
225
|
const jobStartEvent = new BeEvent<(iModelId: string) => void>();
|
|
226
226
|
|
|
@@ -263,7 +263,7 @@ describe("Report Mapping Horizontal Tile", () => {
|
|
|
263
263
|
.setup(async (x) => x.getIModelState(firstMockMapping.imodelId, firstMockMapping.iModelName, mockOdataFeedUrl))
|
|
264
264
|
.returns(async () => ExtractionStates.None);
|
|
265
265
|
|
|
266
|
-
const mockOnClickDelete =
|
|
266
|
+
const mockOnClickDelete = vi.fn();
|
|
267
267
|
|
|
268
268
|
const jobStartEvent = new BeEvent<(iModelId: string) => void>();
|
|
269
269
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
|
-
import "
|
|
6
|
+
import { vi } from "vitest";
|
|
7
7
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
8
8
|
import {
|
|
9
9
|
act,
|
|
@@ -127,12 +127,12 @@ const mockMappingsFactory = (mockReportMappings: ReportMappingCollection): Mappi
|
|
|
127
127
|
return mockMappings;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
...
|
|
130
|
+
vi.mock("../widget/components/Constants.ts", async () => ({
|
|
131
|
+
...(await vi.importActual("../widget/components/Constants.ts")),
|
|
132
132
|
STATUS_CHECK_INTERVAL: 10,
|
|
133
133
|
}));
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
vi.mock("../widget/components/ReportMappingHorizontalTile", () => ({
|
|
136
136
|
ReportMappingHorizontalTile: (props: ReportMappingHorizontalTileProps) => {
|
|
137
137
|
return (
|
|
138
138
|
<div data-testid="horizontal-tile">
|
|
@@ -144,25 +144,25 @@ jest.mock("../widget/components/ReportMappingHorizontalTile", () => ({
|
|
|
144
144
|
}));
|
|
145
145
|
|
|
146
146
|
let onClose: () => Promise<void>;
|
|
147
|
-
|
|
148
|
-
...
|
|
147
|
+
vi.mock("../widget/components/AddMappingsModal", async () => ({
|
|
148
|
+
...(await vi.importActual("../widget/components/AddMappingsModal")),
|
|
149
149
|
AddMappingsModal: (props: AddMappingsModalProps) => {
|
|
150
150
|
onClose = props.onClose;
|
|
151
151
|
return <div data-testid="add-mappings-modal" />;
|
|
152
152
|
},
|
|
153
153
|
}));
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
...
|
|
155
|
+
vi.mock("@itwin/imodels-client-management", async () => ({
|
|
156
|
+
...(await vi.importActual("@itwin/imodels-client-management")),
|
|
157
157
|
|
|
158
|
-
toArray:
|
|
158
|
+
toArray: vi.fn().mockImplementation(async () => {
|
|
159
159
|
return mockProjectIModels.iModels;
|
|
160
160
|
}),
|
|
161
161
|
}));
|
|
162
162
|
|
|
163
|
-
const mockGetMapping =
|
|
164
|
-
const mockGetMappings =
|
|
165
|
-
const mockGetReportMappings =
|
|
163
|
+
const mockGetMapping = vi.fn();
|
|
164
|
+
const mockGetMappings = vi.fn();
|
|
165
|
+
const mockGetReportMappings = vi.fn();
|
|
166
166
|
|
|
167
167
|
const mockIModelsClient = moq.Mock.ofType<IModelsClient>();
|
|
168
168
|
const mockIModelsClientOperations = moq.Mock.ofType<IModelOperations<OperationOptions>>();
|
|
@@ -198,7 +198,7 @@ describe("Report Mappings View", () => {
|
|
|
198
198
|
mockGetMapping.mockReturnValueOnce(mockMappings[0].mapping).mockReturnValueOnce(mockMappings[1].mapping);
|
|
199
199
|
mockGetReportMappings.mockReturnValueOnce(mockReportMappings.mappings);
|
|
200
200
|
|
|
201
|
-
render(<ReportMappings report={mockReport} onClickClose={
|
|
201
|
+
render(<ReportMappings report={mockReport} onClickClose={vi.fn()} />, {
|
|
202
202
|
reportsClient: mockReportsClient.object,
|
|
203
203
|
mappingsClient: mockMappingsClient.object,
|
|
204
204
|
iModelsClient: mockIModelsClient.object,
|
|
@@ -217,7 +217,7 @@ describe("Report Mappings View", () => {
|
|
|
217
217
|
mockGetMapping.mockReturnValueOnce(mockMappings[0].mapping).mockReturnValueOnce(mockMappings[1].mapping);
|
|
218
218
|
mockGetReportMappings.mockReturnValueOnce(mockReportMappings.mappings);
|
|
219
219
|
|
|
220
|
-
const { user } = render(<ReportMappings report={mockReport} onClickClose={
|
|
220
|
+
const { user } = render(<ReportMappings report={mockReport} onClickClose={vi.fn()} />, {
|
|
221
221
|
reportsClient: mockReportsClient.object,
|
|
222
222
|
mappingsClient: mockMappingsClient.object,
|
|
223
223
|
iModelsClient: mockIModelsClient.object,
|
|
@@ -258,7 +258,7 @@ describe("Report Mappings View", () => {
|
|
|
258
258
|
mockGetMapping.mockReturnValueOnce(mockMappings[0].mapping).mockReturnValueOnce(mockMappings[1].mapping);
|
|
259
259
|
mockGetReportMappings.mockReturnValueOnce(mockReportMappings.mappings);
|
|
260
260
|
|
|
261
|
-
const { user } = render(<ReportMappings report={mockReport} onClickClose={
|
|
261
|
+
const { user } = render(<ReportMappings report={mockReport} onClickClose={vi.fn()} />, {
|
|
262
262
|
reportsClient: mockReportsClient.object,
|
|
263
263
|
mappingsClient: mockMappingsClient.object,
|
|
264
264
|
iModelsClient: mockIModelsClient.object,
|
|
@@ -288,7 +288,7 @@ describe("Report Mappings View", () => {
|
|
|
288
288
|
});
|
|
289
289
|
|
|
290
290
|
it("odata feed url", async () => {
|
|
291
|
-
const { user } = render(<ReportMappings report={mockReport} onClickClose={
|
|
291
|
+
const { user } = render(<ReportMappings report={mockReport} onClickClose={vi.fn()} />, {
|
|
292
292
|
reportsClient: mockReportsClient.object,
|
|
293
293
|
mappingsClient: mockMappingsClient.object,
|
|
294
294
|
iModelsClient: mockIModelsClient.object,
|
|
@@ -317,11 +317,11 @@ describe("Report Mappings View", () => {
|
|
|
317
317
|
mockGetMapping.mockReturnValueOnce(mockMappings[0].mapping).mockReturnValueOnce(mockMappings[1].mapping);
|
|
318
318
|
mockGetReportMappings.mockReturnValueOnce(mockReportMappings.mappings);
|
|
319
319
|
|
|
320
|
-
const bulkExtractor = new BulkExtractor(new ReportsClient(), new ExtractionClient(),
|
|
320
|
+
const bulkExtractor = new BulkExtractor(new ReportsClient(), new ExtractionClient(), vi.fn().mockResolvedValue("mockAccessToken"), vi.fn, vi.fn);
|
|
321
321
|
|
|
322
|
-
const runIModelExtractionsMock =
|
|
322
|
+
const runIModelExtractionsMock = vi.spyOn(bulkExtractor, "runIModelExtractions").mockImplementation(async () => Promise.resolve());
|
|
323
323
|
|
|
324
|
-
const { user } = render(<ReportMappings report={mockReport} onClickClose={
|
|
324
|
+
const { user } = render(<ReportMappings report={mockReport} onClickClose={vi.fn()} />, {
|
|
325
325
|
reportsClient: mockReportsClient.object,
|
|
326
326
|
mappingsClient: mockMappingsClient.object,
|
|
327
327
|
iModelsClient: mockIModelsClient.object,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
|
-
import "
|
|
6
|
+
import { vi } from "vitest";
|
|
7
7
|
import { render, screen, waitForElementToBeRemoved, within } from "../test/test-utils";
|
|
8
8
|
import { Reports } from "../widget/components/Reports";
|
|
9
9
|
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
@@ -36,8 +36,8 @@ const reportsFactory = (): ReportCollection => ({
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const mockGetReports =
|
|
40
|
-
const mockDeleteReport =
|
|
39
|
+
const mockGetReports = vi.fn();
|
|
40
|
+
const mockDeleteReport = vi.fn();
|
|
41
41
|
|
|
42
42
|
const mockReportsClient = moq.Mock.ofType<ReportsClient>();
|
|
43
43
|
|
|
@@ -57,7 +57,7 @@ afterEach(() => {
|
|
|
57
57
|
describe("Reports View", () => {
|
|
58
58
|
it("call to action button should be clickable with no reports", async () => {
|
|
59
59
|
mockGetReports.mockReturnValueOnce([]);
|
|
60
|
-
const onClickAddMock =
|
|
60
|
+
const onClickAddMock = vi.fn();
|
|
61
61
|
|
|
62
62
|
const { user } = render(<Reports onClickAddReport={onClickAddMock} />, { reportsClient: mockReportsClient.object });
|
|
63
63
|
|
|
@@ -72,7 +72,7 @@ describe("Reports View", () => {
|
|
|
72
72
|
it("be able to add new report", async () => {
|
|
73
73
|
mockGetReports.mockReturnValueOnce([]);
|
|
74
74
|
|
|
75
|
-
const onClickAddMock =
|
|
75
|
+
const onClickAddMock = vi.fn();
|
|
76
76
|
const { user } = render(<Reports onClickAddReport={onClickAddMock} />, { reportsClient: mockReportsClient.object });
|
|
77
77
|
|
|
78
78
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
@@ -104,7 +104,7 @@ describe("Reports View", () => {
|
|
|
104
104
|
it("able to modify a report", async () => {
|
|
105
105
|
const mockedReports: ReportCollection = reportsFactory();
|
|
106
106
|
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
107
|
-
const onClickModifyMock =
|
|
107
|
+
const onClickModifyMock = vi.fn();
|
|
108
108
|
const { user } = render(<Reports onClickReportModify={onClickModifyMock} />, { reportsClient: mockReportsClient.object });
|
|
109
109
|
|
|
110
110
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
@@ -175,7 +175,7 @@ describe("Reports View", () => {
|
|
|
175
175
|
it("modify a report", async () => {
|
|
176
176
|
const mockedReports: ReportCollection = reportsFactory();
|
|
177
177
|
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
178
|
-
const onClickModifyMock =
|
|
178
|
+
const onClickModifyMock = vi.fn();
|
|
179
179
|
const { user } = render(<Reports onClickReportModify={onClickModifyMock} />, { reportsClient: mockReportsClient.object });
|
|
180
180
|
|
|
181
181
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
@@ -190,7 +190,7 @@ describe("Reports View", () => {
|
|
|
190
190
|
it("click a report", async () => {
|
|
191
191
|
const mockedReports: ReportCollection = reportsFactory();
|
|
192
192
|
mockGetReports.mockReturnValueOnce(mockedReports.reports);
|
|
193
|
-
const onClickTitleMock =
|
|
193
|
+
const onClickTitleMock = vi.fn();
|
|
194
194
|
const { user } = render(<Reports onClickReportTitle={onClickTitleMock} />, { reportsClient: mockReportsClient.object });
|
|
195
195
|
|
|
196
196
|
await waitForElementToBeRemoved(() => screen.getByText(/loading/i));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from "react";
|
|
6
|
-
import "
|
|
6
|
+
import { vi } from "vitest";
|
|
7
7
|
import { render, screen } from "../test/test-utils";
|
|
8
8
|
import { WidgetHeader } from "../widget/components/utils";
|
|
9
9
|
import { faker } from "@faker-js/faker";
|
|
@@ -26,7 +26,7 @@ describe("Widget Header Component", () => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
it("header allows return callback", async () => {
|
|
29
|
-
const mockReturnFn =
|
|
29
|
+
const mockReturnFn = vi.fn();
|
|
30
30
|
const { user, container } = render(<WidgetHeader title="" returnFn={mockReturnFn} />);
|
|
31
31
|
|
|
32
32
|
const returnBtn = container.getElementsByClassName("rcw-chevron")[0];
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
5
|
+
import "@testing-library/jest-dom/vitest";
|
package/src/test/test-utils.tsx
CHANGED
|
@@ -103,6 +103,6 @@ function render(ui: React.ReactElement, contextProps?: Partial<ReportsConfigCont
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export
|
|
107
|
-
|
|
106
|
+
// Re-export everything from @testing-library/react except render
|
|
107
|
+
export { act, cleanup, fireEvent, screen, waitFor, waitForElementToBeRemoved, within } from "@testing-library/react";
|
|
108
108
|
export { render };
|
package/tsconfig.json
CHANGED
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { defineConfig } from "vitest/config";
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: {
|
|
10
|
+
"react-dom/client": "react-dom",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
test: {
|
|
14
|
+
globals: true,
|
|
15
|
+
environment: "jsdom",
|
|
16
|
+
setupFiles: ["src/test/setup.ts"],
|
|
17
|
+
dir: "src",
|
|
18
|
+
server: {
|
|
19
|
+
deps: {
|
|
20
|
+
inline: [
|
|
21
|
+
"@itwin/appui-react",
|
|
22
|
+
"@itwin/components-react",
|
|
23
|
+
"@itwin/core-react",
|
|
24
|
+
"@itwin/imodel-components-react",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|