@truedat/qx 7.5.9 → 7.5.10

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 (229) hide show
  1. package/package.json +45 -64
  2. package/src/components/QxRoutes.js +38 -19
  3. package/src/components/__tests__/QxRoutes.spec.js +73 -0
  4. package/src/components/__tests__/__snapshots__/QxRoutes.spec.js.snap +60 -0
  5. package/src/components/common/ClauseViewer.js +6 -6
  6. package/src/components/common/DescriptionInput.js +0 -1
  7. package/src/components/common/ResourceSelector.js +2 -3
  8. package/src/components/common/TestFormWrapper.js +2 -13
  9. package/src/components/common/TypeSelector.js +0 -1
  10. package/src/components/common/__tests__/DescriptionInput.spec.js +12 -21
  11. package/src/components/common/__tests__/ResourceSelector.spec.js +42 -87
  12. package/src/components/common/__tests__/TypeSelector.spec.js +0 -1
  13. package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +32 -22
  14. package/src/components/common/expressions/Clauses.js +5 -6
  15. package/src/components/common/expressions/Condition.js +8 -9
  16. package/src/components/common/expressions/ConstantSelector.js +2 -2
  17. package/src/components/common/expressions/Expression.js +2 -2
  18. package/src/components/common/expressions/FieldSelector.js +2 -2
  19. package/src/components/common/expressions/FunctionArgs.js +5 -6
  20. package/src/components/common/expressions/FunctionSelector.js +2 -2
  21. package/src/components/common/expressions/ParamSelector.js +2 -2
  22. package/src/components/common/expressions/ShapeSelector.js +7 -16
  23. package/src/components/common/expressions/__tests__/Clauses.spec.js +10 -9
  24. package/src/components/common/expressions/__tests__/Condition.spec.js +6 -26
  25. package/src/components/common/expressions/__tests__/ConstantSelector.spec.js +14 -30
  26. package/src/components/common/expressions/__tests__/Expression.spec.js +44 -51
  27. package/src/components/common/expressions/__tests__/FieldSelector.spec.js +2 -7
  28. package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +18 -44
  29. package/src/components/common/expressions/__tests__/FunctionSelector.spec.js +19 -27
  30. package/src/components/common/expressions/__tests__/ParamSelector.spec.js +28 -58
  31. package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +42 -43
  32. package/src/components/common/expressions/__tests__/__snapshots__/Condition.spec.js.snap +6 -6
  33. package/src/components/common/expressions/__tests__/__snapshots__/ConstantSelector.spec.js.snap +6 -7
  34. package/src/components/common/expressions/__tests__/__snapshots__/Expression.spec.js.snap +20 -20
  35. package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +8 -9
  36. package/src/components/common/expressions/__tests__/__snapshots__/FunctionSelector.spec.js.snap +670 -8
  37. package/src/components/common/expressions/__tests__/__snapshots__/ParamSelector.spec.js.snap +5 -5
  38. package/src/components/common/expressions/__tests__/__snapshots__/ShapeSelector.spec.js.snap +9 -9
  39. package/src/components/common/expressions/__tests__/useWatchParams.spec.js +1 -4
  40. package/src/components/common/expressions/constantInputs/AnySelector.js +5 -6
  41. package/src/components/common/expressions/constantInputs/BooleanSelector.js +2 -2
  42. package/src/components/common/expressions/constantInputs/DefaultSelector.js +2 -2
  43. package/src/components/common/expressions/constantInputs/__tests__/AnySelector.spec.js +16 -37
  44. package/src/components/common/expressions/constantInputs/__tests__/BooleanSelector.spec.js +14 -17
  45. package/src/components/common/expressions/constantInputs/__tests__/DefaultSelector.spec.js +12 -27
  46. package/src/components/common/expressions/constantInputs/__tests__/__snapshots__/AnySelector.spec.js.snap +11 -11
  47. package/src/components/common/expressions/constantInputs/__tests__/__snapshots__/DefaultSelector.spec.js.snap +0 -1
  48. package/src/components/common/resourceSelectors/DataStructureSelector.js +2 -2
  49. package/src/components/common/resourceSelectors/DataViewSelector.js +2 -2
  50. package/src/components/common/resourceSelectors/ReferenceDatasetSelector.js +2 -2
  51. package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +5 -29
  52. package/src/components/common/resourceSelectors/__tests__/DataViewSelector.spec.js +23 -25
  53. package/src/components/common/resourceSelectors/__tests__/ReferenceDatasetSelector.spec.js +21 -32
  54. package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +3 -4
  55. package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataViewSelector.spec.js.snap +1 -1
  56. package/src/components/common/resourceSelectors/__tests__/__snapshots__/ReferenceDatasetSelector.spec.js.snap +1 -1
  57. package/src/components/dataViews/DataViewEditor.js +5 -6
  58. package/src/components/dataViews/DataViewSelect.js +4 -5
  59. package/src/components/dataViews/DataViews.js +1 -2
  60. package/src/components/dataViews/Queryable.js +4 -4
  61. package/src/components/dataViews/Queryables.js +0 -1
  62. package/src/components/dataViews/__tests__/DataViewEditor.spec.js +36 -111
  63. package/src/components/dataViews/__tests__/DataViewSelect.spec.js +0 -1
  64. package/src/components/dataViews/__tests__/DataViews.spec.js +15 -16
  65. package/src/components/dataViews/__tests__/Queryable.spec.js +0 -1
  66. package/src/components/dataViews/__tests__/Queryables.spec.js +35 -74
  67. package/src/components/dataViews/__tests__/__snapshots__/DataViewEditor.spec.js.snap +61 -55
  68. package/src/components/dataViews/__tests__/__snapshots__/DataViews.spec.js.snap +5 -5
  69. package/src/components/dataViews/__tests__/__snapshots__/Queryables.spec.js.snap +59 -59
  70. package/src/components/dataViews/queryableProperties/From.js +4 -4
  71. package/src/components/dataViews/queryableProperties/GroupBy.js +6 -6
  72. package/src/components/dataViews/queryableProperties/Join.js +6 -6
  73. package/src/components/dataViews/queryableProperties/JoinTypeIcon.js +8 -9
  74. package/src/components/dataViews/queryableProperties/Select.js +4 -5
  75. package/src/components/dataViews/queryableProperties/SelectField.js +4 -4
  76. package/src/components/dataViews/queryableProperties/Where.js +4 -4
  77. package/src/components/dataViews/queryableProperties/__tests__/From.spec.js +0 -1
  78. package/src/components/dataViews/queryableProperties/__tests__/GroupBy.spec.js +16 -42
  79. package/src/components/dataViews/queryableProperties/__tests__/Join.spec.js +6 -29
  80. package/src/components/dataViews/queryableProperties/__tests__/JoinTypeIcon.spec.js +0 -1
  81. package/src/components/dataViews/queryableProperties/__tests__/Select.spec.js +26 -50
  82. package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +22 -42
  83. package/src/components/dataViews/queryableProperties/__tests__/Where.spec.js +6 -17
  84. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/GroupBy.spec.js.snap +309 -9
  85. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Join.spec.js.snap +12 -12
  86. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Select.spec.js.snap +192 -18
  87. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/SelectField.spec.js.snap +6 -8
  88. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Where.spec.js.snap +2 -2
  89. package/src/components/functions/FunctionEditor.js +3 -5
  90. package/src/components/functions/FunctionParams.js +2 -3
  91. package/src/components/functions/Functions.js +3 -4
  92. package/src/components/functions/__tests__/FunctionEditor.spec.js +61 -57
  93. package/src/components/functions/__tests__/FunctionParams.spec.js +50 -47
  94. package/src/components/functions/__tests__/Functions.spec.js +5 -12
  95. package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +11 -11
  96. package/src/components/functions/__tests__/__snapshots__/Functions.spec.js.snap +4 -5
  97. package/src/components/qualityControls/ControlProperties.js +4 -4
  98. package/src/components/qualityControls/ControlPropertiesView.js +0 -1
  99. package/src/components/qualityControls/EditQualityControl.js +5 -5
  100. package/src/components/qualityControls/IconPopup.js +0 -1
  101. package/src/components/qualityControls/NewDraftQualityControl.js +8 -6
  102. package/src/components/qualityControls/NewQualityControl.js +5 -6
  103. package/src/components/qualityControls/QualityBadge.js +29 -30
  104. package/src/components/qualityControls/QualityControl.js +4 -7
  105. package/src/components/qualityControls/QualityControlActions.js +7 -7
  106. package/src/components/qualityControls/QualityControlCrumbs.js +1 -3
  107. package/src/components/qualityControls/QualityControlEditor.js +5 -11
  108. package/src/components/qualityControls/QualityControlHeader.js +4 -6
  109. package/src/components/qualityControls/QualityControlHistory.js +3 -3
  110. package/src/components/qualityControls/QualityControlManageDomain.js +2 -2
  111. package/src/components/qualityControls/QualityControlQueryModal.js +1 -1
  112. package/src/components/qualityControls/QualityControlRoutes.js +27 -54
  113. package/src/components/qualityControls/QualityControlRow.js +0 -2
  114. package/src/components/qualityControls/QualityControlScores.js +7 -5
  115. package/src/components/qualityControls/QualityControlTabs.js +2 -2
  116. package/src/components/qualityControls/QualityControls.js +10 -8
  117. package/src/components/qualityControls/QualityControlsLabelResults.js +0 -2
  118. package/src/components/qualityControls/QualityControlsPagination.js +0 -1
  119. package/src/components/qualityControls/QualityControlsTable.js +1 -2
  120. package/src/components/qualityControls/ScoreCriteria.js +4 -4
  121. package/src/components/qualityControls/ScoreCriteriaView.js +0 -1
  122. package/src/components/qualityControls/__tests__/ControlProperties.spec.js +10 -15
  123. package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +0 -1
  124. package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +28 -70
  125. package/src/components/qualityControls/__tests__/IconPopup.spec.js +10 -11
  126. package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +33 -70
  127. package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +81 -113
  128. package/src/components/qualityControls/__tests__/QualityBadge.spec.js +50 -58
  129. package/src/components/qualityControls/__tests__/QualityControl.spec.js +19 -31
  130. package/src/components/qualityControls/__tests__/QualityControlActions.spec.js +49 -46
  131. package/src/components/qualityControls/__tests__/QualityControlCrumbs.spec.js +0 -1
  132. package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +68 -107
  133. package/src/components/qualityControls/__tests__/QualityControlHeader.spec.js +22 -25
  134. package/src/components/qualityControls/__tests__/QualityControlHistory.spec.js +6 -6
  135. package/src/components/qualityControls/__tests__/QualityControlManageDomain.spec.js +0 -1
  136. package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +12 -11
  137. package/src/components/qualityControls/__tests__/QualityControlRow.spec.js +4 -8
  138. package/src/components/qualityControls/__tests__/QualityControlScores.spec.js +23 -19
  139. package/src/components/qualityControls/__tests__/QualityControlTabs.spec.js +2 -3
  140. package/src/components/qualityControls/__tests__/QualityControls.spec.js +69 -53
  141. package/src/components/qualityControls/__tests__/QualityControlsLabelResults.spec.js +0 -1
  142. package/src/components/qualityControls/__tests__/QualityControlsPagination.spec.js +0 -1
  143. package/src/components/qualityControls/__tests__/QualityControlsTable.spec.js +2 -3
  144. package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +0 -1
  145. package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +0 -1
  146. package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +1 -1
  147. package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +32 -34
  148. package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +31 -33
  149. package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +17 -19
  150. package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +9 -15
  151. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlActions.spec.js.snap +5 -4
  152. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlCrumbs.spec.js.snap +1 -0
  153. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +0 -3
  154. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHeader.spec.js.snap +16 -11
  155. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHistory.spec.js.snap +2 -0
  156. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlRow.spec.js.snap +2 -1
  157. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlScores.spec.js.snap +3 -0
  158. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlTabs.spec.js.snap +3 -0
  159. package/src/components/qualityControls/__tests__/__snapshots__/QualityControls.spec.js.snap +11 -21
  160. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsTable.spec.js.snap +2 -0
  161. package/src/components/qualityControls/controlProperties/Count.js +5 -5
  162. package/src/components/qualityControls/controlProperties/Ratio.js +6 -8
  163. package/src/components/qualityControls/controlProperties/__tests__/Count.spec.js +6 -11
  164. package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +9 -27
  165. package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +10 -10
  166. package/src/components/qualityControls/qualityByControlMode.js +14 -14
  167. package/src/components/qualityControls/qualityControlScoresColumns.js +1 -2
  168. package/src/components/qualityControls/scoreCriterias/Deviation.js +2 -2
  169. package/src/components/qualityControls/scoreCriterias/ErrorCount.js +3 -4
  170. package/src/components/qualityControls/scoreCriterias/Percentage.js +2 -2
  171. package/src/components/qualityControls/scoreCriterias/__tests__/Deviation.spec.js +0 -1
  172. package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +39 -43
  173. package/src/components/qualityControls/scoreCriterias/__tests__/Percentage.spec.js +23 -19
  174. package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/ErrorCount.spec.js.snap +4 -7
  175. package/src/components/scores/MyScoreGroups.js +0 -1
  176. package/src/components/scores/QualityBar.js +24 -22
  177. package/src/components/scores/Score.js +4 -5
  178. package/src/components/scores/ScoreCrumbs.js +3 -5
  179. package/src/components/scores/ScoreDetails.js +2 -2
  180. package/src/components/scores/ScoreEvents.js +2 -2
  181. package/src/components/scores/ScoreGroup.js +5 -4
  182. package/src/components/scores/ScoreGroupBreadcrumbs.js +1 -2
  183. package/src/components/scores/ScoreGroupForm.js +2 -4
  184. package/src/components/scores/ScoreGroupLink.js +1 -2
  185. package/src/components/scores/ScoreGroupMessage.js +0 -1
  186. package/src/components/scores/ScoreGroupPopup.js +1 -1
  187. package/src/components/scores/ScoreGroupsRoutes.js +19 -0
  188. package/src/components/scores/ScoreGroupsTable.js +15 -48
  189. package/src/components/scores/ScoreRoutes.js +9 -24
  190. package/src/components/scores/ScoreStatusDecorator.js +1 -2
  191. package/src/components/scores/ScoreTabs.js +2 -2
  192. package/src/components/scores/__tests__/MyScoreGroups.spec.js +0 -1
  193. package/src/components/scores/__tests__/QualityBar.spec.js +19 -26
  194. package/src/components/scores/__tests__/Score.spec.js +2 -3
  195. package/src/components/scores/__tests__/ScoreCrumbs.spec.js +4 -5
  196. package/src/components/scores/__tests__/ScoreDetails.spec.js +4 -5
  197. package/src/components/scores/__tests__/ScoreEvents.spec.js +2 -3
  198. package/src/components/scores/__tests__/ScoreGroup.spec.js +15 -14
  199. package/src/components/scores/__tests__/ScoreGroupBreadcrumbs.spec.js +0 -1
  200. package/src/components/scores/__tests__/ScoreGroupForm.spec.js +18 -34
  201. package/src/components/scores/__tests__/ScoreGroupLink.spec.js +0 -1
  202. package/src/components/scores/__tests__/ScoreGroupMessage.spec.js +0 -1
  203. package/src/components/scores/__tests__/ScoreGroupPopup.spec.js +0 -2
  204. package/src/components/scores/__tests__/ScoreGroupsRoutes.spec.js +32 -0
  205. package/src/components/scores/__tests__/ScoreGroupsTable.spec.js +0 -1
  206. package/src/components/scores/__tests__/ScoreStatusDecorator.spec.js +0 -1
  207. package/src/components/scores/__tests__/ScoreTabs.spec.js +3 -4
  208. package/src/components/scores/__tests__/__snapshots__/MyScoreGroups.spec.js.snap +2 -0
  209. package/src/components/scores/__tests__/__snapshots__/Score.spec.js.snap +4 -0
  210. package/src/components/scores/__tests__/__snapshots__/ScoreCrumbs.spec.js.snap +2 -0
  211. package/src/components/scores/__tests__/__snapshots__/ScoreDetails.spec.js.snap +1 -0
  212. package/src/components/scores/__tests__/__snapshots__/ScoreGroup.spec.js.snap +39 -10
  213. package/src/components/scores/__tests__/__snapshots__/ScoreGroupBreadcrumbs.spec.js.snap +1 -0
  214. package/src/components/scores/__tests__/__snapshots__/ScoreGroupForm.spec.js.snap +10 -10
  215. package/src/components/scores/__tests__/__snapshots__/ScoreGroupLink.spec.js.snap +1 -0
  216. package/src/components/scores/__tests__/__snapshots__/ScoreGroupsRoutes.spec.js.snap +19 -0
  217. package/src/components/scores/__tests__/__snapshots__/ScoreGroupsTable.spec.js.snap +2 -0
  218. package/src/components/scores/__tests__/__snapshots__/ScoreStatusDecorator.spec.js.snap +5 -0
  219. package/src/components/scores/__tests__/__snapshots__/ScoreTabs.spec.js.snap +4 -0
  220. package/src/hooks/__tests__/useDataViews.spec.js +1 -1
  221. package/src/hooks/__tests__/useFunctions.spec.js +5 -5
  222. package/src/hooks/useDataViews.js +2 -2
  223. package/src/hooks/useExecutionGroups.js +1 -1
  224. package/src/hooks/useFunctions.js +4 -4
  225. package/src/hooks/useQualityControls.js +13 -7
  226. package/src/hooks/useScoreGroups.js +1 -1
  227. package/src/hooks/useScores.js +2 -2
  228. package/src/styles/scores.less +21 -21
  229. package/src/types.js +1 -4
