@truedat/qx 7.5.7 → 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.
- package/package.json +45 -64
- package/src/components/QxRoutes.js +38 -19
- package/src/components/__tests__/QxRoutes.spec.js +73 -0
- package/src/components/__tests__/__fixtures__/helper.js +6 -7
- package/src/components/__tests__/__snapshots__/QxRoutes.spec.js.snap +60 -0
- package/src/components/common/ClauseViewer.js +6 -6
- package/src/components/common/DescriptionInput.js +0 -1
- package/src/components/common/ResourceSelector.js +2 -3
- package/src/components/common/TestFormWrapper.js +2 -13
- package/src/components/common/TypeSelector.js +0 -1
- package/src/components/common/__tests__/DescriptionInput.spec.js +12 -21
- package/src/components/common/__tests__/ResourceSelector.spec.js +42 -87
- package/src/components/common/__tests__/TypeSelector.spec.js +0 -1
- package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +32 -22
- package/src/components/common/expressions/Clauses.js +5 -6
- package/src/components/common/expressions/Condition.js +8 -9
- package/src/components/common/expressions/ConstantSelector.js +2 -2
- package/src/components/common/expressions/Expression.js +2 -2
- package/src/components/common/expressions/FieldSelector.js +2 -2
- package/src/components/common/expressions/FunctionArgs.js +5 -6
- package/src/components/common/expressions/FunctionSelector.js +2 -2
- package/src/components/common/expressions/ParamSelector.js +2 -2
- package/src/components/common/expressions/ShapeSelector.js +7 -16
- package/src/components/common/expressions/__tests__/Clauses.spec.js +10 -9
- package/src/components/common/expressions/__tests__/Condition.spec.js +6 -26
- package/src/components/common/expressions/__tests__/ConstantSelector.spec.js +14 -30
- package/src/components/common/expressions/__tests__/Expression.spec.js +36 -62
- package/src/components/common/expressions/__tests__/FieldSelector.spec.js +2 -7
- package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +18 -44
- package/src/components/common/expressions/__tests__/FunctionSelector.spec.js +19 -27
- package/src/components/common/expressions/__tests__/ParamSelector.spec.js +28 -58
- package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +34 -47
- package/src/components/common/expressions/__tests__/__snapshots__/Condition.spec.js.snap +6 -6
- package/src/components/common/expressions/__tests__/__snapshots__/ConstantSelector.spec.js.snap +6 -7
- package/src/components/common/expressions/__tests__/__snapshots__/Expression.spec.js.snap +20 -20
- package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +8 -9
- package/src/components/common/expressions/__tests__/__snapshots__/FunctionSelector.spec.js.snap +670 -8
- package/src/components/common/expressions/__tests__/__snapshots__/ParamSelector.spec.js.snap +5 -5
- package/src/components/common/expressions/__tests__/__snapshots__/ShapeSelector.spec.js.snap +9 -9
- package/src/components/common/expressions/__tests__/useWatchParams.spec.js +1 -4
- package/src/components/common/expressions/constantInputs/AnySelector.js +5 -6
- package/src/components/common/expressions/constantInputs/BooleanSelector.js +2 -2
- package/src/components/common/expressions/constantInputs/DefaultSelector.js +2 -2
- package/src/components/common/expressions/constantInputs/__tests__/AnySelector.spec.js +16 -37
- package/src/components/common/expressions/constantInputs/__tests__/BooleanSelector.spec.js +14 -17
- package/src/components/common/expressions/constantInputs/__tests__/DefaultSelector.spec.js +12 -27
- package/src/components/common/expressions/constantInputs/__tests__/__snapshots__/AnySelector.spec.js.snap +11 -11
- package/src/components/common/expressions/constantInputs/__tests__/__snapshots__/DefaultSelector.spec.js.snap +0 -1
- package/src/components/common/resourceSelectors/DataStructureSelector.js +2 -2
- package/src/components/common/resourceSelectors/DataViewSelector.js +2 -2
- package/src/components/common/resourceSelectors/ReferenceDatasetSelector.js +2 -2
- package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +5 -29
- package/src/components/common/resourceSelectors/__tests__/DataViewSelector.spec.js +23 -25
- package/src/components/common/resourceSelectors/__tests__/ReferenceDatasetSelector.spec.js +21 -32
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +3 -4
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataViewSelector.spec.js.snap +1 -1
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/ReferenceDatasetSelector.spec.js.snap +1 -1
- package/src/components/dataViews/DataViewEditor.js +5 -6
- package/src/components/dataViews/DataViewSelect.js +4 -5
- package/src/components/dataViews/DataViews.js +1 -2
- package/src/components/dataViews/Queryable.js +4 -4
- package/src/components/dataViews/Queryables.js +0 -1
- package/src/components/dataViews/__tests__/DataViewEditor.spec.js +36 -111
- package/src/components/dataViews/__tests__/DataViewSelect.spec.js +0 -1
- package/src/components/dataViews/__tests__/DataViews.spec.js +15 -16
- package/src/components/dataViews/__tests__/Queryable.spec.js +0 -1
- package/src/components/dataViews/__tests__/Queryables.spec.js +35 -74
- package/src/components/dataViews/__tests__/__snapshots__/DataViewEditor.spec.js.snap +61 -55
- package/src/components/dataViews/__tests__/__snapshots__/DataViews.spec.js.snap +5 -5
- package/src/components/dataViews/__tests__/__snapshots__/Queryables.spec.js.snap +59 -59
- package/src/components/dataViews/queryableProperties/From.js +4 -4
- package/src/components/dataViews/queryableProperties/GroupBy.js +6 -6
- package/src/components/dataViews/queryableProperties/Join.js +6 -6
- package/src/components/dataViews/queryableProperties/JoinTypeIcon.js +8 -9
- package/src/components/dataViews/queryableProperties/Select.js +4 -5
- package/src/components/dataViews/queryableProperties/SelectField.js +4 -4
- package/src/components/dataViews/queryableProperties/Where.js +4 -4
- package/src/components/dataViews/queryableProperties/__tests__/From.spec.js +0 -1
- package/src/components/dataViews/queryableProperties/__tests__/GroupBy.spec.js +16 -42
- package/src/components/dataViews/queryableProperties/__tests__/Join.spec.js +6 -29
- package/src/components/dataViews/queryableProperties/__tests__/JoinTypeIcon.spec.js +0 -1
- package/src/components/dataViews/queryableProperties/__tests__/Select.spec.js +26 -50
- package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +19 -44
- package/src/components/dataViews/queryableProperties/__tests__/Where.spec.js +6 -17
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/GroupBy.spec.js.snap +309 -9
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Join.spec.js.snap +12 -12
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Select.spec.js.snap +192 -18
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/SelectField.spec.js.snap +6 -8
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Where.spec.js.snap +2 -2
- package/src/components/functions/FunctionEditor.js +3 -5
- package/src/components/functions/FunctionParams.js +2 -3
- package/src/components/functions/Functions.js +3 -4
- package/src/components/functions/__tests__/FunctionEditor.spec.js +61 -57
- package/src/components/functions/__tests__/FunctionParams.spec.js +50 -47
- package/src/components/functions/__tests__/Functions.spec.js +5 -12
- package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +11 -11
- package/src/components/functions/__tests__/__snapshots__/Functions.spec.js.snap +4 -5
- package/src/components/qualityControls/ControlProperties.js +8 -7
- package/src/components/qualityControls/ControlPropertiesView.js +5 -5
- package/src/components/qualityControls/EditQualityControl.js +5 -5
- package/src/components/qualityControls/IconPopup.js +0 -1
- package/src/components/qualityControls/NewDraftQualityControl.js +8 -6
- package/src/components/qualityControls/NewQualityControl.js +5 -6
- package/src/components/qualityControls/QualityBadge.js +29 -21
- package/src/components/qualityControls/QualityControl.js +4 -7
- package/src/components/qualityControls/QualityControlActions.js +7 -7
- package/src/components/qualityControls/QualityControlCrumbs.js +1 -3
- package/src/components/qualityControls/QualityControlEditor.js +6 -12
- package/src/components/qualityControls/QualityControlHeader.js +4 -6
- package/src/components/qualityControls/QualityControlHistory.js +3 -3
- package/src/components/qualityControls/QualityControlManageDomain.js +2 -2
- package/src/components/qualityControls/QualityControlQueryModal.js +1 -1
- package/src/components/qualityControls/QualityControlRoutes.js +27 -54
- package/src/components/qualityControls/QualityControlRow.js +0 -2
- package/src/components/qualityControls/QualityControlScores.js +7 -5
- package/src/components/qualityControls/QualityControlTabs.js +2 -2
- package/src/components/qualityControls/QualityControls.js +10 -8
- package/src/components/qualityControls/QualityControlsLabelResults.js +0 -2
- package/src/components/qualityControls/QualityControlsPagination.js +0 -1
- package/src/components/qualityControls/QualityControlsTable.js +1 -2
- package/src/components/qualityControls/ScoreCriteria.js +8 -4
- package/src/components/qualityControls/ScoreCriteriaView.js +34 -54
- package/src/components/qualityControls/__tests__/ControlProperties.spec.js +16 -21
- package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +5 -6
- package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +28 -70
- package/src/components/qualityControls/__tests__/IconPopup.spec.js +10 -11
- package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +33 -70
- package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +88 -107
- package/src/components/qualityControls/__tests__/QualityBadge.spec.js +55 -63
- package/src/components/qualityControls/__tests__/QualityControl.spec.js +19 -31
- package/src/components/qualityControls/__tests__/QualityControlActions.spec.js +49 -46
- package/src/components/qualityControls/__tests__/QualityControlCrumbs.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +68 -107
- package/src/components/qualityControls/__tests__/QualityControlHeader.spec.js +22 -25
- package/src/components/qualityControls/__tests__/QualityControlHistory.spec.js +6 -6
- package/src/components/qualityControls/__tests__/QualityControlManageDomain.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +13 -12
- package/src/components/qualityControls/__tests__/QualityControlRow.spec.js +4 -8
- package/src/components/qualityControls/__tests__/QualityControlScores.spec.js +23 -19
- package/src/components/qualityControls/__tests__/QualityControlTabs.spec.js +2 -3
- package/src/components/qualityControls/__tests__/QualityControls.spec.js +69 -53
- package/src/components/qualityControls/__tests__/QualityControlsLabelResults.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlsPagination.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlsTable.spec.js +2 -3
- package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +3 -4
- package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +18 -3
- package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +2 -2
- package/src/components/qualityControls/__tests__/__snapshots__/ControlProperties.spec.js.snap +1 -1
- package/src/components/qualityControls/__tests__/__snapshots__/ControlPropertiesView.spec.js.snap +53 -53
- package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +45 -34
- package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +44 -33
- package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +30 -19
- package/src/components/qualityControls/__tests__/__snapshots__/QualityBadge.spec.js.snap +1 -1
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +11 -19
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlActions.spec.js.snap +5 -4
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlCrumbs.spec.js.snap +1 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +28 -5
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHeader.spec.js.snap +16 -11
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHistory.spec.js.snap +2 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlRow.spec.js.snap +2 -1
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlScores.spec.js.snap +3 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlTabs.spec.js.snap +3 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControls.spec.js.snap +11 -21
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsTable.spec.js.snap +2 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteria.spec.js.snap +1 -1
- package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteriaView.spec.js.snap +2 -4
- package/src/components/qualityControls/__tests__/qualityByControlMode.spec.js +16 -16
- package/src/components/qualityControls/controlProperties/{ErrorCount.js → Count.js} +7 -7
- package/src/components/qualityControls/controlProperties/Ratio.js +6 -8
- package/src/components/qualityControls/controlProperties/__tests__/{ErrorCount.spec.js → Count.spec.js} +9 -25
- package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +9 -27
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/{ErrorCount.spec.js.snap → Count.spec.js.snap} +5 -5
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +10 -10
- package/src/components/qualityControls/qualityByControlMode.js +39 -16
- package/src/components/qualityControls/qualityControlScoresColumns.js +1 -2
- package/src/components/qualityControls/scoreCriterias/Count.js +88 -0
- package/src/components/qualityControls/scoreCriterias/Deviation.js +2 -2
- package/src/components/qualityControls/scoreCriterias/ErrorCount.js +4 -4
- package/src/components/qualityControls/scoreCriterias/Percentage.js +2 -2
- package/src/components/qualityControls/scoreCriterias/__tests__/Count.spec.js +62 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/Deviation.spec.js +0 -1
- package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +39 -31
- package/src/components/qualityControls/scoreCriterias/__tests__/Percentage.spec.js +23 -19
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Count.spec.js.snap +58 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/ErrorCount.spec.js.snap +4 -7
- package/src/components/scores/MyScoreGroups.js +0 -1
- package/src/components/scores/QualityBar.js +24 -22
- package/src/components/scores/Score.js +4 -5
- package/src/components/scores/ScoreCrumbs.js +3 -5
- package/src/components/scores/ScoreDetails.js +2 -2
- package/src/components/scores/ScoreEvents.js +2 -2
- package/src/components/scores/ScoreGroup.js +5 -4
- package/src/components/scores/ScoreGroupBreadcrumbs.js +1 -2
- package/src/components/scores/ScoreGroupForm.js +2 -4
- package/src/components/scores/ScoreGroupLink.js +1 -2
- package/src/components/scores/ScoreGroupMessage.js +0 -1
- package/src/components/scores/ScoreGroupPopup.js +1 -1
- package/src/components/scores/ScoreGroupsRoutes.js +19 -0
- package/src/components/scores/ScoreGroupsTable.js +15 -48
- package/src/components/scores/ScoreRoutes.js +9 -24
- package/src/components/scores/ScoreStatusDecorator.js +1 -2
- package/src/components/scores/ScoreTabs.js +2 -2
- package/src/components/scores/__tests__/MyScoreGroups.spec.js +2 -3
- package/src/components/scores/__tests__/QualityBar.spec.js +19 -26
- package/src/components/scores/__tests__/Score.spec.js +2 -3
- package/src/components/scores/__tests__/ScoreCrumbs.spec.js +4 -5
- package/src/components/scores/__tests__/ScoreDetails.spec.js +4 -5
- package/src/components/scores/__tests__/ScoreEvents.spec.js +2 -3
- package/src/components/scores/__tests__/ScoreGroup.spec.js +15 -14
- package/src/components/scores/__tests__/ScoreGroupBreadcrumbs.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreGroupForm.spec.js +18 -34
- package/src/components/scores/__tests__/ScoreGroupLink.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreGroupMessage.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreGroupPopup.spec.js +0 -2
- package/src/components/scores/__tests__/ScoreGroupsRoutes.spec.js +32 -0
- package/src/components/scores/__tests__/ScoreGroupsTable.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreStatusDecorator.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreTabs.spec.js +3 -4
- package/src/components/scores/__tests__/__snapshots__/MyScoreGroups.spec.js.snap +2 -0
- package/src/components/scores/__tests__/__snapshots__/Score.spec.js.snap +4 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreCrumbs.spec.js.snap +2 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreDetails.spec.js.snap +1 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroup.spec.js.snap +39 -10
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupBreadcrumbs.spec.js.snap +1 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupForm.spec.js.snap +10 -10
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupLink.spec.js.snap +1 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupsRoutes.spec.js.snap +19 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupsTable.spec.js.snap +2 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreStatusDecorator.spec.js.snap +5 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreTabs.spec.js.snap +4 -0
- package/src/hooks/__tests__/useDataViews.spec.js +1 -1
- package/src/hooks/__tests__/useFunctions.spec.js +5 -5
- package/src/hooks/useDataViews.js +2 -2
- package/src/hooks/useExecutionGroups.js +1 -1
- package/src/hooks/useFunctions.js +4 -4
- package/src/hooks/useQualityControls.js +13 -7
- package/src/hooks/useScoreGroups.js +1 -1
- package/src/hooks/useScores.js +2 -2
- package/src/styles/scores.less +21 -21
- package/src/types.js +1 -4
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
2
|
+
import { templateByNameMock } from "@truedat/test/mocks";
|
|
4
3
|
import { useScoreGroupShow } from "@truedat/qx/hooks/useScoreGroups";
|
|
5
4
|
import ScoreGroup from "../ScoreGroup";
|
|
6
5
|
|
|
7
|
-
jest.mock("react-router
|
|
8
|
-
...jest.requireActual("react-router
|
|
6
|
+
jest.mock("react-router", () => ({
|
|
7
|
+
...jest.requireActual("react-router"),
|
|
9
8
|
useParams: () => ({ id: "8", version: "1" }),
|
|
10
9
|
}));
|
|
11
10
|
|
|
@@ -22,22 +21,24 @@ jest.mock("@truedat/qx/hooks/useScoreGroups", () => {
|
|
|
22
21
|
};
|
|
23
22
|
});
|
|
24
23
|
|
|
25
|
-
const renderOpts = {
|
|
24
|
+
const renderOpts = {
|
|
25
|
+
mocks: [templateByNameMock({ name: "Quality Execution" })],
|
|
26
|
+
};
|
|
26
27
|
|
|
27
28
|
describe("<ScoreGroup />", () => {
|
|
28
|
-
it("matches the latest snapshot", () => {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
expect(container).toMatchSnapshot();
|
|
29
|
+
it("matches the latest snapshot", async () => {
|
|
30
|
+
const rendered = render(<ScoreGroup />, renderOpts);
|
|
31
|
+
await waitForLoad(rendered);
|
|
32
|
+
expect(rendered.container).toMatchSnapshot();
|
|
32
33
|
});
|
|
33
34
|
|
|
34
|
-
it("matches the latest snapshot when scoreGroup is empty", () => {
|
|
35
|
+
it("matches the latest snapshot when scoreGroup is empty", async () => {
|
|
35
36
|
useScoreGroupShow.mockImplementation(() => ({
|
|
36
37
|
data: { data: [] },
|
|
37
38
|
loading: false,
|
|
38
39
|
}));
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
expect(container).toMatchSnapshot();
|
|
40
|
+
const rendered = render(<ScoreGroup />, renderOpts);
|
|
41
|
+
await waitForLoad(rendered);
|
|
42
|
+
expect(rendered.container).toMatchSnapshot();
|
|
42
43
|
});
|
|
43
44
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
3
|
-
import { waitFor } from "@testing-library/react";
|
|
4
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
3
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
4
|
import { singleTemplateMock } from "@truedat/test/mocks";
|
|
6
|
-
import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
|
|
7
5
|
import ScoreGroupForm from "../ScoreGroupForm";
|
|
8
6
|
|
|
9
7
|
const renderOpts = {
|
|
@@ -13,8 +11,6 @@ const renderOpts = {
|
|
|
13
11
|
domainIds: undefined,
|
|
14
12
|
}),
|
|
15
13
|
],
|
|
16
|
-
messages,
|
|
17
|
-
fallback: "lazy",
|
|
18
14
|
};
|
|
19
15
|
|
|
20
16
|
const props = {
|
|
@@ -22,46 +18,34 @@ const props = {
|
|
|
22
18
|
onSubmit: jest.fn(),
|
|
23
19
|
onCancel: jest.fn(),
|
|
24
20
|
};
|
|
21
|
+
|
|
25
22
|
describe("<ScoreGroupForm />", () => {
|
|
26
23
|
it("matches the latest snapshot", async () => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
await waitFor(() => {
|
|
33
|
-
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
34
|
-
expect(container.querySelector(".loading")).not.toBeInTheDocument();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
expect(container).toMatchSnapshot();
|
|
24
|
+
const rendered = render(<ScoreGroupForm {...props} />, renderOpts);
|
|
25
|
+
await waitForLoad(rendered);
|
|
26
|
+
expect(rendered.container).toMatchSnapshot();
|
|
38
27
|
});
|
|
28
|
+
|
|
39
29
|
it("matches the latest snapshot for count 1", async () => {
|
|
40
|
-
const
|
|
30
|
+
const rendered = render(
|
|
41
31
|
<ScoreGroupForm {...props} count={1} />,
|
|
42
32
|
renderOpts
|
|
43
33
|
);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
47
|
-
expect(container.querySelector(".loading")).not.toBeInTheDocument();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
expect(container).toMatchSnapshot();
|
|
34
|
+
await waitForLoad(rendered);
|
|
35
|
+
expect(rendered.container).toMatchSnapshot();
|
|
51
36
|
});
|
|
52
37
|
|
|
53
38
|
it("writes to form, submit and confirm", async () => {
|
|
39
|
+
const user = userEvent.setup({ delay: null });
|
|
54
40
|
const onSubmit = jest.fn();
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
expect(container.querySelector(".loading")).not.toBeInTheDocument();
|
|
61
|
-
});
|
|
41
|
+
const rendered = render(
|
|
42
|
+
<ScoreGroupForm {...props} onSubmit={onSubmit} />,
|
|
43
|
+
renderOpts
|
|
44
|
+
);
|
|
45
|
+
await waitForLoad(rendered);
|
|
62
46
|
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
await user.type(await rendered.findByPlaceholderText(/field1/i), "foo");
|
|
48
|
+
await user.click(await rendered.findByText(/create/i));
|
|
65
49
|
|
|
66
50
|
await waitFor(() =>
|
|
67
51
|
expect(onSubmit).toHaveBeenCalledWith({
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { render } from "@truedat/test/render";
|
|
3
2
|
import { waitFor } from "@testing-library/react";
|
|
4
3
|
import userEvent from "@testing-library/user-event";
|
|
@@ -9,7 +8,6 @@ import ScoreGroupPopup from "../ScoreGroupPopup";
|
|
|
9
8
|
const renderOpts = {
|
|
10
9
|
mocks: [singleTemplateMock({ scope: "qxe" })],
|
|
11
10
|
messages,
|
|
12
|
-
fallback: "lazy",
|
|
13
11
|
};
|
|
14
12
|
|
|
15
13
|
describe("<ScoreGroupPopup />", () => {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
|
+
import ScoreGroupsRoutes from "../ScoreGroupsRoutes";
|
|
4
|
+
import { MY_SCORE_GROUPS, SCORE_GROUP } from "@truedat/core/routes";
|
|
5
|
+
|
|
6
|
+
// Mock child components
|
|
7
|
+
jest.mock("../MyScoreGroups", () => () => <div>MyScoreGroups</div>);
|
|
8
|
+
jest.mock("../ScoreGroup", () => () => <div>ScoreGroup</div>);
|
|
9
|
+
|
|
10
|
+
describe("<ScoreGroupsRoutes />", () => {
|
|
11
|
+
it("renders correctly with default route", async () => {
|
|
12
|
+
const rendered = render(<ScoreGroupsRoutes />);
|
|
13
|
+
await waitForLoad(rendered);
|
|
14
|
+
expect(rendered.container).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("renders correctly with my score groups route", async () => {
|
|
18
|
+
const rendered = render(<ScoreGroupsRoutes />, {
|
|
19
|
+
routes: [MY_SCORE_GROUPS],
|
|
20
|
+
});
|
|
21
|
+
await waitForLoad(rendered);
|
|
22
|
+
expect(rendered.container).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("renders correctly with score group detail route", async () => {
|
|
26
|
+
const rendered = render(<ScoreGroupsRoutes />, {
|
|
27
|
+
routes: [SCORE_GROUP.replace(":id", "123")],
|
|
28
|
+
});
|
|
29
|
+
await waitForLoad(rendered);
|
|
30
|
+
expect(rendered.container).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -1,10 +1,9 @@
|
|
|
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 ScoreTabs from "../ScoreTabs";
|
|
5
4
|
|
|
6
|
-
jest.mock("react-router
|
|
7
|
-
...jest.requireActual("react-router
|
|
5
|
+
jest.mock("react-router", () => ({
|
|
6
|
+
...jest.requireActual("react-router"),
|
|
8
7
|
useParams: () => ({ id: "15" }),
|
|
9
8
|
useLocation: () => ({ pathname: "/scores/15" }),
|
|
10
9
|
}));
|
|
@@ -18,7 +17,7 @@ describe("<ScoreTabs />", () => {
|
|
|
18
17
|
});
|
|
19
18
|
|
|
20
19
|
it("matches the latest snapshot for events", () => {
|
|
21
|
-
jest.spyOn(require("react-router
|
|
20
|
+
jest.spyOn(require("react-router"), "useLocation").mockReturnValue({
|
|
22
21
|
pathname: "/scores/15/events",
|
|
23
22
|
});
|
|
24
23
|
const { container } = render(<ScoreTabs />, renderOpts);
|
|
@@ -134,6 +134,7 @@ exports[`<MyScoreGroups /> matches the latest snapshot 1`] = `
|
|
|
134
134
|
class=""
|
|
135
135
|
>
|
|
136
136
|
<a
|
|
137
|
+
data-discover="true"
|
|
137
138
|
href="/scoreGroups/36"
|
|
138
139
|
>
|
|
139
140
|
<time
|
|
@@ -181,6 +182,7 @@ exports[`<MyScoreGroups /> matches the latest snapshot 1`] = `
|
|
|
181
182
|
class=""
|
|
182
183
|
>
|
|
183
184
|
<a
|
|
185
|
+
data-discover="true"
|
|
184
186
|
href="/scoreGroups/36"
|
|
185
187
|
>
|
|
186
188
|
<time
|
|
@@ -7,6 +7,7 @@ exports[`<Score /> matches the latest snapshot 1`] = `
|
|
|
7
7
|
>
|
|
8
8
|
<a
|
|
9
9
|
class="section"
|
|
10
|
+
data-discover="true"
|
|
10
11
|
href="/qualityControls"
|
|
11
12
|
>
|
|
12
13
|
Quality Controls
|
|
@@ -17,6 +18,7 @@ exports[`<Score /> matches the latest snapshot 1`] = `
|
|
|
17
18
|
/>
|
|
18
19
|
<a
|
|
19
20
|
class="section"
|
|
21
|
+
data-discover="true"
|
|
20
22
|
href="/qualityControls/8/version/1/scores"
|
|
21
23
|
>
|
|
22
24
|
test
|
|
@@ -74,12 +76,14 @@ exports[`<Score /> matches the latest snapshot 1`] = `
|
|
|
74
76
|
>
|
|
75
77
|
<a
|
|
76
78
|
class="item"
|
|
79
|
+
data-discover="true"
|
|
77
80
|
href="/scores/8"
|
|
78
81
|
>
|
|
79
82
|
Details
|
|
80
83
|
</a>
|
|
81
84
|
<a
|
|
82
85
|
class="item"
|
|
86
|
+
data-discover="true"
|
|
83
87
|
href="/scores/8/events"
|
|
84
88
|
>
|
|
85
89
|
Events
|
|
@@ -7,6 +7,7 @@ exports[`<ScoreCrumbs /> matches the latest snapshot 1`] = `
|
|
|
7
7
|
>
|
|
8
8
|
<a
|
|
9
9
|
class="section"
|
|
10
|
+
data-discover="true"
|
|
10
11
|
href="/qualityControls"
|
|
11
12
|
>
|
|
12
13
|
Quality Controls
|
|
@@ -17,6 +18,7 @@ exports[`<ScoreCrumbs /> matches the latest snapshot 1`] = `
|
|
|
17
18
|
/>
|
|
18
19
|
<a
|
|
19
20
|
class="section"
|
|
21
|
+
data-discover="true"
|
|
20
22
|
href="/qualityControls/8/version/1/scores"
|
|
21
23
|
>
|
|
22
24
|
test
|
|
@@ -4,13 +4,13 @@ exports[`<ScoreGroup /> matches the latest snapshot 1`] = `
|
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
6
|
class="ui breadcrumb"
|
|
7
|
-
style="display: none;"
|
|
8
7
|
>
|
|
9
8
|
<a
|
|
10
9
|
class="section"
|
|
10
|
+
data-discover="true"
|
|
11
11
|
href="/myScoreGroups"
|
|
12
12
|
>
|
|
13
|
-
|
|
13
|
+
sidemenu.executions
|
|
14
14
|
</a>
|
|
15
15
|
<i
|
|
16
16
|
aria-hidden="true"
|
|
@@ -28,7 +28,6 @@ exports[`<ScoreGroup /> matches the latest snapshot 1`] = `
|
|
|
28
28
|
</div>
|
|
29
29
|
<div
|
|
30
30
|
class="ui message"
|
|
31
|
-
style="display: none;"
|
|
32
31
|
>
|
|
33
32
|
<div
|
|
34
33
|
class="content"
|
|
@@ -36,16 +35,45 @@ exports[`<ScoreGroup /> matches the latest snapshot 1`] = `
|
|
|
36
35
|
<div
|
|
37
36
|
class="header"
|
|
38
37
|
>
|
|
39
|
-
|
|
38
|
+
scores.pending.header
|
|
40
39
|
</div>
|
|
41
40
|
<p>
|
|
42
|
-
|
|
41
|
+
scores.pending.content
|
|
43
42
|
</p>
|
|
44
43
|
</div>
|
|
45
44
|
</div>
|
|
45
|
+
<div
|
|
46
|
+
class="ui horizontal divider"
|
|
47
|
+
>
|
|
48
|
+
<h3>
|
|
49
|
+
g1
|
|
50
|
+
</h3>
|
|
51
|
+
</div>
|
|
52
|
+
<div
|
|
53
|
+
class="ui big very relaxed list"
|
|
54
|
+
role="list"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
class="item"
|
|
58
|
+
role="listitem"
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
class="header dynamic-field-header"
|
|
62
|
+
>
|
|
63
|
+
field1
|
|
64
|
+
</div>
|
|
65
|
+
<div
|
|
66
|
+
class="description"
|
|
67
|
+
>
|
|
68
|
+
<i
|
|
69
|
+
aria-hidden="true"
|
|
70
|
+
class="grey minus icon"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
46
75
|
<table
|
|
47
76
|
class="ui table"
|
|
48
|
-
style="display: none;"
|
|
49
77
|
>
|
|
50
78
|
<thead
|
|
51
79
|
class=""
|
|
@@ -56,12 +84,12 @@ exports[`<ScoreGroup /> matches the latest snapshot 1`] = `
|
|
|
56
84
|
<th
|
|
57
85
|
class=""
|
|
58
86
|
>
|
|
59
|
-
|
|
87
|
+
score.props.status
|
|
60
88
|
</th>
|
|
61
89
|
<th
|
|
62
90
|
class=""
|
|
63
91
|
>
|
|
64
|
-
|
|
92
|
+
quality_control.props.name
|
|
65
93
|
</th>
|
|
66
94
|
</tr>
|
|
67
95
|
</thead>
|
|
@@ -75,19 +103,21 @@ exports[`<ScoreGroup /> matches the latest snapshot 1`] = `
|
|
|
75
103
|
class=""
|
|
76
104
|
>
|
|
77
105
|
<a
|
|
106
|
+
data-discover="true"
|
|
78
107
|
href="/scores/15"
|
|
79
108
|
>
|
|
80
109
|
<i
|
|
81
110
|
aria-hidden="true"
|
|
82
111
|
class="grey info circle large icon"
|
|
83
112
|
/>
|
|
84
|
-
|
|
113
|
+
score.status.PENDING
|
|
85
114
|
</a>
|
|
86
115
|
</td>
|
|
87
116
|
<td
|
|
88
117
|
class=""
|
|
89
118
|
>
|
|
90
119
|
<a
|
|
120
|
+
data-discover="true"
|
|
91
121
|
href="/qualityControls/8/version/1"
|
|
92
122
|
>
|
|
93
123
|
test
|
|
@@ -96,7 +126,6 @@ exports[`<ScoreGroup /> matches the latest snapshot 1`] = `
|
|
|
96
126
|
</tr>
|
|
97
127
|
</tbody>
|
|
98
128
|
</table>
|
|
99
|
-
lazy
|
|
100
129
|
</div>
|
|
101
130
|
`;
|
|
102
131
|
|
|
@@ -6,7 +6,7 @@ exports[`<ScoreGroupForm /> matches the latest snapshot 1`] = `
|
|
|
6
6
|
class="ui header"
|
|
7
7
|
style=""
|
|
8
8
|
>
|
|
9
|
-
|
|
9
|
+
quality_controls.actions.execution.confirmation.header
|
|
10
10
|
</h2>
|
|
11
11
|
<form
|
|
12
12
|
class="ui form"
|
|
@@ -15,7 +15,7 @@ exports[`<ScoreGroupForm /> matches the latest snapshot 1`] = `
|
|
|
15
15
|
<h3
|
|
16
16
|
class="ui header"
|
|
17
17
|
>
|
|
18
|
-
|
|
18
|
+
quality_controls.actions.execution.confirmation.legend
|
|
19
19
|
</h3>
|
|
20
20
|
<div
|
|
21
21
|
style="max-height: calc(100vh - 20rem); overflow-y: auto;"
|
|
@@ -53,7 +53,7 @@ exports[`<ScoreGroupForm /> matches the latest snapshot 1`] = `
|
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
<p>
|
|
56
|
-
|
|
56
|
+
quality_controls.actions.execution.confirmation.content
|
|
57
57
|
</p>
|
|
58
58
|
<div
|
|
59
59
|
class="actions"
|
|
@@ -61,12 +61,12 @@ exports[`<ScoreGroupForm /> matches the latest snapshot 1`] = `
|
|
|
61
61
|
<button
|
|
62
62
|
class="ui secondary button"
|
|
63
63
|
>
|
|
64
|
-
|
|
64
|
+
actions.cancel
|
|
65
65
|
</button>
|
|
66
66
|
<button
|
|
67
67
|
class="ui primary button"
|
|
68
68
|
>
|
|
69
|
-
|
|
69
|
+
actions.create
|
|
70
70
|
</button>
|
|
71
71
|
</div>
|
|
72
72
|
</form>
|
|
@@ -78,7 +78,7 @@ exports[`<ScoreGroupForm /> matches the latest snapshot for count 1 1`] = `
|
|
|
78
78
|
<h2
|
|
79
79
|
class="ui header"
|
|
80
80
|
>
|
|
81
|
-
|
|
81
|
+
quality_controls.actions.execution.confirmation.header
|
|
82
82
|
</h2>
|
|
83
83
|
<form
|
|
84
84
|
class="ui form"
|
|
@@ -86,7 +86,7 @@ exports[`<ScoreGroupForm /> matches the latest snapshot for count 1 1`] = `
|
|
|
86
86
|
<h3
|
|
87
87
|
class="ui header"
|
|
88
88
|
>
|
|
89
|
-
|
|
89
|
+
quality_controls.actions.execution.confirmation.legend
|
|
90
90
|
</h3>
|
|
91
91
|
<div
|
|
92
92
|
style="max-height: calc(100vh - 20rem); overflow-y: auto;"
|
|
@@ -124,7 +124,7 @@ exports[`<ScoreGroupForm /> matches the latest snapshot for count 1 1`] = `
|
|
|
124
124
|
</div>
|
|
125
125
|
</div>
|
|
126
126
|
<p>
|
|
127
|
-
|
|
127
|
+
quality_control.actions.execution.confirmation.content
|
|
128
128
|
</p>
|
|
129
129
|
<div
|
|
130
130
|
class="actions"
|
|
@@ -132,12 +132,12 @@ exports[`<ScoreGroupForm /> matches the latest snapshot for count 1 1`] = `
|
|
|
132
132
|
<button
|
|
133
133
|
class="ui secondary button"
|
|
134
134
|
>
|
|
135
|
-
|
|
135
|
+
actions.cancel
|
|
136
136
|
</button>
|
|
137
137
|
<button
|
|
138
138
|
class="ui primary button"
|
|
139
139
|
>
|
|
140
|
-
|
|
140
|
+
actions.create
|
|
141
141
|
</button>
|
|
142
142
|
</div>
|
|
143
143
|
</form>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<ScoreGroupsRoutes /> renders correctly with default route 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div>
|
|
6
|
+
MyScoreGroups
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
exports[`<ScoreGroupsRoutes /> renders correctly with my score groups route 1`] = `
|
|
12
|
+
<div>
|
|
13
|
+
<div>
|
|
14
|
+
ScoreGroup
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
exports[`<ScoreGroupsRoutes /> renders correctly with score group detail route 1`] = `<div />`;
|
|
@@ -58,6 +58,7 @@ exports[`<ScoreGroupsTable /> matches the latest snapshot 1`] = `
|
|
|
58
58
|
class=""
|
|
59
59
|
>
|
|
60
60
|
<a
|
|
61
|
+
data-discover="true"
|
|
61
62
|
href="/scoreGroups/36"
|
|
62
63
|
>
|
|
63
64
|
<time
|
|
@@ -105,6 +106,7 @@ exports[`<ScoreGroupsTable /> matches the latest snapshot 1`] = `
|
|
|
105
106
|
class=""
|
|
106
107
|
>
|
|
107
108
|
<a
|
|
109
|
+
data-discover="true"
|
|
108
110
|
href="/scoreGroups/36"
|
|
109
111
|
>
|
|
110
112
|
<time
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
exports[`<ScoreStatusDecorator /> matches the latest snapshot for status FAILED 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<a
|
|
6
|
+
data-discover="true"
|
|
6
7
|
href="/scores/8"
|
|
7
8
|
>
|
|
8
9
|
<i
|
|
@@ -17,6 +18,7 @@ exports[`<ScoreStatusDecorator /> matches the latest snapshot for status FAILED
|
|
|
17
18
|
exports[`<ScoreStatusDecorator /> matches the latest snapshot for status PENDING 1`] = `
|
|
18
19
|
<div>
|
|
19
20
|
<a
|
|
21
|
+
data-discover="true"
|
|
20
22
|
href="/scores/8"
|
|
21
23
|
>
|
|
22
24
|
<i
|
|
@@ -31,6 +33,7 @@ exports[`<ScoreStatusDecorator /> matches the latest snapshot for status PENDING
|
|
|
31
33
|
exports[`<ScoreStatusDecorator /> matches the latest snapshot for status QUEUED 1`] = `
|
|
32
34
|
<div>
|
|
33
35
|
<a
|
|
36
|
+
data-discover="true"
|
|
34
37
|
href="/scores/8"
|
|
35
38
|
>
|
|
36
39
|
<i
|
|
@@ -45,6 +48,7 @@ exports[`<ScoreStatusDecorator /> matches the latest snapshot for status QUEUED
|
|
|
45
48
|
exports[`<ScoreStatusDecorator /> matches the latest snapshot for status STARTED 1`] = `
|
|
46
49
|
<div>
|
|
47
50
|
<a
|
|
51
|
+
data-discover="true"
|
|
48
52
|
href="/scores/8"
|
|
49
53
|
>
|
|
50
54
|
<i
|
|
@@ -59,6 +63,7 @@ exports[`<ScoreStatusDecorator /> matches the latest snapshot for status STARTED
|
|
|
59
63
|
exports[`<ScoreStatusDecorator /> matches the latest snapshot for status SUCCEEDED 1`] = `
|
|
60
64
|
<div>
|
|
61
65
|
<a
|
|
66
|
+
data-discover="true"
|
|
62
67
|
href="/scores/8"
|
|
63
68
|
>
|
|
64
69
|
<i
|
|
@@ -7,12 +7,14 @@ exports[`<ScoreTabs /> matches the latest snapshot for details 1`] = `
|
|
|
7
7
|
>
|
|
8
8
|
<a
|
|
9
9
|
class="active item"
|
|
10
|
+
data-discover="true"
|
|
10
11
|
href="/scores/15"
|
|
11
12
|
>
|
|
12
13
|
Details
|
|
13
14
|
</a>
|
|
14
15
|
<a
|
|
15
16
|
class="item"
|
|
17
|
+
data-discover="true"
|
|
16
18
|
href="/scores/15/events"
|
|
17
19
|
>
|
|
18
20
|
Events
|
|
@@ -28,12 +30,14 @@ exports[`<ScoreTabs /> matches the latest snapshot for events 1`] = `
|
|
|
28
30
|
>
|
|
29
31
|
<a
|
|
30
32
|
class="item"
|
|
33
|
+
data-discover="true"
|
|
31
34
|
href="/scores/15"
|
|
32
35
|
>
|
|
33
36
|
Details
|
|
34
37
|
</a>
|
|
35
38
|
<a
|
|
36
39
|
class="active item"
|
|
40
|
+
data-discover="true"
|
|
37
41
|
href="/scores/15/events"
|
|
38
42
|
>
|
|
39
43
|
Events
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import useSWR from "swr";
|
|
2
|
-
import { renderHook } from "@testing-library/react
|
|
2
|
+
import { renderHook } from "@testing-library/react";
|
|
3
3
|
import { apiJson } from "@truedat/core/services/api";
|
|
4
4
|
import { API_DATA_VIEWS } from "../../api";
|
|
5
5
|
import { useDataViews } from "../useDataViews";
|