@itwin/reports-config-widget-react 0.1.0 → 0.2.1
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/.rush/temp/package-deps_rebuild.json +38 -34
- package/.rush/temp/shrinkwrap-deps.json +14 -6
- package/CHANGELOG.json +30 -0
- package/CHANGELOG.md +17 -1
- package/coverage/clover.xml +605 -610
- package/coverage/coverage-final.json +28 -27
- package/coverage/lcov-report/index.html +31 -31
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +10 -10
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +1 -1
- package/coverage/lcov-report/src/test/test-utils.tsx.html +22 -22
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +7 -7
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +29 -41
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +31 -37
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +270 -162
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +4 -4
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +21 -21
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +6 -6
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +14 -14
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +15 -15
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +14 -14
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +22 -19
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +43 -43
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +57 -57
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +208 -0
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +8 -8
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +8 -8
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +14 -20
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +30 -33
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +469 -0
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +183 -231
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +73 -43
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +10 -10
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +10 -10
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +31 -31
- package/coverage/lcov-report/src/widget/components/index.html +100 -85
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +32 -32
- package/coverage/lcov-report/src/widget/context/ReportsApiConfigContext.tsx.html +8 -8
- 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 +7 -7
- package/coverage/lcov-report/src/widget/index.html +1 -1
- package/coverage/lcov.info +990 -1003
- package/jest.config.js +6 -0
- package/lib/cjs/test/AddMappingModal.test.d.ts +2 -0
- package/lib/cjs/test/AddMappingModal.test.d.ts.map +1 -0
- package/lib/cjs/test/AddMappingModal.test.js +277 -0
- package/lib/cjs/test/AddMappingModal.test.js.map +1 -0
- package/lib/cjs/test/BulkExtractor.test.d.ts +2 -0
- package/lib/cjs/test/BulkExtractor.test.d.ts.map +1 -0
- package/lib/cjs/test/BulkExtractor.test.js +182 -0
- package/lib/cjs/test/BulkExtractor.test.js.map +1 -0
- package/lib/cjs/test/DeleteModal.test.d.ts +2 -0
- package/lib/cjs/test/DeleteModal.test.d.ts.map +1 -0
- package/lib/cjs/test/DeleteModal.test.js +93 -0
- package/lib/cjs/test/DeleteModal.test.js.map +1 -0
- package/lib/cjs/test/ReportAction.test.js +2 -3
- package/lib/cjs/test/ReportAction.test.js.map +1 -1
- package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts +2 -0
- package/lib/cjs/test/ReportMappingHorizontalTile.test.d.ts.map +1 -0
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js +340 -0
- package/lib/cjs/test/ReportMappingHorizontalTile.test.js.map +1 -0
- package/lib/cjs/test/ReportMappings.test.js +115 -267
- package/lib/cjs/test/ReportMappings.test.js.map +1 -1
- package/lib/cjs/test/Reports.test.js +1 -1
- package/lib/cjs/test/Reports.test.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +4 -5
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +2 -2
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js +5 -4
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.scss +4 -3
- package/lib/cjs/widget/components/BulkExtractor.d.ts +18 -9
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js +86 -57
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.js +1 -1
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -1
- package/lib/cjs/widget/components/DeleteModal.scss +4 -3
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js +1 -1
- package/lib/cjs/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js +1 -1
- package/lib/cjs/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/cjs/widget/components/ExtractionStatus.scss +15 -1
- package/lib/cjs/widget/components/ExtractionToast.d.ts +11 -0
- package/lib/cjs/widget/components/ExtractionToast.d.ts.map +1 -0
- package/lib/cjs/widget/components/ExtractionToast.js +33 -0
- package/lib/cjs/widget/components/ExtractionToast.js.map +1 -0
- package/lib/cjs/widget/components/HorizontalTile.scss +1 -1
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportAction.js +3 -3
- package/lib/cjs/widget/components/ReportAction.js.map +1 -1
- package/lib/cjs/widget/components/ReportAction.scss +2 -2
- package/lib/cjs/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportHorizontalTile.js +1 -2
- package/lib/cjs/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts +13 -0
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js +82 -0
- package/lib/cjs/widget/components/ReportMappingHorizontalTile.js.map +1 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts +3 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js +39 -40
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.scss +7 -7
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js +13 -6
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/Reports.scss +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/ReportsContainer.scss +2 -2
- package/lib/cjs/widget/components/SelectIModel.js +2 -2
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.scss +4 -3
- package/lib/cjs/widget/components/utils.js +1 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +2 -2
- package/lib/esm/test/AddMappingModal.test.d.ts +2 -0
- package/lib/esm/test/AddMappingModal.test.d.ts.map +1 -0
- package/lib/esm/test/AddMappingModal.test.js +253 -0
- package/lib/esm/test/AddMappingModal.test.js.map +1 -0
- package/lib/esm/test/BulkExtractor.test.d.ts +2 -0
- package/lib/esm/test/BulkExtractor.test.d.ts.map +1 -0
- package/lib/esm/test/BulkExtractor.test.js +158 -0
- package/lib/esm/test/BulkExtractor.test.js.map +1 -0
- package/lib/esm/test/DeleteModal.test.d.ts +2 -0
- package/lib/esm/test/DeleteModal.test.d.ts.map +1 -0
- package/lib/esm/test/DeleteModal.test.js +69 -0
- package/lib/esm/test/DeleteModal.test.js.map +1 -0
- package/lib/esm/test/ReportAction.test.js +2 -3
- package/lib/esm/test/ReportAction.test.js.map +1 -1
- package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts +2 -0
- package/lib/esm/test/ReportMappingHorizontalTile.test.d.ts.map +1 -0
- package/lib/esm/test/ReportMappingHorizontalTile.test.js +316 -0
- package/lib/esm/test/ReportMappingHorizontalTile.test.js.map +1 -0
- package/lib/esm/test/ReportMappings.test.js +117 -269
- package/lib/esm/test/ReportMappings.test.js.map +1 -1
- package/lib/esm/test/Reports.test.js +1 -1
- package/lib/esm/test/Reports.test.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -1
- package/lib/esm/widget/components/ActionPanel.js +4 -5
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts +2 -2
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js +4 -5
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.scss +4 -3
- package/lib/esm/widget/components/BulkExtractor.d.ts +18 -9
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js +86 -57
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.js +1 -1
- package/lib/esm/widget/components/DeleteModal.js.map +1 -1
- package/lib/esm/widget/components/DeleteModal.scss +4 -3
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js +1 -1
- package/lib/esm/widget/components/ExtractionStates/RunningExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.d.ts.map +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js +1 -1
- package/lib/esm/widget/components/ExtractionStates/SucceededExtractionState.js.map +1 -1
- package/lib/esm/widget/components/ExtractionStatus.scss +15 -1
- package/lib/esm/widget/components/ExtractionToast.d.ts +11 -0
- package/lib/esm/widget/components/ExtractionToast.d.ts.map +1 -0
- package/lib/esm/widget/components/ExtractionToast.js +25 -0
- package/lib/esm/widget/components/ExtractionToast.js.map +1 -0
- package/lib/esm/widget/components/HorizontalTile.scss +1 -1
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportAction.js +3 -3
- package/lib/esm/widget/components/ReportAction.js.map +1 -1
- package/lib/esm/widget/components/ReportAction.scss +2 -2
- package/lib/esm/widget/components/ReportHorizontalTile.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportHorizontalTile.js +1 -2
- package/lib/esm/widget/components/ReportHorizontalTile.js.map +1 -1
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts +13 -0
- package/lib/esm/widget/components/ReportMappingHorizontalTile.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js +75 -0
- package/lib/esm/widget/components/ReportMappingHorizontalTile.js.map +1 -0
- package/lib/esm/widget/components/ReportMappings.d.ts +3 -1
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js +40 -41
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.scss +7 -7
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js +15 -8
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/Reports.scss +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +1 -1
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.scss +2 -2
- package/lib/esm/widget/components/SelectIModel.js +2 -2
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.scss +4 -3
- package/lib/esm/widget/components/utils.js +1 -1
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +2 -2
- package/lib/public/locales/en/ReportsConfigWidget.json +5 -0
- package/package.json +7 -4
- package/public/locales/en/ReportsConfigWidget.json +5 -0
- package/reports-config-widget-react.build.error.log +10 -6
- package/reports-config-widget-react.build.log +51 -46
- package/src/test/AddMappingModal.test.tsx +315 -0
- package/src/test/BulkExtractor.test.ts +301 -0
- package/src/test/DeleteModal.test.tsx +118 -0
- package/src/test/ReportAction.test.tsx +2 -4
- package/src/test/ReportMappingHorizontalTile.test.tsx +451 -0
- package/src/test/ReportMappings.test.tsx +154 -549
- package/src/test/Reports.test.tsx +1 -1
- package/src/widget/components/ActionPanel.tsx +19 -23
- package/src/widget/components/AddMappingsModal.scss +4 -3
- package/src/widget/components/AddMappingsModal.tsx +4 -6
- package/src/widget/components/BulkExtractor.ts +97 -61
- package/src/widget/components/DeleteModal.scss +4 -3
- package/src/widget/components/DeleteModal.tsx +1 -1
- package/src/widget/components/ExtractionStates/RunningExtractionState.tsx +1 -1
- package/src/widget/components/ExtractionStates/SucceededExtractionState.tsx +1 -0
- package/src/widget/components/ExtractionStatus.scss +15 -1
- package/src/widget/components/ExtractionToast.tsx +41 -0
- package/src/widget/components/HorizontalTile.scss +1 -1
- package/src/widget/components/ReportAction.scss +2 -2
- package/src/widget/components/ReportAction.tsx +1 -3
- package/src/widget/components/ReportHorizontalTile.tsx +1 -2
- package/src/widget/components/ReportMappingHorizontalTile.tsx +128 -0
- package/src/widget/components/ReportMappings.scss +7 -7
- package/src/widget/components/ReportMappings.tsx +89 -105
- package/src/widget/components/Reports.scss +1 -1
- package/src/widget/components/Reports.tsx +18 -8
- package/src/widget/components/ReportsContainer.scss +2 -2
- package/src/widget/components/ReportsContainer.tsx +1 -1
- package/src/widget/components/SelectIModel.scss +4 -3
- package/src/widget/components/SelectIModel.tsx +2 -2
- package/src/widget/components/utils.scss +2 -2
- package/src/widget/components/utils.tsx +1 -1
- package/coverage/lcov-report/src/widget/components/Extraction.tsx.html +0 -1030
- package/lib/cjs/widget/components/Extraction.d.ts +0 -28
- package/lib/cjs/widget/components/Extraction.d.ts.map +0 -1
- package/lib/cjs/widget/components/Extraction.js +0 -190
- package/lib/cjs/widget/components/Extraction.js.map +0 -1
- package/lib/cjs/widget/components/Extraction.scss +0 -39
- package/lib/esm/widget/components/Extraction.d.ts +0 -28
- package/lib/esm/widget/components/Extraction.d.ts.map +0 -1
- package/lib/esm/widget/components/Extraction.js +0 -166
- package/lib/esm/widget/components/Extraction.js.map +0 -1
- package/lib/esm/widget/components/Extraction.scss +0 -39
- package/src/widget/components/Extraction.scss +0 -39
- package/src/widget/components/Extraction.tsx +0 -315
|
@@ -1,55 +1,60 @@
|
|
|
1
1
|
Invoking: npm test -- --coverage
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
> @itwin/reports-config-widget-react@0.0
|
|
4
|
+
> @itwin/reports-config-widget-react@0.2.0 test /home/vsts/work/1/s/packages/itwin/reports-config-widget
|
|
5
5
|
> jest "--coverage"
|
|
6
6
|
|
|
7
|
-
PASS src/test/ReportMappings.test.tsx (
|
|
8
|
-
PASS src/test/
|
|
9
|
-
PASS src/test/
|
|
7
|
+
PASS src/test/ReportMappings.test.tsx (9.915 s)
|
|
8
|
+
PASS src/test/ReportMappingHorizontalTile.test.tsx
|
|
9
|
+
PASS src/test/Reports.test.tsx (7.469 s)
|
|
10
|
+
PASS src/test/BulkExtractor.test.ts
|
|
11
|
+
PASS src/test/AddMappingModal.test.tsx
|
|
12
|
+
PASS src/test/ReportAction.test.tsx
|
|
13
|
+
PASS src/test/DeleteModal.test.tsx
|
|
10
14
|
PASS src/test/WidgetHeader.test.tsx
|
|
11
|
-
|
|
12
|
-
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
13
|
-
|
|
14
|
-
All files |
|
|
15
|
-
src | 100 | 75 | 100 | 100 |
|
|
16
|
-
ReportsConfigWidget.ts | 100 | 75 | 100 | 100 | 21
|
|
17
|
-
src/test | 100 | 66.66 | 100 | 100 |
|
|
18
|
-
test-utils.tsx | 100 | 66.66 | 100 | 100 | 56
|
|
19
|
-
src/widget | 40 | 0 | 0 | 40 |
|
|
20
|
-
ReportsConfigUiProvider.tsx | 40 | 0 | 0 | 40 | 23-65
|
|
21
|
-
src/widget/components |
|
|
22
|
-
ActionPanel.tsx | 100 | 77.77 | 100 | 100 | 25-26
|
|
23
|
-
AddMappingsModal.tsx | 91.66 | 83.33 | 88.88 | 93.
|
|
24
|
-
BulkExtractor.ts |
|
|
25
|
-
Constants.ts | 100 | 100 | 100 | 100 |
|
|
26
|
-
DeleteModal.tsx |
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
HorizontalTile.tsx | 100 | 100 | 100 | 100 |
|
|
30
|
-
LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
|
|
31
|
-
ReportAction.tsx | 94.28 | 81.48 | 100 | 94.28 | 59-60
|
|
32
|
-
ReportHorizontalTile.tsx |
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
15
|
+
----------------------------------------|---------|----------|---------|---------|-------------------------------------
|
|
16
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
17
|
+
----------------------------------------|---------|----------|---------|---------|-------------------------------------
|
|
18
|
+
All files | 86.69 | 65.94 | 79.76 | 86.79 |
|
|
19
|
+
src | 100 | 75 | 100 | 100 |
|
|
20
|
+
ReportsConfigWidget.ts | 100 | 75 | 100 | 100 | 21
|
|
21
|
+
src/test | 100 | 66.66 | 100 | 100 |
|
|
22
|
+
test-utils.tsx | 100 | 66.66 | 100 | 100 | 56
|
|
23
|
+
src/widget | 40 | 0 | 0 | 40 |
|
|
24
|
+
ReportsConfigUiProvider.tsx | 40 | 0 | 0 | 40 | 23-65
|
|
25
|
+
src/widget/components | 86.37 | 67.81 | 79.72 | 86.64 |
|
|
26
|
+
ActionPanel.tsx | 100 | 77.77 | 100 | 100 | 25-26
|
|
27
|
+
AddMappingsModal.tsx | 91.66 | 83.33 | 88.88 | 93.33 | 40,120,134
|
|
28
|
+
BulkExtractor.ts | 85 | 76.19 | 86.66 | 85.41 | 108,117-119,124-132,159-161,169-171
|
|
29
|
+
Constants.ts | 100 | 100 | 100 | 100 |
|
|
30
|
+
DeleteModal.tsx | 90 | 100 | 75 | 89.47 | 42,56
|
|
31
|
+
ExtractionStatus.tsx | 94.28 | 90 | 83.33 | 96.87 | 63
|
|
32
|
+
ExtractionToast.tsx | 58.33 | 100 | 0 | 50 | 18-22,36
|
|
33
|
+
HorizontalTile.tsx | 100 | 100 | 100 | 100 |
|
|
34
|
+
LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
|
|
35
|
+
ReportAction.tsx | 94.28 | 81.48 | 100 | 94.28 | 59-60
|
|
36
|
+
ReportHorizontalTile.tsx | 72.5 | 56 | 72.72 | 71.05 | 43-45,57-63,124
|
|
37
|
+
ReportMappingHorizontalTile.tsx | 93.87 | 100 | 91.66 | 93.61 | 66-69
|
|
38
|
+
ReportMappings.tsx | 92.13 | 56.75 | 85 | 91.86 | 97,251,267-292
|
|
39
|
+
Reports.tsx | 90.21 | 78.84 | 76 | 93.18 | 73,77,134,141-143
|
|
40
|
+
ReportsContainer.tsx | 57.14 | 0 | 0 | 61.53 | 19,25-37
|
|
41
|
+
SearchBar.tsx | 70.58 | 71.42 | 60 | 68.75 | 31-45
|
|
42
|
+
SelectIModel.tsx | 97.05 | 81.81 | 85.71 | 96.87 | 92
|
|
43
|
+
utils.tsx | 62.74 | 30.76 | 87.5 | 55.81 | 51-94,150
|
|
44
|
+
src/widget/components/ExtractionStates | 96.87 | 25 | 80 | 96.29 |
|
|
45
|
+
FailedExtractionState.tsx | 85.71 | 0 | 0 | 83.33 | 16
|
|
46
|
+
QueuedExtractionState.tsx | 100 | 100 | 100 | 100 |
|
|
47
|
+
RunningExtractionState.tsx | 100 | 100 | 100 | 100 |
|
|
48
|
+
StartingExtractionState.tsx | 100 | 100 | 100 | 100 |
|
|
49
|
+
SucceededExtractionState.tsx | 100 | 50 | 100 | 100 | 26
|
|
50
|
+
src/widget/context | 80 | 0 | 50 | 77.77 |
|
|
51
|
+
ReportsApiConfigContext.tsx | 80 | 0 | 50 | 77.77 | 15,22
|
|
52
|
+
src/widget/hooks | 100 | 100 | 100 | 100 |
|
|
53
|
+
useValidator.ts | 100 | 100 | 100 | 100 |
|
|
54
|
+
----------------------------------------|---------|----------|---------|---------|-------------------------------------
|
|
50
55
|
|
|
51
|
-
Test Suites:
|
|
52
|
-
Tests:
|
|
56
|
+
Test Suites: 8 passed, 8 total
|
|
57
|
+
Tests: 41 passed, 41 total
|
|
53
58
|
Snapshots: 0 total
|
|
54
|
-
Time:
|
|
59
|
+
Time: 29.593 s
|
|
55
60
|
Ran all test suites.
|
|
@@ -0,0 +1,315 @@
|
|
|
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 React from "react";
|
|
6
|
+
import faker from "@faker-js/faker";
|
|
7
|
+
import "@testing-library/jest-dom";
|
|
8
|
+
import type {
|
|
9
|
+
IModelConnection,
|
|
10
|
+
} from "@itwin/core-frontend";
|
|
11
|
+
import { NoRenderApp } from "@itwin/core-frontend";
|
|
12
|
+
import { ReportsConfigWidget } from "../ReportsConfigWidget";
|
|
13
|
+
import {
|
|
14
|
+
render,
|
|
15
|
+
screen,
|
|
16
|
+
TestUtils,
|
|
17
|
+
waitFor,
|
|
18
|
+
within,
|
|
19
|
+
} from "./test-utils";
|
|
20
|
+
import * as moq from "typemoq";
|
|
21
|
+
import type {
|
|
22
|
+
MappingSingle,
|
|
23
|
+
ReportMappingCollection,
|
|
24
|
+
} from "@itwin/insights-client";
|
|
25
|
+
import type { ReportMappingAndMapping } from "../widget/components/ReportMappings";
|
|
26
|
+
import type { IModelOperations, OperationOptions } from "@itwin/imodels-client-management";
|
|
27
|
+
import { IModelState } from "@itwin/imodels-client-management";
|
|
28
|
+
import { AddMappingsModal } from "../widget/components/AddMappingsModal";
|
|
29
|
+
import { EmptyLocalization } from "@itwin/core-common";
|
|
30
|
+
|
|
31
|
+
const mockITwinId = faker.datatype.uuid();
|
|
32
|
+
const mockIModelId1 = faker.datatype.uuid();
|
|
33
|
+
const mockIModelId2 = faker.datatype.uuid();
|
|
34
|
+
|
|
35
|
+
const mockReportId = faker.datatype.uuid();
|
|
36
|
+
|
|
37
|
+
const mockIModelsResponse = [
|
|
38
|
+
{
|
|
39
|
+
iModel: {
|
|
40
|
+
id: mockIModelId1,
|
|
41
|
+
displayName: "rAnDoMdIsPlAynAmE1",
|
|
42
|
+
name: "rAnDomName1",
|
|
43
|
+
description: "rAnDoMDeScRiPtIoN1",
|
|
44
|
+
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
45
|
+
state: IModelState.Initialized,
|
|
46
|
+
projectId: mockITwinId,
|
|
47
|
+
extent: null,
|
|
48
|
+
_links: {
|
|
49
|
+
creator: {
|
|
50
|
+
href: "",
|
|
51
|
+
},
|
|
52
|
+
namedVersions: {
|
|
53
|
+
href: "",
|
|
54
|
+
},
|
|
55
|
+
changesets: {
|
|
56
|
+
href: "",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
iModel: {
|
|
63
|
+
id: mockIModelId2,
|
|
64
|
+
displayName: "rAnDoMdIsPlAynAmE2",
|
|
65
|
+
name: "rAnDomName2",
|
|
66
|
+
description: "rAnDoMDeScRiPtIoN2",
|
|
67
|
+
createdDateTime: "2021-10-04T22:13:50.397Z",
|
|
68
|
+
state: IModelState.Initialized,
|
|
69
|
+
projectId: mockITwinId,
|
|
70
|
+
extent: null,
|
|
71
|
+
_links: {
|
|
72
|
+
creator: {
|
|
73
|
+
href: "",
|
|
74
|
+
},
|
|
75
|
+
namedVersions: {
|
|
76
|
+
href: "",
|
|
77
|
+
},
|
|
78
|
+
changesets: {
|
|
79
|
+
href: "",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
const mockProjectIModels = {
|
|
87
|
+
iModels: mockIModelsResponse.map((iModel) => ({
|
|
88
|
+
id: iModel.iModel.id,
|
|
89
|
+
displayName: iModel.iModel.displayName,
|
|
90
|
+
})),
|
|
91
|
+
_links: {
|
|
92
|
+
self: {
|
|
93
|
+
href: "",
|
|
94
|
+
},
|
|
95
|
+
prev: null,
|
|
96
|
+
next: null,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const mockReportMappingsFactory = (): ReportMappingCollection => {
|
|
101
|
+
return {
|
|
102
|
+
mappings: [
|
|
103
|
+
{
|
|
104
|
+
reportId: mockReportId,
|
|
105
|
+
mappingId: faker.datatype.uuid(),
|
|
106
|
+
imodelId: mockIModelId1,
|
|
107
|
+
_links: {
|
|
108
|
+
report: {
|
|
109
|
+
href: "",
|
|
110
|
+
},
|
|
111
|
+
mapping: {
|
|
112
|
+
href: "",
|
|
113
|
+
},
|
|
114
|
+
imodel: {
|
|
115
|
+
href: "",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
reportId: mockReportId,
|
|
121
|
+
mappingId: faker.datatype.uuid(),
|
|
122
|
+
imodelId: mockIModelId2,
|
|
123
|
+
_links: {
|
|
124
|
+
report: {
|
|
125
|
+
href: "",
|
|
126
|
+
},
|
|
127
|
+
mapping: {
|
|
128
|
+
href: "",
|
|
129
|
+
},
|
|
130
|
+
imodel: {
|
|
131
|
+
href: "",
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
_links: {
|
|
137
|
+
next: undefined,
|
|
138
|
+
self: {
|
|
139
|
+
href: "",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const mockMappingsFactory = (
|
|
146
|
+
mockReportMappings: ReportMappingCollection
|
|
147
|
+
): MappingSingle[] => {
|
|
148
|
+
const mockMappings: MappingSingle[] = mockReportMappings.mappings.map(
|
|
149
|
+
(mapping, index) => ({
|
|
150
|
+
mapping: {
|
|
151
|
+
id: mapping.mappingId,
|
|
152
|
+
mappingName: `mOcKMaPpIngNaMe${index}`,
|
|
153
|
+
description: `mOcKmApPInGDeScRiPtIoN${index}`,
|
|
154
|
+
extractionEnabled: false,
|
|
155
|
+
createdOn: "",
|
|
156
|
+
createdBy: "",
|
|
157
|
+
modifiedOn: "",
|
|
158
|
+
modifiedBy: "",
|
|
159
|
+
_links: {
|
|
160
|
+
imodel: {
|
|
161
|
+
// Tie the mapping to to the iModel Id
|
|
162
|
+
href: mapping.imodelId,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
})
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const extraMappingId = faker.datatype.uuid();
|
|
170
|
+
const extraMappingName = "mOcKNaMeExTrA";
|
|
171
|
+
const extraMappingDescription = "mOcKDeScRiPtIoNeXtRa";
|
|
172
|
+
|
|
173
|
+
mockMappings.push({
|
|
174
|
+
mapping: {
|
|
175
|
+
id: extraMappingId,
|
|
176
|
+
mappingName: extraMappingName,
|
|
177
|
+
description: extraMappingDescription,
|
|
178
|
+
extractionEnabled: false,
|
|
179
|
+
createdOn: "",
|
|
180
|
+
createdBy: "",
|
|
181
|
+
modifiedOn: "",
|
|
182
|
+
modifiedBy: "",
|
|
183
|
+
_links: {
|
|
184
|
+
imodel: {
|
|
185
|
+
href: "",
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
return mockMappings;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const mockReportMappingsAndMappingsFactory = (mockMappings: MappingSingle[], reportMappings: ReportMappingCollection): ReportMappingAndMapping[] => {
|
|
195
|
+
const reportMappingsAndMapping =
|
|
196
|
+
reportMappings.mappings.map((reportMapping) => {
|
|
197
|
+
const mapping = mockMappings.find((x) => x.mapping.id === reportMapping.mappingId)!.mapping;
|
|
198
|
+
const iModelName = mockProjectIModels.iModels.find((x) => x.id === reportMapping.imodelId)!.displayName;
|
|
199
|
+
const reportMappingAndMapping: ReportMappingAndMapping = {
|
|
200
|
+
...reportMapping,
|
|
201
|
+
iModelName,
|
|
202
|
+
mappingName: mapping.mappingName,
|
|
203
|
+
mappingDescription: mapping.description ?? "",
|
|
204
|
+
};
|
|
205
|
+
return reportMappingAndMapping;
|
|
206
|
+
});
|
|
207
|
+
return reportMappingsAndMapping;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
const connectionMock = moq.Mock.ofType<IModelConnection>();
|
|
211
|
+
const mockIModelsClient = moq.Mock.ofType<IModelOperations<OperationOptions>>();
|
|
212
|
+
|
|
213
|
+
jest.mock("@itwin/appui-react", () => ({
|
|
214
|
+
...jest.requireActual("@itwin/appui-react"),
|
|
215
|
+
useActiveIModelConnection: () => connectionMock.object,
|
|
216
|
+
}));
|
|
217
|
+
|
|
218
|
+
jest.mock("@itwin/imodels-client-management", () => ({
|
|
219
|
+
...jest.requireActual("@itwin/imodels-client-management"),
|
|
220
|
+
IModelsClient: jest.fn().mockImplementation(() => ({
|
|
221
|
+
iModels: mockIModelsClient.object,
|
|
222
|
+
})),
|
|
223
|
+
toArray: jest.fn().mockImplementation(async () => {
|
|
224
|
+
return mockProjectIModels.iModels;
|
|
225
|
+
}),
|
|
226
|
+
}));
|
|
227
|
+
|
|
228
|
+
const mockGetMappings = jest.fn();
|
|
229
|
+
const mockCreateReportMapping = jest.fn();
|
|
230
|
+
|
|
231
|
+
jest.mock("@itwin/insights-client", () => ({
|
|
232
|
+
...jest.requireActual("@itwin/insights-client"),
|
|
233
|
+
MappingsClient: jest.fn().mockImplementation(() => ({
|
|
234
|
+
getMappings: mockGetMappings,
|
|
235
|
+
})),
|
|
236
|
+
ReportsClient: jest.fn().mockImplementation(() => ({
|
|
237
|
+
createReportMapping: mockCreateReportMapping,
|
|
238
|
+
})),
|
|
239
|
+
}));
|
|
240
|
+
|
|
241
|
+
beforeAll(async () => {
|
|
242
|
+
await NoRenderApp.startup({localization: new EmptyLocalization()});
|
|
243
|
+
connectionMock.setup((x) => x.iModelId).returns(() => mockIModelId1);
|
|
244
|
+
await ReportsConfigWidget.initialize();
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
afterAll(() => {
|
|
248
|
+
TestUtils.terminateUiFramework();
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
afterEach(() => {
|
|
252
|
+
mockGetMappings.mockReset();
|
|
253
|
+
mockIModelsClient.reset();
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
describe("Add Mapping Modal", () => {
|
|
257
|
+
it("Adding mapping sends create request", async () => {
|
|
258
|
+
const mockReportMappings = mockReportMappingsFactory();
|
|
259
|
+
const mockMappings = mockMappingsFactory(mockReportMappings);
|
|
260
|
+
const mockReportMappingsAndMappings = mockReportMappingsAndMappingsFactory(mockMappings, mockReportMappings);
|
|
261
|
+
|
|
262
|
+
mockGetMappings.mockReturnValueOnce(mockMappings.map((m: MappingSingle) => m.mapping));
|
|
263
|
+
|
|
264
|
+
const { user } = render(
|
|
265
|
+
<AddMappingsModal
|
|
266
|
+
show={true}
|
|
267
|
+
reportId={mockReportId}
|
|
268
|
+
existingMappings={mockReportMappingsAndMappings}
|
|
269
|
+
returnFn={jest.fn()}
|
|
270
|
+
/>
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
expect(screen.getByRole("dialog")).toBeInTheDocument();
|
|
274
|
+
const modal = screen.getByRole("dialog");
|
|
275
|
+
const withinModal = within(modal);
|
|
276
|
+
expect(withinModal.getByText(/addmappings/i)).toBeInTheDocument();
|
|
277
|
+
|
|
278
|
+
const addButton = withinModal.getByRole("button", {
|
|
279
|
+
name: /add/i,
|
|
280
|
+
});
|
|
281
|
+
// Add button should be disabled
|
|
282
|
+
expect(addButton).toBeDisabled();
|
|
283
|
+
|
|
284
|
+
await waitFor(() => screen.getByRole("row"));
|
|
285
|
+
|
|
286
|
+
// Already mapped mappings are disabled
|
|
287
|
+
for (let i = 0; i < mockMappings.length - 1; i++) {
|
|
288
|
+
const row = screen.getByRole("row", {
|
|
289
|
+
name: new RegExp(
|
|
290
|
+
`${mockMappings[i].mapping.mappingName} ${mockMappings[i].mapping.description}`,
|
|
291
|
+
"i"
|
|
292
|
+
),
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
const checkbox = within(row).getByRole("checkbox");
|
|
296
|
+
expect(checkbox).toBeDisabled();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Click on checkbox on new mapping
|
|
300
|
+
const unmappedRow = screen.getByRole("row", {
|
|
301
|
+
name: new RegExp(
|
|
302
|
+
`${mockMappings[mockMappings.length - 1].mapping.mappingName
|
|
303
|
+
} ${mockMappings[mockMappings.length - 1].mapping.description}`,
|
|
304
|
+
"i"
|
|
305
|
+
),
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
const enabledCheckbox = within(unmappedRow).getByRole("checkbox");
|
|
309
|
+
|
|
310
|
+
await user.click(enabledCheckbox);
|
|
311
|
+
await user.click(addButton);
|
|
312
|
+
|
|
313
|
+
expect(mockCreateReportMapping).toBeCalledTimes(1);
|
|
314
|
+
});
|
|
315
|
+
});
|