@@ -1,14 +1,12 @@
1
- import React from "react";
2
- import { render } from "@truedat/test/render";
3
- import { waitFor } from "@testing-library/react";
4
- import { within } from "@testing-library/dom";
5
1
  import userEvent from "@testing-library/user-event";
2
+ import { within } from "@testing-library/dom";
3
+ import { render, waitForLoad } from "@truedat/test/render";
4
+ import { act } from "@testing-library/react";
6
5
  import { singleTemplateMock } from "@truedat/test/mocks";
7
6
  import SearchContext from "@truedat/core/search/SearchContext";
8
7
  import { useScoreGroupCreate } from "@truedat/qx/hooks/useScoreGroups";
9
- import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
10
- import QualityControls from "../QualityControls";
11
8
  import { qualityControlData } from "./__fixtures__/qualityControlHelper";
9
+ import QualityControls from "../QualityControls";
12
10
 
13
11
  jest.mock("@truedat/core/hooks/useAuthorizedAction", () => ({
14
12
  ...jest.requireActual("@truedat/core/hooks/useAuthorizedAction"),
@@ -24,8 +22,6 @@ jest.mock("@truedat/qx/hooks/useScoreGroups", () => ({
24
22
 
25
23
  const renderOpts = {
26
24
  mocks: [singleTemplateMock({ scope: "qxe", domainIds: undefined })],
27
- messages,
28
- fallback: "loading",
29
25
  };
30
26
 
31
27
  const searchProps = {
@@ -43,18 +39,19 @@ const searchProps = {
43
39
  };
44
40
 
45
41
  describe("<QualityControls />", () => {
46
- it("matches the latest snapshot", () => {
47
- const { container } = render(
48
- <SearchContext.Provider value={searchProps}>
42
+ it("matches the latest snapshot", async () => {
43
+ const rendered = render(
44
+ <SearchContext value={searchProps}>
49
45
  <QualityControls />
50
- </SearchContext.Provider>,
46
+ </SearchContext>,
51
47
  renderOpts
52
48
  );
53
-
54
- expect(container).toMatchSnapshot();
49
+ await waitForLoad(rendered);
50
+ expect(rendered.container).toMatchSnapshot();
55
51
  });
56
52
 
57
53
  it("activate/desactivate execution", async () => {
54
+ const user = userEvent.setup({ delay: null });
58
55
  const toggleHiddenFilterValue = jest.fn();
59
56
  const removeHiddenFilter = jest.fn();
60
57
 
@@ -63,53 +60,57 @@ describe("<QualityControls />", () => {
63
60
  toggleHiddenFilterValue,
64
61
  removeHiddenFilter,
65
62
  };
66
- const { container, getByRole } = render(
67
- <SearchContext.Provider value={thisSearchProps}>
63
+ const rendered = render(
64
+ <SearchContext value={thisSearchProps}>
68
65
  <QualityControls />
69
- </SearchContext.Provider>,
66
+ </SearchContext>,
70
67
  renderOpts
71
68
  );
69
+ await waitForLoad(rendered);
72
70
 
73
71
  expect(
74
- getByRole("button", { name: /Execute quality control/i })
72
+ rendered.getByRole("button", { name: /actions.do_execution/i })
75
73
  ).toBeDisabled();
76
74
 
77
- userEvent.click(container.querySelector("#execute_checkbox"));
75
+ await user.click(rendered.container.querySelector("#execute_checkbox"));
78
76
 
79
77
  expect(toggleHiddenFilterValue).toHaveBeenCalledWith({
80
78
  filter: "for_execution",
81
79
  value: true,
82
80
  });
83
81
  expect(
84
- getByRole("button", { name: /Execute quality control/i })
82
+ rendered.getByRole("button", { name: /actions.do_execution/i })
85
83
  ).toBeEnabled();
86
84
 
87
85
  expect(
88
- container.querySelector("#row-checkbox-1").parentElement
86
+ rendered.container.querySelector("#row-checkbox-1").parentElement
89
87
  ).not.toHaveClass("checked");
90
88
 
91
- userEvent.click(container.querySelector("#selectQualityControl"));
89
+ await user.click(rendered.container.querySelector("#selectQualityControl"));
92
90
 
93
91
  expect(
94
- container.querySelector("#row-checkbox-1").parentElement
92
+ rendered.container.querySelector("#row-checkbox-1").parentElement
95
93
  ).toHaveClass("checked");
96
94
 
97
- userEvent.click(container.querySelector("#row-checkbox-1"));
95
+ await user.click(rendered.container.querySelector("#row-checkbox-1"));
98
96
 
99
97
  expect(
100
- container.querySelector("#row-checkbox-1").parentElement
98
+ rendered.container.querySelector("#row-checkbox-1").parentElement
101
99
  ).not.toHaveClass("checked");
102
100
 
103
- userEvent.click(container.querySelector("#execute_checkbox"));
101
+ await user.click(rendered.container.querySelector("#execute_checkbox"));
104
102
 
105
103
  expect(removeHiddenFilter).toHaveBeenCalledWith({
106
104
  filter: "for_execution",
107
105
  });
108
106
 
109
- expect(container.querySelector("#row-checkbox-1")).not.toBeInTheDocument();
107
+ expect(
108
+ rendered.container.querySelector("#row-checkbox-1")
109
+ ).not.toBeInTheDocument();
110
110
  });
111
111
 
112
112
  it("submit execution with search", async () => {
113
+ const user = userEvent.setup({ delay: null });
113
114
  const trigger = jest.fn(() =>
114
115
  Promise.resolve({ data: { data: { id: "9" } } })
115
116
  );
@@ -118,28 +119,32 @@ describe("<QualityControls />", () => {
118
119
  loading: false,
119
120
  }));
120
121
 
121
- const { container, getByRole, queryByText } = render(
122
- <SearchContext.Provider value={searchProps}>
122
+ const rendered = render(
123
+ <SearchContext value={searchProps}>
123
124
  <QualityControls />
124
- </SearchContext.Provider>,
125
+ </SearchContext>,
125
126
  renderOpts
126
127
  );
128
+ await waitForLoad(rendered);
127
129
 
128
- userEvent.click(container.querySelector("#execute_checkbox"));
130
+ await user.click(rendered.container.querySelector("#execute_checkbox"));
129
131
 
130
132
  expect(
131
- getByRole("button", { name: /Execute quality control/i })
133
+ rendered.getByRole("button", { name: /actions.do_execution/i })
132
134
  ).toBeEnabled();
133
135
 
134
- userEvent.click(getByRole("button", { name: /Execute quality control/i }));
136
+ await act(async () => {
137
+ await user.click(
138
+ rendered.getByRole("button", { name: /actions.do_execution/i })
139
+ );
140
+ });
135
141
 
136
- await waitFor(() =>
137
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
138
- );
139
- await waitFor(() => expect(queryByText(/loader/i)).not.toBeInTheDocument());
142
+ await waitForLoad(rendered);
140
143
 
141
- const modal = queryByText(/Quality controls execution/i).parentElement;
142
- userEvent.click(within(modal).getByRole("button", { name: /Create/i }));
144
+ const modal = rendered.getByText(
145
+ /execution.confirmation.header/i
146
+ ).parentElement;
147
+ await user.click(within(modal).getByRole("button", { name: /create/i }));
143
148
 
144
149
  expect(trigger).toHaveBeenCalledWith({
145
150
  score_group: {
@@ -153,6 +158,8 @@ describe("<QualityControls />", () => {
153
158
  });
154
159
 
155
160
  it("submit execution with select", async () => {
161
+ const user = userEvent.setup({ delay: null });
162
+
156
163
  const trigger = jest.fn(() =>
157
164
  Promise.resolve({ data: { data: { id: "9" } } })
158
165
  );
@@ -161,34 +168,43 @@ describe("<QualityControls />", () => {
161
168
  loading: false,
162
169
  }));
163
170
 
164
- const { container, getByRole, queryByText } = render(
165
- <SearchContext.Provider value={searchProps}>
171
+ const rendered = render(
172
+ <SearchContext value={searchProps}>
166
173
  <QualityControls />
167
- </SearchContext.Provider>,
174
+ </SearchContext>,
168
175
  renderOpts
169
176
  );
177
+ await waitForLoad(rendered);
170
178
 
171
- userEvent.click(container.querySelector("#execute_checkbox"));
179
+ await user.click(rendered.container.querySelector("#execute_checkbox"));
172
180
 
173
181
  expect(
174
- getByRole("button", { name: /Execute quality control/i })
182
+ rendered.getByRole("button", { name: /actions.do_execution/i })
175
183
  ).toBeEnabled();
176
184
 
177
- userEvent.click(container.querySelector("#selectQualityControl"));
185
+ await user.click(rendered.container.querySelector("#selectQualityControl"));
178
186
 
179
187
  expect(
180
- container.querySelector("#row-checkbox-1").parentElement
188
+ rendered.container.querySelector("#row-checkbox-1").parentElement
181
189
  ).toHaveClass("checked");
182
190
 
183
- userEvent.click(getByRole("button", { name: /Execute quality control/i }));
191
+ await act(async () => {
192
+ await user.click(
193
+ rendered.getByRole("button", { name: /actions.do_execution/i })
194
+ );
195
+ });
196
+
197
+ await waitForLoad(rendered);
184
198
 
185
- await waitFor(() =>
186
- expect(queryByText(/loading/i)).not.toBeInTheDocument()
187
- );
188
- await waitFor(() => expect(queryByText(/loader/i)).not.toBeInTheDocument());
199
+ const modal = rendered.getByText(
200
+ /execution.confirmation.header/i
201
+ ).parentElement;
189
202
 
190
- const modal = queryByText(/Quality controls execution/i).parentElement;
191
- userEvent.click(within(modal).getByRole("button", { name: /Create/i }));
203
+ await user.click(
204
+ within(modal).getByRole("button", {
205
+ name: "actions.create",
206
+ })
207
+ );
192
208
 
193
209
  expect(trigger).toHaveBeenCalledWith({
194
210
  score_group: {
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { render } from "@truedat/test/render";
3
2
  import { SearchContextProvider } from "@truedat/core/search/SearchContext";
4
3
  import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { render } from "@truedat/test/render";
3
2
  import { SearchContextProvider } from "@truedat/core/search/SearchContext";
4
3
  import QualityControlsPagination from "../QualityControlsPagination";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { render } from "@truedat/test/render";
3
2
  import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
4
3
  import SearchContext from "@truedat/core/search/SearchContext";
@@ -30,9 +29,9 @@ const props = {
30
29
  describe("<QualityControlsTable />", () => {
31
30
  it("matches the latest snapshot", () => {
32
31
  const { container } = render(
33
- <SearchContext.Provider value={searchProps}>
32
+ <SearchContext value={searchProps}>
34
33
  <QualityControlsTable {...props} />
35
- </SearchContext.Provider>,
34
+ </SearchContext>,
36
35
  renderOpts
37
36
  );
38
37
 
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { render } from "@truedat/test/render";
3
2
  import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
4
3
  import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { render } from "@truedat/test/render";
3
2
  import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
4
3
  import ScoreCriteriaView from "../ScoreCriteriaView";
@@ -20,7 +20,7 @@ export const domains = [
20
20
 
21
21
  const qualityControl = {
22
22
  active: true,
23
- id: 8,
23
+ id: "8",
24
24
  name: "test",
25
25
  updated_at: "2024-11-28T12:14:57.004822Z",
26
26
  status: "draft",
@@ -4,7 +4,6 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <div
6
6
  class="ui left floated segment"
7
- style=""
8
7
  >
9
8
  <div
10
9
  class="ui text container"
@@ -19,11 +18,11 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
19
18
  <div
20
19
  class="content"
21
20
  >
22
- Quality control
21
+ quality_controls.new.header
23
22
  <div
24
23
  class="sub header"
25
24
  >
26
- Edit quality control
25
+ quality_controls.edit.subheader
27
26
  </div>
28
27
  </div>
29
28
  </h2>
@@ -44,10 +43,9 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
44
43
  readonly=""
45
44
  tabindex="-1"
46
45
  type="radio"
47
- value=""
48
46
  />
49
47
  <label>
50
- Enable
48
+ quality_control.form.active
51
49
  </label>
52
50
  </div>
53
51
  </div>
@@ -57,7 +55,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
57
55
  <label
58
56
  class="field-label"
59
57
  >
60
- Domains
58
+ quality_control.form.domain_ids
61
59
  <span>
62
60
  *
63
61
  </span>
@@ -127,7 +125,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
127
125
  <label
128
126
  class="field-label"
129
127
  >
130
- Name
128
+ quality_control.form.name
131
129
  <span>
132
130
  *
133
131
  </span>
@@ -140,7 +138,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
140
138
  >
141
139
  <input
142
140
  autocomplete="off"
143
- placeholder="Name"
141
+ placeholder="dataViews.form.name"
144
142
  type="text"
145
143
  value="test"
146
144
  />
@@ -182,7 +180,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
182
180
  class="required field"
183
181
  >
184
182
  <label>
185
- Source
183
+ dataViews.form.source
186
184
  </label>
187
185
  <div
188
186
  class="disabled field"
@@ -208,7 +206,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
208
206
  class="divider text"
209
207
  role="alert"
210
208
  >
211
- Select source
209
+ source.search.placeholder
212
210
  </div>
213
211
  <i
214
212
  aria-hidden="true"
@@ -239,7 +237,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
239
237
  class="required field"
240
238
  >
241
239
  <label>
242
- Control mode
240
+ quality_control.control_mode
243
241
  </label>
244
242
  <div
245
243
  aria-expanded="false"
@@ -253,7 +251,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
253
251
  class="divider text"
254
252
  role="alert"
255
253
  >
256
- Percentage
254
+ quality_control.control_mode.percentage
257
255
  </div>
258
256
  <i
259
257
  aria-hidden="true"
@@ -272,7 +270,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
272
270
  <span
273
271
  class="text"
274
272
  >
275
- Percentage
273
+ quality_control.control_mode.percentage
276
274
  </span>
277
275
  </div>
278
276
  <div
@@ -285,7 +283,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
285
283
  <span
286
284
  class="text"
287
285
  >
288
- Deviation
286
+ quality_control.control_mode.deviation
289
287
  </span>
290
288
  </div>
291
289
  <div
@@ -311,7 +309,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
311
309
  <span
312
310
  class="text"
313
311
  >
314
- count
312
+ quality_control.control_mode.count
315
313
  </span>
316
314
  </div>
317
315
  </div>
@@ -326,7 +324,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
326
324
  <label
327
325
  class="field-label"
328
326
  >
329
- Threshold
327
+ quality_control.score_criteria.percentage.minimum
330
328
  <span>
331
329
  *
332
330
  </span>
@@ -339,7 +337,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
339
337
  >
340
338
  <input
341
339
  autocomplete="off"
342
- placeholder="Threshold"
340
+ placeholder="quality_control.score_criteria.percentage.minimum"
343
341
  type="text"
344
342
  value="10"
345
343
  />
@@ -352,7 +350,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
352
350
  <label
353
351
  class="field-label"
354
352
  >
355
- Goal
353
+ quality_control.score_criteria.percentage.goal
356
354
  <span>
357
355
  *
358
356
  </span>
@@ -365,7 +363,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
365
363
  >
366
364
  <input
367
365
  autocomplete="off"
368
- placeholder="Goal"
366
+ placeholder="quality_control.score_criteria.percentage.goal"
369
367
  type="text"
370
368
  value="20"
371
369
  />
@@ -380,7 +378,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
380
378
  class="required field"
381
379
  >
382
380
  <label>
383
- Dataset
381
+ quality_control.form.control_properties.ratio.resource
384
382
  </label>
385
383
  <div
386
384
  aria-expanded="false"
@@ -394,7 +392,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
394
392
  class="divider text"
395
393
  role="alert"
396
394
  >
397
- Data structures
395
+ queryables.resource.type.data_structure
398
396
  </div>
399
397
  <i
400
398
  aria-hidden="true"
@@ -413,7 +411,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
413
411
  <span
414
412
  class="text"
415
413
  >
416
- Data structures
414
+ queryables.resource.type.data_structure
417
415
  </span>
418
416
  </div>
419
417
  <div
@@ -426,7 +424,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
426
424
  <span
427
425
  class="text"
428
426
  >
429
- Reference datasets
427
+ queryables.resource.type.reference_dataset
430
428
  </span>
431
429
  </div>
432
430
  </div>
@@ -440,7 +438,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
440
438
  >
441
439
  <input
442
440
  class="action-pointer"
443
- placeholder="Data Structure"
441
+ placeholder="queryables.resource.selector.data_structure"
444
442
  required=""
445
443
  type="text"
446
444
  value="ACCOUNTING_RULES"
@@ -454,7 +452,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
454
452
  class="field"
455
453
  >
456
454
  <label>
457
- Validation
455
+ quality_control.form.control_properties.ratio.validation
458
456
  </label>
459
457
  <div>
460
458
  <div
@@ -507,7 +505,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
507
505
  </code>
508
506
  </b>
509
507
  </small>
510
- Constant
508
+ functions.expression.shape.constant
511
509
  </div>
512
510
  </div>
513
511
  <div
@@ -529,7 +527,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
529
527
  </code>
530
528
  </b>
531
529
  </small>
532
- Function
530
+ functions.expression.shape.function
533
531
  </div>
534
532
  </div>
535
533
  </div>
@@ -566,7 +564,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
566
564
  class="divider text"
567
565
  role="alert"
568
566
  >
569
- Select a function of type boolean
567
+ functions.form.expression.function.placeholder
570
568
  </div>
571
569
  <i
572
570
  aria-hidden="true"
@@ -606,7 +604,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
606
604
  <button
607
605
  class="ui mini button"
608
606
  >
609
- Add expression
607
+ expression.clause.action.addExpression
610
608
  </button>
611
609
  </div>
612
610
  </div>
@@ -620,7 +618,7 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
620
618
  <button
621
619
  class="ui mini button"
622
620
  >
623
- Add group
621
+ expression.clause.action.addGroup
624
622
  </button>
625
623
  </div>
626
624
  </div>
@@ -637,12 +635,12 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
637
635
  disabled=""
638
636
  tabindex="-1"
639
637
  >
640
- Save
638
+ actions.save
641
639
  </button>
642
640
  <button
643
641
  class="ui button"
644
642
  >
645
- Cancel
643
+ actions.cancel
646
644
  </button>
647
645
  </div>
648
646
  </form>
@@ -669,11 +667,11 @@ exports[`<EditQualityControl /> matches the latest snapshot with empty qualityCo
669
667
  <div
670
668
  class="content"
671
669
  >
672
- Quality control
670
+ quality_controls.new.header
673
671
  <div
674
672
  class="sub header"
675
673
  >
676
- Edit quality control
674
+ quality_controls.edit.subheader
677
675
  </div>
678
676
  </div>
679
677
  </h2>