@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,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { useState, use, useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { Controller, useFormContext } from "react-hook-form";
|
|
@@ -14,7 +14,7 @@ export const newSelectField = (id) => ({
|
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
export default function SelectField({ onDelete }) {
|
|
17
|
-
const context =
|
|
17
|
+
const context = use(QxContext);
|
|
18
18
|
const { field } = context;
|
|
19
19
|
const { formatMessage } = useIntl();
|
|
20
20
|
const { control, watch, setValue } = useFormContext();
|
|
@@ -58,7 +58,7 @@ export default function SelectField({ onDelete }) {
|
|
|
58
58
|
<Grid.Row>
|
|
59
59
|
<Grid.Column></Grid.Column>
|
|
60
60
|
<GridColumn width={9}>
|
|
61
|
-
<QxContext
|
|
61
|
+
<QxContext
|
|
62
62
|
value={{
|
|
63
63
|
...context,
|
|
64
64
|
type: "any",
|
|
@@ -67,7 +67,7 @@ export default function SelectField({ onDelete }) {
|
|
|
67
67
|
}}
|
|
68
68
|
>
|
|
69
69
|
<Expression />
|
|
70
|
-
</QxContext
|
|
70
|
+
</QxContext>
|
|
71
71
|
</GridColumn>
|
|
72
72
|
<Grid.Column width={6}>
|
|
73
73
|
<Form.Group inline className="no-margin">
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { use } from "react";
|
|
2
2
|
|
|
3
3
|
import { Clauses } from "@truedat/qx/components/common/expressions";
|
|
4
4
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
5
5
|
|
|
6
6
|
export default function Where() {
|
|
7
|
-
const context =
|
|
7
|
+
const context = use(QxContext);
|
|
8
8
|
const { field } = context;
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<QxContext
|
|
11
|
+
<QxContext value={{ ...context, field: `${field}.clauses` }}>
|
|
12
12
|
<Clauses />
|
|
13
|
-
</QxContext
|
|
13
|
+
</QxContext>
|
|
14
14
|
);
|
|
15
15
|
}
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { act } from "react-dom/test-utils";
|
|
3
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
3
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
5
|
-
import { render } from "@truedat/test/render";
|
|
6
|
-
|
|
7
4
|
import GroupBy from "../GroupBy";
|
|
8
5
|
|
|
9
|
-
const renderOpts = {
|
|
10
|
-
messages: {
|
|
11
|
-
en: {
|
|
12
|
-
"dataViews.form.error.empty_select": "empty_select",
|
|
13
|
-
"queryables.group_by.form.add_aggregate_field": "add_aggregate_field",
|
|
14
|
-
"queryables.group_by.form.add_group_field": "add_group_field",
|
|
15
|
-
"queryables.group_by.form.aggregate_fields": "aggregate_fields",
|
|
16
|
-
"queryables.group_by.form.group_fields": "group_fields",
|
|
17
|
-
"queryables.select.form.alias": "alias",
|
|
18
|
-
"functions.form.required": "required",
|
|
19
|
-
"functions.form.expression.function.placeholder": "placeholder",
|
|
20
|
-
"functions.expression.shape.function": "function",
|
|
21
|
-
"functions.expression.shape.constant": "constant",
|
|
22
|
-
"functions.form.required": "required",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
6
|
describe("<GroupBy />", () => {
|
|
28
7
|
it("matches the latest snapshot", async () => {
|
|
29
|
-
const {
|
|
8
|
+
const user = userEvent.setup({ delay: null });
|
|
9
|
+
const rendered = render(
|
|
30
10
|
<TestFormWrapper
|
|
31
11
|
context={{
|
|
32
12
|
field: "queryables[0].properties",
|
|
@@ -46,30 +26,24 @@ describe("<GroupBy />", () => {
|
|
|
46
26
|
}}
|
|
47
27
|
>
|
|
48
28
|
<GroupBy />
|
|
49
|
-
</TestFormWrapper
|
|
50
|
-
renderOpts
|
|
29
|
+
</TestFormWrapper>
|
|
51
30
|
);
|
|
31
|
+
await waitForLoad(rendered);
|
|
52
32
|
|
|
53
|
-
await
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
await user.click(
|
|
34
|
+
rendered.getByRole("button", { name: /add_group_field/i })
|
|
35
|
+
);
|
|
56
36
|
|
|
57
|
-
|
|
58
|
-
await
|
|
59
|
-
userEvent.click(getByRole("button", { name: /delete/i }));
|
|
60
|
-
});
|
|
37
|
+
await user.hover(rendered.getAllByRole("textbox")[2]);
|
|
38
|
+
await user.click(rendered.getByRole("button", { name: /delete/i }));
|
|
61
39
|
|
|
62
|
-
await
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
await user.click(
|
|
41
|
+
rendered.getByRole("button", { name: /add_aggregate_field/i })
|
|
42
|
+
);
|
|
65
43
|
|
|
66
|
-
|
|
67
|
-
await
|
|
68
|
-
userEvent.click(getByRole("button", { name: /delete/i }));
|
|
69
|
-
});
|
|
44
|
+
await user.hover(rendered.getAllByRole("textbox")[3]);
|
|
45
|
+
await user.click(rendered.getByRole("button", { name: /delete/i }));
|
|
70
46
|
|
|
71
|
-
|
|
72
|
-
expect(container).toMatchSnapshot();
|
|
73
|
-
});
|
|
47
|
+
expect(rendered.container).toMatchSnapshot();
|
|
74
48
|
});
|
|
75
49
|
});
|
|
@@ -1,38 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
2
2
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
3
|
-
import { render } from "@truedat/test/render";
|
|
4
|
-
|
|
5
3
|
import Join from "../Join";
|
|
6
4
|
|
|
7
|
-
const renderOpts = {
|
|
8
|
-
messages: {
|
|
9
|
-
en: {
|
|
10
|
-
"dataViews.form.queryable.alias": "alias",
|
|
11
|
-
"joinType.full_outer": "full_outer",
|
|
12
|
-
"joinType.inner": "inner",
|
|
13
|
-
"joinType.left": "left",
|
|
14
|
-
"joinType.right": "right",
|
|
15
|
-
"queryables.form.join.type": "type",
|
|
16
|
-
"expression.clause.action.addGroup": "addGroup",
|
|
17
|
-
"expression.form.clause": "clause",
|
|
18
|
-
"queryables.resource.type": "type",
|
|
19
|
-
"queryables.form.resource": "resource",
|
|
20
|
-
"queryables.resource.type.data_view": "data_view",
|
|
21
|
-
"queryables.resource.type.reference_dataset": "reference_dataset",
|
|
22
|
-
"queryables.resource.type.data_structure": "data_structure",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
5
|
describe("<Join />", () => {
|
|
28
|
-
it("matches the latest snapshot", () => {
|
|
29
|
-
const
|
|
6
|
+
it("matches the latest snapshot", async () => {
|
|
7
|
+
const rendered = render(
|
|
30
8
|
<TestFormWrapper>
|
|
31
9
|
<Join />
|
|
32
|
-
</TestFormWrapper
|
|
33
|
-
renderOpts
|
|
10
|
+
</TestFormWrapper>
|
|
34
11
|
);
|
|
35
|
-
|
|
36
|
-
expect(container).toMatchSnapshot();
|
|
12
|
+
await waitForLoad(rendered);
|
|
13
|
+
expect(rendered.container).toMatchSnapshot();
|
|
37
14
|
});
|
|
38
15
|
});
|
|
@@ -1,39 +1,22 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { act } from "react-dom/test-utils";
|
|
3
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
3
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
5
|
-
import { render } from "@truedat/test/render";
|
|
6
|
-
|
|
7
4
|
import Select from "../Select";
|
|
8
5
|
|
|
9
|
-
const renderOpts = {
|
|
10
|
-
messages: {
|
|
11
|
-
en: {
|
|
12
|
-
"dataViews.form.error.empty_select": "empty_select",
|
|
13
|
-
"queryables.select.form.add_select_field": "add_select_field",
|
|
14
|
-
"queryables.select.form.add_all_select_fields": "add_all_select_fields",
|
|
15
|
-
"queryables.select.form.alias": "alias",
|
|
16
|
-
"functions.expression.shape.field": "field",
|
|
17
|
-
"functions.expression.shape.function": "function",
|
|
18
|
-
"functions.expression.shape.constant": "constant",
|
|
19
|
-
"functions.form.required": "required",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
6
|
describe("<Select />", () => {
|
|
25
|
-
it("matches the latest snapshot", () => {
|
|
26
|
-
const
|
|
7
|
+
it("matches the latest snapshot", async () => {
|
|
8
|
+
const rendered = render(
|
|
27
9
|
<TestFormWrapper>
|
|
28
10
|
<Select />
|
|
29
|
-
</TestFormWrapper
|
|
30
|
-
renderOpts
|
|
11
|
+
</TestFormWrapper>
|
|
31
12
|
);
|
|
32
|
-
|
|
33
|
-
expect(container).toMatchSnapshot();
|
|
13
|
+
await waitForLoad(rendered);
|
|
14
|
+
expect(rendered.container).toMatchSnapshot();
|
|
34
15
|
});
|
|
16
|
+
|
|
35
17
|
it("matches the latest snapshot with content", async () => {
|
|
36
|
-
const {
|
|
18
|
+
const user = userEvent.setup({ delay: null });
|
|
19
|
+
const rendered = render(
|
|
37
20
|
<TestFormWrapper
|
|
38
21
|
context={{
|
|
39
22
|
fields: [{ name: "abc", id: 1 }],
|
|
@@ -73,20 +56,19 @@ describe("<Select />", () => {
|
|
|
73
56
|
}}
|
|
74
57
|
>
|
|
75
58
|
<Select />
|
|
76
|
-
</TestFormWrapper
|
|
77
|
-
renderOpts
|
|
59
|
+
</TestFormWrapper>
|
|
78
60
|
);
|
|
61
|
+
await waitForLoad(rendered);
|
|
79
62
|
|
|
80
|
-
await
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
await act(async () => {
|
|
85
|
-
expect(container).toMatchSnapshot();
|
|
86
|
-
});
|
|
63
|
+
await user.click(
|
|
64
|
+
rendered.getByRole("button", { name: /add_select_field/i })
|
|
65
|
+
);
|
|
66
|
+
expect(rendered.container).toMatchSnapshot();
|
|
87
67
|
});
|
|
68
|
+
|
|
88
69
|
it("handles add all fields", async () => {
|
|
89
|
-
const {
|
|
70
|
+
const user = userEvent.setup({ delay: null });
|
|
71
|
+
const rendered = render(
|
|
90
72
|
<TestFormWrapper
|
|
91
73
|
context={{
|
|
92
74
|
fields: [{ name: "abc", id: 1 }],
|
|
@@ -123,22 +105,16 @@ describe("<Select />", () => {
|
|
|
123
105
|
}}
|
|
124
106
|
>
|
|
125
107
|
<Select />
|
|
126
|
-
</TestFormWrapper
|
|
127
|
-
renderOpts
|
|
108
|
+
</TestFormWrapper>
|
|
128
109
|
);
|
|
110
|
+
await waitForLoad(rendered);
|
|
129
111
|
|
|
130
|
-
await
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
await act(async () => {
|
|
137
|
-
userEvent.click(getByRole("button", { name: /delete/i }));
|
|
138
|
-
});
|
|
112
|
+
await user.click(
|
|
113
|
+
rendered.getByRole("button", { name: /add_all_select_fields/i })
|
|
114
|
+
);
|
|
115
|
+
await user.hover(rendered.getAllByRole("textbox")[0]);
|
|
116
|
+
await user.click(rendered.getByRole("button", { name: /delete/i }));
|
|
139
117
|
|
|
140
|
-
|
|
141
|
-
expect(container).toMatchSnapshot();
|
|
142
|
-
});
|
|
118
|
+
expect(rendered.container).toMatchSnapshot();
|
|
143
119
|
});
|
|
144
120
|
});
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { act } from "react-dom/test-utils";
|
|
3
|
-
import { waitFor } from "@testing-library/react";
|
|
4
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
3
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
|
-
import { render } from "@truedat/test/render";
|
|
7
|
-
|
|
8
4
|
import SelectField from "../SelectField";
|
|
9
5
|
|
|
10
|
-
const renderOpts = {
|
|
11
|
-
messages: {
|
|
12
|
-
en: {
|
|
13
|
-
"dataViews.form.queryable.alias.duplicated": "duplicated",
|
|
14
|
-
"functions.form.required": "required",
|
|
15
|
-
"queryables.select.form.alias": "alias",
|
|
16
|
-
"functions.form.expression.function.placeholder": "placeholder",
|
|
17
|
-
"functions.expression.shape.function": "function",
|
|
18
|
-
"functions.expression.shape.constant": "constant",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
fallback: "loading",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
6
|
describe("<SelectField />", () => {
|
|
25
7
|
it("matches the latest snapshot for select", async () => {
|
|
26
|
-
const
|
|
8
|
+
const rendered = render(
|
|
27
9
|
<TestFormWrapper
|
|
28
10
|
context={{
|
|
29
11
|
field: "select.properties.fields[0]",
|
|
@@ -38,17 +20,13 @@ describe("<SelectField />", () => {
|
|
|
38
20
|
}}
|
|
39
21
|
>
|
|
40
22
|
<SelectField />
|
|
41
|
-
</TestFormWrapper
|
|
42
|
-
renderOpts
|
|
23
|
+
</TestFormWrapper>
|
|
43
24
|
);
|
|
44
|
-
await
|
|
45
|
-
|
|
46
|
-
);
|
|
47
|
-
expect(container).toMatchSnapshot();
|
|
25
|
+
await waitForLoad(rendered);
|
|
26
|
+
expect(rendered.container).toMatchSnapshot();
|
|
48
27
|
});
|
|
49
|
-
|
|
50
28
|
it("matches the latest snapshot for group_by", async () => {
|
|
51
|
-
const
|
|
29
|
+
const rendered = render(
|
|
52
30
|
<TestFormWrapper
|
|
53
31
|
context={{
|
|
54
32
|
functions: [{ class: "aggregator", name: "func", type: "number" }],
|
|
@@ -67,18 +45,15 @@ describe("<SelectField />", () => {
|
|
|
67
45
|
}}
|
|
68
46
|
>
|
|
69
47
|
<SelectField />
|
|
70
|
-
</TestFormWrapper
|
|
71
|
-
renderOpts
|
|
48
|
+
</TestFormWrapper>
|
|
72
49
|
);
|
|
73
|
-
await
|
|
74
|
-
|
|
75
|
-
);
|
|
76
|
-
expect(container).toMatchSnapshot();
|
|
50
|
+
await waitForLoad(rendered);
|
|
51
|
+
expect(rendered.container).toMatchSnapshot();
|
|
77
52
|
});
|
|
78
|
-
|
|
79
53
|
it("handles delete", async () => {
|
|
54
|
+
const user = userEvent.setup({ delay: null, skipHover: true });
|
|
80
55
|
const onDelete = jest.fn();
|
|
81
|
-
const
|
|
56
|
+
const rendered = render(
|
|
82
57
|
<TestFormWrapper
|
|
83
58
|
context={{
|
|
84
59
|
functions: [{ class: "aggregator", name: "func", type: "number" }],
|
|
@@ -97,17 +72,17 @@ describe("<SelectField />", () => {
|
|
|
97
72
|
}}
|
|
98
73
|
>
|
|
99
74
|
<SelectField onDelete={onDelete} />
|
|
100
|
-
</TestFormWrapper
|
|
101
|
-
renderOpts
|
|
75
|
+
</TestFormWrapper>
|
|
102
76
|
);
|
|
77
|
+
await waitForLoad(rendered);
|
|
78
|
+
|
|
79
|
+
const { getByRole, getAllByRole } = rendered;
|
|
103
80
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
81
|
+
await user.hover(getAllByRole("textbox")[0]);
|
|
82
|
+
await user.unhover(getAllByRole("textbox")[0]);
|
|
83
|
+
await user.hover(getAllByRole("textbox")[0]);
|
|
107
84
|
|
|
108
|
-
await
|
|
109
|
-
userEvent.click(getByRole("button", { name: /delete/i }));
|
|
110
|
-
});
|
|
85
|
+
await user.click(getByRole("button", { name: /delete/i }));
|
|
111
86
|
|
|
112
87
|
expect(onDelete).toHaveBeenCalledTimes(1);
|
|
113
88
|
});
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
2
2
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
3
|
-
import { render } from "@truedat/test/render";
|
|
4
|
-
|
|
5
3
|
import Where from "../Where";
|
|
6
4
|
|
|
7
|
-
const renderOpts = {
|
|
8
|
-
messages: {
|
|
9
|
-
en: {
|
|
10
|
-
"expression.clause.action.addGroup": "Add Group",
|
|
11
|
-
"expression.form.clause": "Clause",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
5
|
describe("<Where />", () => {
|
|
17
|
-
it("matches the latest snapshot", () => {
|
|
18
|
-
const
|
|
6
|
+
it("matches the latest snapshot", async () => {
|
|
7
|
+
const rendered = render(
|
|
19
8
|
<TestFormWrapper>
|
|
20
9
|
<Where />
|
|
21
|
-
</TestFormWrapper
|
|
22
|
-
renderOpts
|
|
10
|
+
</TestFormWrapper>
|
|
23
11
|
);
|
|
12
|
+
await waitForLoad(rendered);
|
|
24
13
|
|
|
25
|
-
expect(container).toMatchSnapshot();
|
|
14
|
+
expect(rendered.container).toMatchSnapshot();
|
|
26
15
|
});
|
|
27
16
|
});
|