@truedat/qx 7.0.7 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -4
- package/src/api.js +29 -20
- package/src/components/QxRoutes.js +18 -16
- package/src/components/__tests__/__fixtures__/helper.js +187 -0
- package/src/components/common/TestFormWrapper.js +38 -0
- package/src/components/common/__tests__/ResourceSelector.spec.js +18 -7
- package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +0 -12
- package/src/components/common/expressions/__tests__/Condition.spec.js +4 -1
- package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +18 -5
- package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +4 -4
- package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +10 -2
- package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +6 -3
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +0 -12
- package/src/components/dataViews/__tests__/DataViewEditor.spec.js +83 -53
- package/src/components/dataViews/__tests__/DataViews.spec.js +14 -1
- package/src/components/dataViews/__tests__/__snapshots__/DataViewEditor.spec.js.snap +93 -4
- package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +13 -6
- package/src/components/functions/__tests__/FunctionEditor.spec.js +2 -34
- package/src/components/functions/__tests__/FunctionParams.spec.js +4 -17
- package/src/components/functions/__tests__/Functions.spec.js +2 -34
- package/src/components/functions/__tests__/__snapshots__/FunctionEditor.spec.js.snap +48 -48
- package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +4 -4
- package/src/components/functions/__tests__/__snapshots__/Functions.spec.js.snap +4 -4
- package/src/components/qualityControls/ControlProperties.js +43 -0
- package/src/components/qualityControls/ControlPropertiesView.js +109 -0
- package/src/components/qualityControls/EditQualityControl.js +5 -21
- package/src/components/qualityControls/IconPopup.js +28 -0
- package/src/components/qualityControls/NewDraftQualityControl.js +4 -13
- package/src/components/qualityControls/NewQualityControl.js +10 -25
- package/src/components/qualityControls/QualityBadge.js +33 -0
- package/src/components/qualityControls/QualityControl.js +11 -53
- package/src/components/qualityControls/QualityControlActions.js +133 -46
- package/src/components/qualityControls/QualityControlEditor.js +114 -135
- package/src/components/qualityControls/QualityControlHeader.js +29 -7
- package/src/components/qualityControls/QualityControlHistory.js +6 -12
- package/src/components/qualityControls/QualityControlQueryModal.js +8 -5
- package/src/components/qualityControls/QualityControlRoutes.js +51 -96
- package/src/components/qualityControls/QualityControlRow.js +21 -2
- package/src/components/qualityControls/QualityControlScores.js +140 -0
- package/src/components/qualityControls/QualityControlTabs.js +24 -23
- package/src/components/qualityControls/QualityControls.js +142 -59
- package/src/components/qualityControls/QualityControlsLabelResults.js +51 -0
- package/src/components/qualityControls/QualityControlsTable.js +69 -43
- package/src/components/qualityControls/ScoreCriteria.js +40 -0
- package/src/components/qualityControls/{ResultCriteria.js → ScoreCriteriaView.js} +26 -42
- package/src/components/qualityControls/__tests__/ControlProperties.spec.js +86 -0
- package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +86 -0
- package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +219 -0
- package/src/components/qualityControls/__tests__/IconPopup.spec.js +33 -0
- package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +253 -0
- package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +384 -0
- package/src/components/qualityControls/__tests__/QualityBadge.spec.js +30 -0
- package/src/components/qualityControls/__tests__/QualityControl.spec.js +47 -0
- package/src/components/qualityControls/__tests__/QualityControlActions.spec.js +192 -0
- package/src/components/qualityControls/__tests__/QualityControlCrumbs.spec.js +18 -0
- package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +296 -0
- package/src/components/qualityControls/__tests__/QualityControlHeader.spec.js +68 -0
- package/src/components/qualityControls/__tests__/QualityControlHistory.spec.js +21 -0
- package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +77 -0
- package/src/components/qualityControls/__tests__/QualityControlRow.spec.js +91 -0
- package/src/components/qualityControls/__tests__/QualityControlScores.spec.js +139 -0
- package/src/components/qualityControls/__tests__/QualityControlTabs.spec.js +20 -0
- package/src/components/qualityControls/__tests__/QualityControls.spec.js +202 -0
- package/src/components/qualityControls/__tests__/QualityControlsLabelResults.spec.js +83 -0
- package/src/components/qualityControls/__tests__/QualityControlsTable.spec.js +38 -0
- package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +77 -0
- package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +62 -0
- package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +281 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ControlProperties.spec.js.snap +151 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ControlPropertiesView.spec.js.snap +290 -0
- package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +672 -0
- package/src/components/qualityControls/__tests__/__snapshots__/IconPopup.spec.js.snap +10 -0
- package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +648 -0
- package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +336 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityBadge.spec.js.snap +11 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +255 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlActions.spec.js.snap +85 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlCrumbs.spec.js.snap +25 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +930 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHeader.spec.js.snap +127 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHistory.spec.js.snap +75 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlQueryModal.spec.js.snap +27 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlRow.spec.js.snap +113 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlScores.spec.js.snap +161 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlTabs.spec.js.snap +28 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControls.spec.js.snap +219 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsLabelResults.spec.js.snap +11 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsTable.spec.js.snap +121 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteria.spec.js.snap +186 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteriaView.spec.js.snap +76 -0
- package/src/components/qualityControls/__tests__/qualityByControlMode.spec.js +248 -0
- package/src/components/qualityControls/controlProperties/ErrorCount.js +56 -0
- package/src/components/qualityControls/controlProperties/Ratio.js +79 -0
- package/src/components/qualityControls/controlProperties/__tests__/ErrorCount.spec.js +82 -0
- package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +115 -0
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/ErrorCount.spec.js.snap +62 -0
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +143 -0
- package/src/components/qualityControls/qualityByControlMode.js +62 -0
- package/src/components/qualityControls/qualityControlScoresColumns.js +52 -0
- package/src/components/qualityControls/{resultCriterias → scoreCriterias}/Deviation.js +6 -6
- package/src/components/qualityControls/{resultCriterias/ErrorsNumber.js → scoreCriterias/ErrorCount.js} +7 -7
- package/src/components/qualityControls/{resultCriterias → scoreCriterias}/Percentage.js +6 -6
- package/src/components/qualityControls/scoreCriterias/__tests__/Deviation.spec.js +75 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +63 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/Percentage.spec.js +61 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Deviation.spec.js.snap +58 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/ErrorCount.spec.js.snap +58 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Percentage.spec.js.snap +58 -0
- package/src/components/{executions/ExecutionGroupsHeader.js → scores/MyScoreGroups.js} +5 -3
- package/src/components/scores/QualityBar.js +73 -0
- package/src/components/scores/Score.js +32 -0
- package/src/components/scores/ScoreContext.js +3 -0
- package/src/components/scores/ScoreCrumbs.js +40 -0
- package/src/components/scores/ScoreDetails.js +67 -0
- package/src/components/scores/ScoreEvents.js +59 -0
- package/src/components/scores/ScoreGroup.js +83 -0
- package/src/components/scores/ScoreGroupBreadcrumbs.js +25 -0
- package/src/components/{qualityControls/ExecutionForm.js → scores/ScoreGroupForm.js} +11 -13
- package/src/components/scores/ScoreGroupLink.js +18 -0
- package/src/components/scores/ScoreGroupMessage.js +25 -0
- package/src/components/{qualityControls/ExecutionPopup.js → scores/ScoreGroupPopup.js} +13 -22
- package/src/components/scores/ScoreGroupsTable.js +113 -0
- package/src/components/scores/ScoreRoutes.js +32 -0
- package/src/components/{executions/ExecutionStatusDecorator.js → scores/ScoreStatusDecorator.js} +10 -8
- package/src/components/scores/ScoreTabs.js +32 -0
- package/src/components/scores/__tests__/MyScoreGroups.spec.js +31 -0
- package/src/components/scores/__tests__/QualityBar.spec.js +55 -0
- package/src/components/scores/__tests__/Score.spec.js +41 -0
- package/src/components/scores/__tests__/ScoreCrumbs.spec.js +39 -0
- package/src/components/scores/__tests__/ScoreDetails.spec.js +38 -0
- package/src/components/scores/__tests__/ScoreEvents.spec.js +24 -0
- package/src/components/scores/__tests__/ScoreGroup.spec.js +43 -0
- package/src/components/scores/__tests__/ScoreGroupBreadcrumbs.spec.js +16 -0
- package/src/components/scores/__tests__/ScoreGroupForm.spec.js +78 -0
- package/src/components/scores/__tests__/ScoreGroupLink.spec.js +16 -0
- package/src/components/scores/__tests__/ScoreGroupMessage.spec.js +20 -0
- package/src/components/scores/__tests__/ScoreGroupPopup.spec.js +59 -0
- package/src/components/scores/__tests__/ScoreGroupsTable.spec.js +40 -0
- package/src/components/scores/__tests__/ScoreStatusDecorator.spec.js +21 -0
- package/src/components/scores/__tests__/ScoreTabs.spec.js +27 -0
- package/src/components/scores/__tests__/__fixtures__/scoreHelper.js +182 -0
- package/src/components/scores/__tests__/__snapshots__/MyScoreGroups.spec.js.snap +154 -0
- package/src/components/scores/__tests__/__snapshots__/QualityBar.spec.js.snap +24 -0
- package/src/components/scores/__tests__/__snapshots__/Score.spec.js.snap +92 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreCrumbs.spec.js.snap +39 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreDetails.spec.js.snap +156 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreEvents.spec.js.snap +167 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroup.spec.js.snap +103 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupBreadcrumbs.spec.js.snap +29 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupForm.spec.js.snap +145 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupLink.spec.js.snap +15 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupMessage.spec.js.snap +43 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupPopup.spec.js.snap +11 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupsTable.spec.js.snap +147 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreStatusDecorator.spec.js.snap +71 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreTabs.spec.js.snap +43 -0
- package/src/components/scores/index.js +15 -0
- package/src/hooks/useQualityControls.js +3 -9
- package/src/hooks/useScoreGroups.js +23 -0
- package/src/hooks/useScores.js +22 -0
- package/src/styles/Expression.less +16 -0
- package/src/styles/scores.less +63 -0
- package/src/components/executions/ExecutionGroupBreadcrumbs.js +0 -25
- package/src/components/executions/ExecutionGroupContent.js +0 -42
- package/src/components/executions/ExecutionGroupLink.js +0 -18
- package/src/components/executions/ExecutionGroupMessage.js +0 -27
- package/src/components/executions/ExecutionGroupsTable.js +0 -101
- package/src/components/executions/executionGroupDetail.js +0 -87
- package/src/components/qualityControls/ResultType.js +0 -57
|
@@ -72,18 +72,6 @@ exports[`<DataStructureSelector /> matches the latest snapshot 1`] = `
|
|
|
72
72
|
<div
|
|
73
73
|
class="dimmable structure-table-overflow"
|
|
74
74
|
>
|
|
75
|
-
<div
|
|
76
|
-
class="ui inverted dimmer"
|
|
77
|
-
style=""
|
|
78
|
-
>
|
|
79
|
-
<div
|
|
80
|
-
class="content"
|
|
81
|
-
>
|
|
82
|
-
<div
|
|
83
|
-
class="ui large loader"
|
|
84
|
-
/>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
75
|
<div
|
|
88
76
|
class="ui icon info message"
|
|
89
77
|
>
|
|
@@ -1,59 +1,71 @@
|
|
|
1
1
|
import React, { Suspense } from "react";
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
2
3
|
import { act } from "react-dom/test-utils";
|
|
3
4
|
import userEvent from "@testing-library/user-event";
|
|
4
5
|
import { render } from "@truedat/test/render";
|
|
6
|
+
import { SOURCE_OPTIONS_QUERY } from "@truedat/cx/sources/api/queries";
|
|
5
7
|
import DataViewEditor from "../DataViewEditor";
|
|
8
|
+
import { sources } from "@truedat/qx/components/qualityControls/__tests__/__fixtures__/qualityControlHelper";
|
|
6
9
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
10
|
+
const sourcesMock = {
|
|
11
|
+
request: { query: SOURCE_OPTIONS_QUERY },
|
|
12
|
+
result: { data: { sources } },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const messages = {
|
|
16
|
+
en: {
|
|
17
|
+
"actions.cancel": "cancel",
|
|
18
|
+
"actions.delete": "delete",
|
|
19
|
+
"actions.discard.confirmation.content": "content",
|
|
20
|
+
"actions.discard.confirmation.header": "header",
|
|
21
|
+
"actions.save": "save",
|
|
22
|
+
"confirmation.no": "confirmation_no",
|
|
23
|
+
"confirmation.yes": "confirmation_yes",
|
|
24
|
+
"dataViews.action.delete.content": "content",
|
|
25
|
+
"dataViews.action.delete.header": "header",
|
|
26
|
+
"dataViews.action.new": "new",
|
|
27
|
+
"dataViews.form.error.empty_select": "empty_select",
|
|
28
|
+
"dataViews.form.name": "name",
|
|
29
|
+
"dataViews.form.queryable.alias": "alias",
|
|
30
|
+
"dataViews.form.queryable.from": "from",
|
|
31
|
+
"dataViews.form.queryable.group_by": "group_by",
|
|
32
|
+
"dataViews.form.queryable.join": "join",
|
|
33
|
+
"dataViews.form.queryable.select": "select",
|
|
34
|
+
"dataViews.form.queryable.where": "where",
|
|
35
|
+
"dataViews.form.select": "select",
|
|
36
|
+
"expression.clause.action.addExpression": "addExpression",
|
|
37
|
+
"expression.clause.action.addGroup": "addGroup",
|
|
38
|
+
"expression.condition.customExpression": "customExpression",
|
|
39
|
+
"expression.condition.selectFunction": "selectFunction",
|
|
40
|
+
"expression.form.clause": "clause",
|
|
41
|
+
"form.validation.required": "required",
|
|
42
|
+
"functions.expression.shape.constant": "constant",
|
|
43
|
+
"functions.expression.shape.field": "field",
|
|
44
|
+
"functions.expression.shape.function": "function",
|
|
45
|
+
"functions.form.add_description": "add_description",
|
|
46
|
+
"functions.form.required": "required",
|
|
47
|
+
"group.props.name": "name",
|
|
48
|
+
"queryables.form.resource": "resource",
|
|
49
|
+
"queryables.resource.selector.data_structure": "data_structure",
|
|
50
|
+
"queryables.resource.selector.data_view": "data_view",
|
|
51
|
+
"queryables.resource.type.data_structure": "data_structure",
|
|
52
|
+
"queryables.resource.type.data_view": "data_view",
|
|
53
|
+
"queryables.resource.type.reference_dataset": "reference_dataset",
|
|
54
|
+
"queryables.resource.type": "type",
|
|
55
|
+
"queryables.select.form.add_all_select_fields": "add_all_select_fields",
|
|
56
|
+
"queryables.select.form.add_select_field": "add_select_field",
|
|
57
|
+
"queryables.select.form.alias": "alias",
|
|
58
|
+
"source.search.placeholder": "placeholder",
|
|
59
|
+
"dataViews.form.source": "source",
|
|
54
60
|
},
|
|
55
61
|
};
|
|
56
62
|
|
|
63
|
+
const renderOpts = {
|
|
64
|
+
mocks: [sourcesMock],
|
|
65
|
+
messages,
|
|
66
|
+
fallback: "lazy",
|
|
67
|
+
};
|
|
68
|
+
|
|
57
69
|
const defaultProps = {
|
|
58
70
|
selectedDataView: null,
|
|
59
71
|
context: { sourceId: 10 },
|
|
@@ -66,11 +78,16 @@ const defaultProps = {
|
|
|
66
78
|
|
|
67
79
|
describe("<DataViewEditor />", () => {
|
|
68
80
|
it("matches the latest snapshot for empty", async () => {
|
|
69
|
-
const { container } = render(
|
|
81
|
+
const { container, queryByText } = render(
|
|
70
82
|
<DataViewEditor {...defaultProps} />,
|
|
71
83
|
renderOpts
|
|
72
84
|
);
|
|
73
85
|
|
|
86
|
+
await waitFor(() => {
|
|
87
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
88
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
89
|
+
});
|
|
90
|
+
|
|
74
91
|
await act(async () => {
|
|
75
92
|
expect(container).toMatchSnapshot();
|
|
76
93
|
});
|
|
@@ -129,13 +146,18 @@ describe("<DataViewEditor />", () => {
|
|
|
129
146
|
},
|
|
130
147
|
},
|
|
131
148
|
};
|
|
132
|
-
const { container } = render(
|
|
149
|
+
const { container, queryByText } = render(
|
|
133
150
|
<Suspense fallback={<p>Loading selector</p>}>
|
|
134
151
|
<DataViewEditor {...props} />
|
|
135
152
|
</Suspense>,
|
|
136
153
|
renderOpts
|
|
137
154
|
);
|
|
138
155
|
|
|
156
|
+
await waitFor(() => {
|
|
157
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
158
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
159
|
+
});
|
|
160
|
+
|
|
139
161
|
await act(async () => {
|
|
140
162
|
expect(container).toMatchSnapshot();
|
|
141
163
|
});
|
|
@@ -195,10 +217,18 @@ describe("<DataViewEditor />", () => {
|
|
|
195
217
|
],
|
|
196
218
|
},
|
|
197
219
|
};
|
|
198
|
-
const {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
220
|
+
const {
|
|
221
|
+
container,
|
|
222
|
+
getAllByRole,
|
|
223
|
+
getByRole,
|
|
224
|
+
getByPlaceholderText,
|
|
225
|
+
queryByText,
|
|
226
|
+
} = render(<DataViewEditor {...props} />, renderOpts);
|
|
227
|
+
|
|
228
|
+
await waitFor(() => {
|
|
229
|
+
expect(queryByText(/lazy/i)).not.toBeInTheDocument();
|
|
230
|
+
expect(container.querySelector(".loader")).not.toBeInTheDocument();
|
|
231
|
+
});
|
|
202
232
|
|
|
203
233
|
// Insert name
|
|
204
234
|
userEvent.type(getAllByRole("textbox")[0], "data_view_name");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render } from "@truedat/test/render";
|
|
3
|
-
|
|
3
|
+
import { REFERENCE_DATASETS_HEADERS_QUERY } from "@truedat/dd/api/queries";
|
|
4
4
|
import DataViews from "../DataViews";
|
|
5
5
|
|
|
6
6
|
jest.mock("@truedat/qx/hooks/useDataViews", () => {
|
|
@@ -36,7 +36,19 @@ jest.mock("@truedat/qx/hooks/useDataViews", () => {
|
|
|
36
36
|
};
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
const dataSet = {
|
|
40
|
+
id: "7",
|
|
41
|
+
name: "dataset1",
|
|
42
|
+
headers: ["campo1", "campo2"],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const referenceDatasetsMock = {
|
|
46
|
+
request: { query: REFERENCE_DATASETS_HEADERS_QUERY },
|
|
47
|
+
result: { data: { referenceDatasets: [dataSet], loading: false } },
|
|
48
|
+
};
|
|
49
|
+
|
|
39
50
|
const renderOpts = {
|
|
51
|
+
mocks: [referenceDatasetsMock],
|
|
40
52
|
messages: {
|
|
41
53
|
en: {
|
|
42
54
|
"dataViews.action.new": "new",
|
|
@@ -46,6 +58,7 @@ const renderOpts = {
|
|
|
46
58
|
"dataViews.header": "header",
|
|
47
59
|
},
|
|
48
60
|
},
|
|
61
|
+
fallback: "lazy",
|
|
49
62
|
};
|
|
50
63
|
|
|
51
64
|
describe("<DataViews />", () => {
|
|
@@ -66,6 +66,56 @@ exports[`<DataViewEditor /> handles user interaction 1`] = `
|
|
|
66
66
|
<label>
|
|
67
67
|
source
|
|
68
68
|
</label>
|
|
69
|
+
<div
|
|
70
|
+
class="field"
|
|
71
|
+
>
|
|
72
|
+
<div
|
|
73
|
+
aria-busy="false"
|
|
74
|
+
aria-disabled="false"
|
|
75
|
+
aria-expanded="false"
|
|
76
|
+
class="ui search selection dropdown"
|
|
77
|
+
role="combobox"
|
|
78
|
+
>
|
|
79
|
+
<input
|
|
80
|
+
aria-autocomplete="list"
|
|
81
|
+
autocomplete="off"
|
|
82
|
+
class="search"
|
|
83
|
+
tabindex="0"
|
|
84
|
+
type="text"
|
|
85
|
+
value=""
|
|
86
|
+
/>
|
|
87
|
+
<div
|
|
88
|
+
aria-atomic="true"
|
|
89
|
+
aria-live="polite"
|
|
90
|
+
class="divider text"
|
|
91
|
+
role="alert"
|
|
92
|
+
>
|
|
93
|
+
placeholder
|
|
94
|
+
</div>
|
|
95
|
+
<i
|
|
96
|
+
aria-hidden="true"
|
|
97
|
+
class="dropdown icon"
|
|
98
|
+
/>
|
|
99
|
+
<div
|
|
100
|
+
class="menu transition"
|
|
101
|
+
role="listbox"
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
aria-checked="false"
|
|
105
|
+
aria-selected="true"
|
|
106
|
+
class="selected item"
|
|
107
|
+
role="option"
|
|
108
|
+
style="pointer-events: all;"
|
|
109
|
+
>
|
|
110
|
+
<span
|
|
111
|
+
class="text"
|
|
112
|
+
>
|
|
113
|
+
external_source_id
|
|
114
|
+
</span>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
69
119
|
</div>
|
|
70
120
|
<div
|
|
71
121
|
class="ui list"
|
|
@@ -512,7 +562,7 @@ exports[`<DataViewEditor /> matches the latest snapshot with content 1`] = `
|
|
|
512
562
|
<div>
|
|
513
563
|
<form
|
|
514
564
|
class="ui form"
|
|
515
|
-
style="
|
|
565
|
+
style=""
|
|
516
566
|
>
|
|
517
567
|
<h3
|
|
518
568
|
class="ui dividing header"
|
|
@@ -575,6 +625,48 @@ exports[`<DataViewEditor /> matches the latest snapshot with content 1`] = `
|
|
|
575
625
|
<label>
|
|
576
626
|
source
|
|
577
627
|
</label>
|
|
628
|
+
<div
|
|
629
|
+
class="disabled field"
|
|
630
|
+
>
|
|
631
|
+
<div
|
|
632
|
+
aria-busy="true"
|
|
633
|
+
aria-disabled="true"
|
|
634
|
+
aria-expanded="false"
|
|
635
|
+
class="ui disabled loading search selection dropdown"
|
|
636
|
+
role="combobox"
|
|
637
|
+
>
|
|
638
|
+
<input
|
|
639
|
+
aria-autocomplete="list"
|
|
640
|
+
autocomplete="off"
|
|
641
|
+
class="search"
|
|
642
|
+
tabindex="-1"
|
|
643
|
+
type="text"
|
|
644
|
+
value=""
|
|
645
|
+
/>
|
|
646
|
+
<div
|
|
647
|
+
aria-atomic="true"
|
|
648
|
+
aria-live="polite"
|
|
649
|
+
class="divider text"
|
|
650
|
+
role="alert"
|
|
651
|
+
>
|
|
652
|
+
placeholder
|
|
653
|
+
</div>
|
|
654
|
+
<i
|
|
655
|
+
aria-hidden="true"
|
|
656
|
+
class="dropdown icon"
|
|
657
|
+
/>
|
|
658
|
+
<div
|
|
659
|
+
class="menu transition"
|
|
660
|
+
role="listbox"
|
|
661
|
+
>
|
|
662
|
+
<div
|
|
663
|
+
class="message"
|
|
664
|
+
>
|
|
665
|
+
No results found.
|
|
666
|
+
</div>
|
|
667
|
+
</div>
|
|
668
|
+
</div>
|
|
669
|
+
</div>
|
|
578
670
|
</div>
|
|
579
671
|
<div
|
|
580
672
|
class="ui list"
|
|
@@ -972,8 +1064,5 @@ exports[`<DataViewEditor /> matches the latest snapshot with content 1`] = `
|
|
|
972
1064
|
</button>
|
|
973
1065
|
</div>
|
|
974
1066
|
</form>
|
|
975
|
-
<p>
|
|
976
|
-
Loading selector
|
|
977
|
-
</p>
|
|
978
1067
|
</div>
|
|
979
1068
|
`;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { act } from "react-dom/test-utils";
|
|
3
|
+
import { waitFor } from "@testing-library/react";
|
|
3
4
|
import userEvent from "@testing-library/user-event";
|
|
4
5
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
5
6
|
import { render } from "@truedat/test/render";
|
|
@@ -17,11 +18,12 @@ const renderOpts = {
|
|
|
17
18
|
"functions.expression.shape.constant": "constant",
|
|
18
19
|
},
|
|
19
20
|
},
|
|
21
|
+
fallback: "loading",
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
describe("<SelectField />", () => {
|
|
23
|
-
it("matches the latest snapshot for select", () => {
|
|
24
|
-
const { container } = render(
|
|
25
|
+
it("matches the latest snapshot for select", async () => {
|
|
26
|
+
const { container, queryByText } = render(
|
|
25
27
|
<TestFormWrapper
|
|
26
28
|
context={{
|
|
27
29
|
field: "select.properties.fields[0]",
|
|
@@ -39,11 +41,14 @@ describe("<SelectField />", () => {
|
|
|
39
41
|
</TestFormWrapper>,
|
|
40
42
|
renderOpts
|
|
41
43
|
);
|
|
42
|
-
|
|
44
|
+
await waitFor(() =>
|
|
45
|
+
expect(queryByText(/loading/i)).not.toBeInTheDocument()
|
|
46
|
+
);
|
|
43
47
|
expect(container).toMatchSnapshot();
|
|
44
48
|
});
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
|
|
50
|
+
it("matches the latest snapshot for group_by", async () => {
|
|
51
|
+
const { container, queryByText } = render(
|
|
47
52
|
<TestFormWrapper
|
|
48
53
|
context={{
|
|
49
54
|
functions: [{ class: "aggregator", name: "func", type: "number" }],
|
|
@@ -65,7 +70,9 @@ describe("<SelectField />", () => {
|
|
|
65
70
|
</TestFormWrapper>,
|
|
66
71
|
renderOpts
|
|
67
72
|
);
|
|
68
|
-
|
|
73
|
+
await waitFor(() =>
|
|
74
|
+
expect(queryByText(/loading/i)).not.toBeInTheDocument()
|
|
75
|
+
);
|
|
69
76
|
expect(container).toMatchSnapshot();
|
|
70
77
|
});
|
|
71
78
|
|
|
@@ -2,43 +2,11 @@ import React from "react";
|
|
|
2
2
|
import { waitFor } from "@testing-library/react";
|
|
3
3
|
import { render } from "@truedat/test/render";
|
|
4
4
|
import userEvent from "@testing-library/user-event";
|
|
5
|
+
import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
|
|
5
6
|
import FunctionEditor from "../FunctionEditor";
|
|
6
7
|
|
|
7
8
|
const renderOpts = {
|
|
8
|
-
messages
|
|
9
|
-
en: {
|
|
10
|
-
"functions.expression.shape.function": "function",
|
|
11
|
-
"functions.expression.shape.constant": "constant",
|
|
12
|
-
"functions.expression.shape.param": "param",
|
|
13
|
-
"functions.form.expression.function.placeholder": "function.placeholder",
|
|
14
|
-
"group.props.name": "name",
|
|
15
|
-
"functions.form.name": "name",
|
|
16
|
-
"functions.form.add_description": "add_description",
|
|
17
|
-
"functions.form.name": "name",
|
|
18
|
-
"functions.form.add_param": "add_param",
|
|
19
|
-
"actions.save": "save",
|
|
20
|
-
"actions.cancel": "cancel",
|
|
21
|
-
"actions.delete": "delete",
|
|
22
|
-
"functions.action.delete.header": "delete_header",
|
|
23
|
-
"functions.action.delete.content": "delete_content",
|
|
24
|
-
"functions.form.output": "output",
|
|
25
|
-
"functions.form.params": "params",
|
|
26
|
-
"form.validation.required": "required",
|
|
27
|
-
"confirmation.yes": "confirm_yes",
|
|
28
|
-
"confirmation.no": "confirm_no",
|
|
29
|
-
"actions.discard.confirmation.header": "confirmation_header",
|
|
30
|
-
"actions.discard.confirmation.content": "confirmation_content",
|
|
31
|
-
"functions.expression.constant.false": "false",
|
|
32
|
-
"functions.expression.constant.true": "true",
|
|
33
|
-
"functions.form.description": "description",
|
|
34
|
-
"expressions.data_type.timestamp": "timestamp",
|
|
35
|
-
"expressions.data_type.date": "date",
|
|
36
|
-
"expressions.data_type.number": "number",
|
|
37
|
-
"expressions.data_type.string": "string",
|
|
38
|
-
"expressions.data_type.boolean": "boolean",
|
|
39
|
-
"expressions.data_type.any": "any",
|
|
40
|
-
},
|
|
41
|
-
},
|
|
9
|
+
messages,
|
|
42
10
|
fallback: "lazy",
|
|
43
11
|
};
|
|
44
12
|
|
|
@@ -3,24 +3,11 @@ import { render } from "@truedat/test/render";
|
|
|
3
3
|
import { waitFor } from "@testing-library/react";
|
|
4
4
|
import userEvent from "@testing-library/user-event";
|
|
5
5
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
|
+
import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
|
|
6
7
|
import FunctionParams from "../FunctionParams";
|
|
7
8
|
|
|
8
9
|
const renderOpts = {
|
|
9
|
-
messages
|
|
10
|
-
en: {
|
|
11
|
-
"functions.form.required": "required",
|
|
12
|
-
"functions.form.add_description": "add_description",
|
|
13
|
-
"functions.form.name": "name",
|
|
14
|
-
"functions.form.add_param": "add_param",
|
|
15
|
-
"functions.form.description": "description",
|
|
16
|
-
"expressions.data_type.timestamp": "timestamp",
|
|
17
|
-
"expressions.data_type.date": "date",
|
|
18
|
-
"expressions.data_type.number": "number",
|
|
19
|
-
"expressions.data_type.string": "string",
|
|
20
|
-
"expressions.data_type.boolean": "boolean",
|
|
21
|
-
"expressions.data_type.any": "any",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
10
|
+
messages,
|
|
24
11
|
fallback: "lazy",
|
|
25
12
|
};
|
|
26
13
|
|
|
@@ -63,12 +50,12 @@ describe("<FunctionParams />", () => {
|
|
|
63
50
|
renderOpts
|
|
64
51
|
);
|
|
65
52
|
await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
|
|
66
|
-
userEvent.click(getByRole("button", { name: /
|
|
53
|
+
userEvent.click(getByRole("button", { name: /Add parameter/i }));
|
|
67
54
|
|
|
68
55
|
const argInput = getByPlaceholderText(/name/i);
|
|
69
56
|
const typeSelector = getByRole("listbox");
|
|
70
57
|
const stringOption = getByRole("option", { name: /string/i });
|
|
71
|
-
const descriptionInputLabel = getByText(/
|
|
58
|
+
const descriptionInputLabel = getByText(/Add description/i);
|
|
72
59
|
|
|
73
60
|
await waitFor(() => expect(argInput).toBeInTheDocument());
|
|
74
61
|
await waitFor(() => expect(typeSelector).toBeInTheDocument());
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { waitFor } from "@testing-library/react";
|
|
3
3
|
import { render } from "@truedat/test/render";
|
|
4
|
+
import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
|
|
4
5
|
import Functions from "../Functions";
|
|
5
6
|
|
|
6
7
|
jest.mock("@truedat/qx/hooks/useFunctions", () => {
|
|
@@ -50,40 +51,7 @@ jest.mock("@truedat/qx/hooks/useFunctions", () => {
|
|
|
50
51
|
|
|
51
52
|
describe("<Functions />", () => {
|
|
52
53
|
const renderOpts = {
|
|
53
|
-
messages
|
|
54
|
-
en: {
|
|
55
|
-
"functions.header": "functions.header",
|
|
56
|
-
"functions.subheader": "functions.subheader",
|
|
57
|
-
"functions.no_selection": "functions.no_selection",
|
|
58
|
-
"functions.empty_list": "functions.empty_list",
|
|
59
|
-
"functions.action.new": "functions.action.new",
|
|
60
|
-
"functions.expression.shape.function": "function",
|
|
61
|
-
"functions.expression.shape.constant": "constant",
|
|
62
|
-
"functions.expression.shape.param": "param",
|
|
63
|
-
"functions.form.expression.function.placeholder":
|
|
64
|
-
"function.placeholder",
|
|
65
|
-
"group.props.name": "name",
|
|
66
|
-
"functions.form.name": "name",
|
|
67
|
-
"functions.form.add_description": "add_description",
|
|
68
|
-
"functions.form.name": "name",
|
|
69
|
-
"functions.form.add_param": "add_param",
|
|
70
|
-
"actions.save": "save",
|
|
71
|
-
"actions.cancel": "cancel",
|
|
72
|
-
"actions.delete": "delete",
|
|
73
|
-
"functions.action.delete.header": "delete_header",
|
|
74
|
-
"functions.action.delete.content": "delete_content",
|
|
75
|
-
"functions.form.output": "output",
|
|
76
|
-
"functions.form.params": "params",
|
|
77
|
-
"form.validation.required": "required",
|
|
78
|
-
"confirmation.yes": "confirm_yes",
|
|
79
|
-
"confirmation.no": "confirm_no",
|
|
80
|
-
"actions.discard.confirmation.header": "confirmation_header",
|
|
81
|
-
"actions.discard.confirmation.content": "confirmation_content",
|
|
82
|
-
"functions.expression.constant.false": "false",
|
|
83
|
-
"functions.expression.constant.true": "true",
|
|
84
|
-
"functions.form.description": "description",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
54
|
+
messages,
|
|
87
55
|
fallback: "lazy",
|
|
88
56
|
};
|
|
89
57
|
|