@truedat/qx 7.5.7 → 7.5.9
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 +4 -4
- package/src/components/__tests__/__fixtures__/helper.js +6 -7
- package/src/components/common/expressions/__tests__/Expression.spec.js +3 -22
- package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +6 -18
- package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +0 -5
- package/src/components/qualityControls/ControlProperties.js +4 -3
- package/src/components/qualityControls/ControlPropertiesView.js +5 -4
- package/src/components/qualityControls/QualityBadge.js +11 -2
- package/src/components/qualityControls/QualityControlEditor.js +1 -1
- package/src/components/qualityControls/ScoreCriteria.js +4 -0
- package/src/components/qualityControls/ScoreCriteriaView.js +34 -53
- package/src/components/qualityControls/__tests__/ControlProperties.spec.js +6 -6
- package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +5 -5
- package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +15 -2
- package/src/components/qualityControls/__tests__/QualityBadge.spec.js +6 -6
- package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +1 -1
- package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +1 -1
- package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +3 -3
- package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +18 -2
- package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +1 -1
- 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 +14 -1
- package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +14 -1
- package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +14 -1
- package/src/components/qualityControls/__tests__/__snapshots__/QualityBadge.spec.js.snap +1 -1
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +2 -4
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +28 -2
- 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} +2 -2
- package/src/components/qualityControls/controlProperties/__tests__/{ErrorCount.spec.js → Count.spec.js} +3 -14
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/{ErrorCount.spec.js.snap → Count.spec.js.snap} +5 -5
- package/src/components/qualityControls/qualityByControlMode.js +29 -6
- package/src/components/qualityControls/scoreCriterias/Count.js +88 -0
- package/src/components/qualityControls/scoreCriterias/ErrorCount.js +1 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/Count.spec.js +62 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +16 -4
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Count.spec.js.snap +58 -0
- package/src/components/scores/__tests__/MyScoreGroups.spec.js +2 -2
|
@@ -101,25 +101,25 @@ describe("<QualityBadgeForSearch />", () => {
|
|
|
101
101
|
expect(container).toMatchSnapshot();
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
it("matches the latest snapshot for
|
|
104
|
+
it("matches the latest snapshot for count", () => {
|
|
105
105
|
const scoreCriteria = {
|
|
106
106
|
goal: 78,
|
|
107
107
|
maximum: 90,
|
|
108
108
|
};
|
|
109
109
|
const latestScore = {
|
|
110
110
|
executed_at: "2025-03-25T05:34:21.438113Z",
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
count_content: {
|
|
112
|
+
count: 200,
|
|
113
113
|
},
|
|
114
114
|
result: 200,
|
|
115
115
|
result_message: "under_threshold",
|
|
116
116
|
status: "succeeded",
|
|
117
|
-
type: "
|
|
117
|
+
type: "count",
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const { container } = render(
|
|
121
121
|
<QualityBadgeForSearch
|
|
122
|
-
controlMode={"
|
|
122
|
+
controlMode={"count"}
|
|
123
123
|
criteria={scoreCriteria}
|
|
124
124
|
latestScore={latestScore}
|
|
125
125
|
/>,
|
|
@@ -161,7 +161,7 @@ describe("<QualityBadgeForSearch />", () => {
|
|
|
161
161
|
};
|
|
162
162
|
const { container } = render(
|
|
163
163
|
<QualityBadgeForSearch
|
|
164
|
-
controlMode={"
|
|
164
|
+
controlMode={"count"}
|
|
165
165
|
criteria={scoreCriteria}
|
|
166
166
|
latestScore={latestScore}
|
|
167
167
|
/>,
|
|
@@ -270,7 +270,7 @@ describe("<QualityControlEditor />", () => {
|
|
|
270
270
|
userEvent.click(getByText(/Select source/));
|
|
271
271
|
userEvent.click(getByRole("option", { name: /external_source_id/i }));
|
|
272
272
|
|
|
273
|
-
userEvent.click(getByRole("option", { name:
|
|
273
|
+
userEvent.click(getByRole("option", { name: /^count$/i }));
|
|
274
274
|
|
|
275
275
|
// Fill in the 'Goal' field
|
|
276
276
|
userEvent.type(getByPlaceholderText("Goal"), "25");
|
|
@@ -21,9 +21,9 @@ describe("<ScoreCriteria />", () => {
|
|
|
21
21
|
expect(container).toMatchSnapshot();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
it("matches the latest snapshot for
|
|
24
|
+
it("matches the latest snapshot for count", () => {
|
|
25
25
|
const defaultValues = {
|
|
26
|
-
control_mode: "
|
|
26
|
+
control_mode: "count",
|
|
27
27
|
};
|
|
28
28
|
const { container } = render(
|
|
29
29
|
<TestFormWrapper defaultValues={defaultValues}>
|
|
@@ -63,7 +63,7 @@ describe("<ScoreCriteria />", () => {
|
|
|
63
63
|
[
|
|
64
64
|
{ controlMode: "deviation", expectedValue: { goal: null, maximum: null } },
|
|
65
65
|
{
|
|
66
|
-
controlMode: "
|
|
66
|
+
controlMode: "count",
|
|
67
67
|
expectedValue: { goal: null, maximum: null },
|
|
68
68
|
},
|
|
69
69
|
{ controlMode: "percentage", expectedValue: { goal: null, minimum: null } },
|
|
@@ -32,9 +32,25 @@ describe("<ScoreCriteriaView />", () => {
|
|
|
32
32
|
expect(queryByText(/5/i)).toBeInTheDocument();
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
it("view for
|
|
35
|
+
it("view for error_count", () => {
|
|
36
36
|
const qc = qualityControlData({
|
|
37
37
|
control_mode: "error_count",
|
|
38
|
+
score_criteria: {
|
|
39
|
+
goal: 5,
|
|
40
|
+
maximum: 30,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
const { queryByText } = render(
|
|
44
|
+
<ScoreCriteriaView qualityControl={qc} />,
|
|
45
|
+
renderOpts
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
expect(queryByText(/5/i)).toBeInTheDocument();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("view for count", () => {
|
|
52
|
+
const qc = qualityControlData({
|
|
53
|
+
control_mode: "count",
|
|
38
54
|
score_criteria: {
|
|
39
55
|
goal: 15,
|
|
40
56
|
maximum: 40,
|
|
@@ -49,7 +65,7 @@ describe("<ScoreCriteriaView />", () => {
|
|
|
49
65
|
|
|
50
66
|
it("view for empty score_criteria", () => {
|
|
51
67
|
const qc = qualityControlData({
|
|
52
|
-
control_mode: "
|
|
68
|
+
control_mode: "count",
|
|
53
69
|
score_criteria: undefined,
|
|
54
70
|
});
|
|
55
71
|
const { queryByText } = render(
|
package/src/components/qualityControls/__tests__/__snapshots__/ControlPropertiesView.spec.js.snap
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<ControlPropertiesView /> matches the latest snapshot for
|
|
3
|
+
exports[`<ControlPropertiesView /> matches the latest snapshot for count 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<h3
|
|
6
6
|
class="ui header"
|
|
@@ -18,12 +18,42 @@ exports[`<ControlPropertiesView /> matches the latest snapshot for empty control
|
|
|
18
18
|
<div
|
|
19
19
|
class="ui segment"
|
|
20
20
|
>
|
|
21
|
-
|
|
21
|
+
<div
|
|
22
|
+
class="ui list"
|
|
23
|
+
role="list"
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
class="item"
|
|
27
|
+
role="listitem"
|
|
28
|
+
>
|
|
29
|
+
<div
|
|
30
|
+
class="header"
|
|
31
|
+
>
|
|
32
|
+
Dataset
|
|
33
|
+
</div>
|
|
34
|
+
<div
|
|
35
|
+
class="content"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
class="description"
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
class="ui horizontal label"
|
|
42
|
+
>
|
|
43
|
+
Data Structure
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
class="ui blue label"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
22
52
|
</div>
|
|
23
53
|
</div>
|
|
24
54
|
`;
|
|
25
55
|
|
|
26
|
-
exports[`<ControlPropertiesView /> matches the latest snapshot for empty
|
|
56
|
+
exports[`<ControlPropertiesView /> matches the latest snapshot for empty control properties 1`] = `
|
|
27
57
|
<div>
|
|
28
58
|
<h3
|
|
29
59
|
class="ui header"
|
|
@@ -41,31 +71,12 @@ exports[`<ControlPropertiesView /> matches the latest snapshot for empty errors_
|
|
|
41
71
|
<div
|
|
42
72
|
class="ui segment"
|
|
43
73
|
>
|
|
44
|
-
|
|
45
|
-
class="ui list"
|
|
46
|
-
role="list"
|
|
47
|
-
>
|
|
48
|
-
<div
|
|
49
|
-
class="item"
|
|
50
|
-
role="listitem"
|
|
51
|
-
>
|
|
52
|
-
<div
|
|
53
|
-
class="header"
|
|
54
|
-
>
|
|
55
|
-
Dataset
|
|
56
|
-
</div>
|
|
57
|
-
<div
|
|
58
|
-
class="content"
|
|
59
|
-
>
|
|
60
|
-
Empty Dataset
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
74
|
+
Empty control properties
|
|
64
75
|
</div>
|
|
65
76
|
</div>
|
|
66
77
|
`;
|
|
67
78
|
|
|
68
|
-
exports[`<ControlPropertiesView /> matches the latest snapshot for empty
|
|
79
|
+
exports[`<ControlPropertiesView /> matches the latest snapshot for empty errors_resource 1`] = `
|
|
69
80
|
<div>
|
|
70
81
|
<h3
|
|
71
82
|
class="ui header"
|
|
@@ -99,22 +110,7 @@ exports[`<ControlPropertiesView /> matches the latest snapshot for empty ratio v
|
|
|
99
110
|
<div
|
|
100
111
|
class="content"
|
|
101
112
|
>
|
|
102
|
-
Empty
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
<div
|
|
106
|
-
class="item"
|
|
107
|
-
role="listitem"
|
|
108
|
-
>
|
|
109
|
-
<div
|
|
110
|
-
class="header"
|
|
111
|
-
>
|
|
112
|
-
Validation
|
|
113
|
-
</div>
|
|
114
|
-
<div
|
|
115
|
-
class="content"
|
|
116
|
-
>
|
|
117
|
-
Empty validation
|
|
113
|
+
Empty Dataset
|
|
118
114
|
</div>
|
|
119
115
|
</div>
|
|
120
116
|
</div>
|
|
@@ -122,7 +118,7 @@ exports[`<ControlPropertiesView /> matches the latest snapshot for empty ratio v
|
|
|
122
118
|
</div>
|
|
123
119
|
`;
|
|
124
120
|
|
|
125
|
-
exports[`<ControlPropertiesView /> matches the latest snapshot for
|
|
121
|
+
exports[`<ControlPropertiesView /> matches the latest snapshot for empty ratio validation and resource 1`] = `
|
|
126
122
|
<div>
|
|
127
123
|
<h3
|
|
128
124
|
class="ui header"
|
|
@@ -156,18 +152,22 @@ exports[`<ControlPropertiesView /> matches the latest snapshot for error count 1
|
|
|
156
152
|
<div
|
|
157
153
|
class="content"
|
|
158
154
|
>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
155
|
+
Empty resource
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
<div
|
|
159
|
+
class="item"
|
|
160
|
+
role="listitem"
|
|
161
|
+
>
|
|
162
|
+
<div
|
|
163
|
+
class="header"
|
|
164
|
+
>
|
|
165
|
+
Validation
|
|
166
|
+
</div>
|
|
167
|
+
<div
|
|
168
|
+
class="content"
|
|
169
|
+
>
|
|
170
|
+
Empty validation
|
|
171
171
|
</div>
|
|
172
172
|
</div>
|
|
173
173
|
</div>
|
package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap
CHANGED
|
@@ -298,7 +298,20 @@ exports[`<EditQualityControl /> matches the latest snapshot 1`] = `
|
|
|
298
298
|
<span
|
|
299
299
|
class="text"
|
|
300
300
|
>
|
|
301
|
-
|
|
301
|
+
quality_control.control_mode.error_count
|
|
302
|
+
</span>
|
|
303
|
+
</div>
|
|
304
|
+
<div
|
|
305
|
+
aria-checked="false"
|
|
306
|
+
aria-selected="false"
|
|
307
|
+
class="item"
|
|
308
|
+
role="option"
|
|
309
|
+
style="pointer-events: all;"
|
|
310
|
+
>
|
|
311
|
+
<span
|
|
312
|
+
class="text"
|
|
313
|
+
>
|
|
314
|
+
count
|
|
302
315
|
</span>
|
|
303
316
|
</div>
|
|
304
317
|
</div>
|
package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap
CHANGED
|
@@ -298,7 +298,20 @@ exports[`<NewDraftQualityControl /> matches the latest snapshot 1`] = `
|
|
|
298
298
|
<span
|
|
299
299
|
class="text"
|
|
300
300
|
>
|
|
301
|
-
|
|
301
|
+
quality_control.control_mode.error_count
|
|
302
|
+
</span>
|
|
303
|
+
</div>
|
|
304
|
+
<div
|
|
305
|
+
aria-checked="false"
|
|
306
|
+
aria-selected="false"
|
|
307
|
+
class="item"
|
|
308
|
+
role="option"
|
|
309
|
+
style="pointer-events: all;"
|
|
310
|
+
>
|
|
311
|
+
<span
|
|
312
|
+
class="text"
|
|
313
|
+
>
|
|
314
|
+
count
|
|
302
315
|
</span>
|
|
303
316
|
</div>
|
|
304
317
|
</div>
|
package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap
CHANGED
|
@@ -295,7 +295,20 @@ exports[`<NewQualityControl /> matches the latest snapshot 1`] = `
|
|
|
295
295
|
<span
|
|
296
296
|
class="text"
|
|
297
297
|
>
|
|
298
|
-
|
|
298
|
+
quality_control.control_mode.error_count
|
|
299
|
+
</span>
|
|
300
|
+
</div>
|
|
301
|
+
<div
|
|
302
|
+
aria-checked="false"
|
|
303
|
+
aria-selected="false"
|
|
304
|
+
class="item"
|
|
305
|
+
role="option"
|
|
306
|
+
style="pointer-events: all;"
|
|
307
|
+
>
|
|
308
|
+
<span
|
|
309
|
+
class="text"
|
|
310
|
+
>
|
|
311
|
+
count
|
|
299
312
|
</span>
|
|
300
313
|
</div>
|
|
301
314
|
</div>
|
|
@@ -20,7 +20,7 @@ exports[`<QualityBadgeForSearch /> matches the latest snapshot for deviation 1`]
|
|
|
20
20
|
</div>
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
|
-
exports[`<QualityBadgeForSearch /> matches the latest snapshot for
|
|
23
|
+
exports[`<QualityBadgeForSearch /> matches the latest snapshot for count 1`] = `
|
|
24
24
|
<div>
|
|
25
25
|
<i
|
|
26
26
|
aria-hidden="true"
|
|
@@ -77,8 +77,7 @@ exports[`<QualityControl /> matches the latest snapshot 1`] = `
|
|
|
77
77
|
<div
|
|
78
78
|
class="description"
|
|
79
79
|
>
|
|
80
|
-
20
|
|
81
|
-
%
|
|
80
|
+
20%
|
|
82
81
|
</div>
|
|
83
82
|
</div>
|
|
84
83
|
</div>
|
|
@@ -101,8 +100,7 @@ exports[`<QualityControl /> matches the latest snapshot 1`] = `
|
|
|
101
100
|
<div
|
|
102
101
|
class="description"
|
|
103
102
|
>
|
|
104
|
-
10
|
|
105
|
-
%
|
|
103
|
+
10%
|
|
106
104
|
</div>
|
|
107
105
|
</div>
|
|
108
106
|
</div>
|
package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap
CHANGED
|
@@ -270,7 +270,20 @@ exports[`<QualityControlEditor /> matches the latest snapshot for creation 1`] =
|
|
|
270
270
|
<span
|
|
271
271
|
class="text"
|
|
272
272
|
>
|
|
273
|
-
|
|
273
|
+
quality_control.control_mode.error_count
|
|
274
|
+
</span>
|
|
275
|
+
</div>
|
|
276
|
+
<div
|
|
277
|
+
aria-checked="false"
|
|
278
|
+
aria-selected="false"
|
|
279
|
+
class="item"
|
|
280
|
+
role="option"
|
|
281
|
+
style="pointer-events: all;"
|
|
282
|
+
>
|
|
283
|
+
<span
|
|
284
|
+
class="text"
|
|
285
|
+
>
|
|
286
|
+
count
|
|
274
287
|
</span>
|
|
275
288
|
</div>
|
|
276
289
|
</div>
|
|
@@ -580,7 +593,20 @@ exports[`<QualityControlEditor /> matches the latest snapshot for edition 1`] =
|
|
|
580
593
|
<span
|
|
581
594
|
class="text"
|
|
582
595
|
>
|
|
583
|
-
|
|
596
|
+
quality_control.control_mode.error_count
|
|
597
|
+
</span>
|
|
598
|
+
</div>
|
|
599
|
+
<div
|
|
600
|
+
aria-checked="false"
|
|
601
|
+
aria-selected="false"
|
|
602
|
+
class="item"
|
|
603
|
+
role="option"
|
|
604
|
+
style="pointer-events: all;"
|
|
605
|
+
>
|
|
606
|
+
<span
|
|
607
|
+
class="text"
|
|
608
|
+
>
|
|
609
|
+
count
|
|
584
610
|
</span>
|
|
585
611
|
</div>
|
|
586
612
|
</div>
|
|
@@ -63,7 +63,7 @@ exports[`<ScoreCriteria /> matches the latest snapshot for deviation 1`] = `
|
|
|
63
63
|
|
|
64
64
|
exports[`<ScoreCriteria /> matches the latest snapshot for empty controlMode 1`] = `<div />`;
|
|
65
65
|
|
|
66
|
-
exports[`<ScoreCriteria /> matches the latest snapshot for
|
|
66
|
+
exports[`<ScoreCriteria /> matches the latest snapshot for count 1`] = `
|
|
67
67
|
<div>
|
|
68
68
|
<div
|
|
69
69
|
class="ui segment"
|
package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteriaView.spec.js.snap
CHANGED
|
@@ -41,8 +41,7 @@ exports[`<ScoreCriteriaView /> matches the latest snapshot for percentage 1`] =
|
|
|
41
41
|
<div
|
|
42
42
|
class="description"
|
|
43
43
|
>
|
|
44
|
-
20
|
|
45
|
-
%
|
|
44
|
+
20%
|
|
46
45
|
</div>
|
|
47
46
|
</div>
|
|
48
47
|
</div>
|
|
@@ -65,8 +64,7 @@ exports[`<ScoreCriteriaView /> matches the latest snapshot for percentage 1`] =
|
|
|
65
64
|
<div
|
|
66
65
|
class="description"
|
|
67
66
|
>
|
|
68
|
-
10
|
|
69
|
-
%
|
|
67
|
+
10%
|
|
70
68
|
</div>
|
|
71
69
|
</div>
|
|
72
70
|
</div>
|
|
@@ -154,13 +154,13 @@ describe("qualityByControlMode", () => {
|
|
|
154
154
|
expect(qualityByControlMode(score)).toEqual(result);
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
it("returns correct object when controlMode is
|
|
157
|
+
it("returns correct object when controlMode is count with green", () => {
|
|
158
158
|
const score = scoreData({
|
|
159
159
|
score_content: {
|
|
160
|
-
|
|
160
|
+
count: 10,
|
|
161
161
|
},
|
|
162
162
|
quality_control: {
|
|
163
|
-
control_mode: "
|
|
163
|
+
control_mode: "count",
|
|
164
164
|
score_criteria: {
|
|
165
165
|
maximum: 30,
|
|
166
166
|
goal: 20,
|
|
@@ -169,8 +169,8 @@ describe("qualityByControlMode", () => {
|
|
|
169
169
|
});
|
|
170
170
|
const result = {
|
|
171
171
|
color: "green",
|
|
172
|
-
label1: "quality_control.score_criteria.
|
|
173
|
-
label2: "quality_control.score_criteria.
|
|
172
|
+
label1: "quality_control.score_criteria.count.goal",
|
|
173
|
+
label2: "quality_control.score_criteria.count.maximum",
|
|
174
174
|
text: 10,
|
|
175
175
|
value1: 20,
|
|
176
176
|
value2: 30,
|
|
@@ -178,13 +178,13 @@ describe("qualityByControlMode", () => {
|
|
|
178
178
|
expect(qualityByControlMode(score)).toEqual(result);
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
it("returns correct object when controlMode is
|
|
181
|
+
it("returns correct object when controlMode is count with yellow", () => {
|
|
182
182
|
const score = scoreData({
|
|
183
183
|
score_content: {
|
|
184
|
-
|
|
184
|
+
count: 20,
|
|
185
185
|
},
|
|
186
186
|
quality_control: {
|
|
187
|
-
control_mode: "
|
|
187
|
+
control_mode: "count",
|
|
188
188
|
|
|
189
189
|
score_criteria: {
|
|
190
190
|
maximum: 30,
|
|
@@ -194,8 +194,8 @@ describe("qualityByControlMode", () => {
|
|
|
194
194
|
});
|
|
195
195
|
const result = {
|
|
196
196
|
color: "yellow",
|
|
197
|
-
label1: "quality_control.score_criteria.
|
|
198
|
-
label2: "quality_control.score_criteria.
|
|
197
|
+
label1: "quality_control.score_criteria.count.goal",
|
|
198
|
+
label2: "quality_control.score_criteria.count.maximum",
|
|
199
199
|
text: 20,
|
|
200
200
|
value1: 20,
|
|
201
201
|
value2: 30,
|
|
@@ -203,13 +203,13 @@ describe("qualityByControlMode", () => {
|
|
|
203
203
|
expect(qualityByControlMode(score)).toEqual(result);
|
|
204
204
|
});
|
|
205
205
|
|
|
206
|
-
it("returns correct object when controlMode is
|
|
206
|
+
it("returns correct object when controlMode is count with red", () => {
|
|
207
207
|
const score = scoreData({
|
|
208
208
|
score_content: {
|
|
209
|
-
|
|
209
|
+
count: 40,
|
|
210
210
|
},
|
|
211
211
|
quality_control: {
|
|
212
|
-
control_mode: "
|
|
212
|
+
control_mode: "count",
|
|
213
213
|
|
|
214
214
|
score_criteria: {
|
|
215
215
|
maximum: 30,
|
|
@@ -219,8 +219,8 @@ describe("qualityByControlMode", () => {
|
|
|
219
219
|
});
|
|
220
220
|
const result = {
|
|
221
221
|
color: "red",
|
|
222
|
-
label1: "quality_control.score_criteria.
|
|
223
|
-
label2: "quality_control.score_criteria.
|
|
222
|
+
label1: "quality_control.score_criteria.count.goal",
|
|
223
|
+
label2: "quality_control.score_criteria.count.maximum",
|
|
224
224
|
text: 40,
|
|
225
225
|
value1: 20,
|
|
226
226
|
value2: 30,
|
|
@@ -231,7 +231,7 @@ describe("qualityByControlMode", () => {
|
|
|
231
231
|
it("returns correct object when controlMode is not defined", () => {
|
|
232
232
|
const score = scoreData({
|
|
233
233
|
score_content: {
|
|
234
|
-
|
|
234
|
+
count: 10,
|
|
235
235
|
},
|
|
236
236
|
quality_control: {
|
|
237
237
|
control_mode: "foo",
|
|
@@ -10,7 +10,7 @@ import { useDataViews } from "@truedat/qx/hooks/useDataViews";
|
|
|
10
10
|
import { useFunctions } from "@truedat/qx/hooks/useFunctions";
|
|
11
11
|
import ResourceSelector from "@truedat/qx/components/common/ResourceSelector";
|
|
12
12
|
|
|
13
|
-
export default function
|
|
13
|
+
export default function Count() {
|
|
14
14
|
const { field } = useContext(QxContext);
|
|
15
15
|
const { watch } = useFormContext();
|
|
16
16
|
|
|
@@ -48,7 +48,7 @@ export default function ErrorCount() {
|
|
|
48
48
|
>
|
|
49
49
|
<ResourceSelector
|
|
50
50
|
required
|
|
51
|
-
labelId="quality_control.form.control_properties.
|
|
51
|
+
labelId="quality_control.form.control_properties.count.errors_resource"
|
|
52
52
|
/>
|
|
53
53
|
</QxContext.Provider>
|
|
54
54
|
</>
|
|
@@ -3,7 +3,7 @@ import { render } from "@truedat/test/render";
|
|
|
3
3
|
import { waitFor } from "@testing-library/react";
|
|
4
4
|
import { REFERENCE_DATASETS_HEADERS_QUERY } from "@truedat/dd/api/queries";
|
|
5
5
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
|
-
import
|
|
6
|
+
import Count from "../Count";
|
|
7
7
|
|
|
8
8
|
jest.mock("@truedat/qx/hooks/useDataViews", () => {
|
|
9
9
|
const originalModule = jest.requireActual("@truedat/qx/hooks/useDataViews");
|
|
@@ -36,20 +36,9 @@ const referenceDatasetsMock = {
|
|
|
36
36
|
result: { data: { referenceDatasets: [dataSet], loading: false } },
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const messages = {
|
|
40
|
-
en: {
|
|
41
|
-
"quality_control.form.control_properties.error_count.errors_resource":
|
|
42
|
-
"Dataset",
|
|
43
|
-
"queryables.resource.type": "Resource type",
|
|
44
|
-
"queryables.resource.type.data_structure": "Data structures",
|
|
45
|
-
"queryables.resource.type.reference_dataset": "Reference datasets",
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
39
|
const renderOpts = {
|
|
50
40
|
mocks: [referenceDatasetsMock],
|
|
51
41
|
fallback: "lazy",
|
|
52
|
-
messages,
|
|
53
42
|
};
|
|
54
43
|
|
|
55
44
|
const context = {
|
|
@@ -65,11 +54,11 @@ const context = {
|
|
|
65
54
|
],
|
|
66
55
|
};
|
|
67
56
|
|
|
68
|
-
describe("<
|
|
57
|
+
describe("<Count />", () => {
|
|
69
58
|
it("matches the latest snapshot", async () => {
|
|
70
59
|
const { container, queryByText } = render(
|
|
71
60
|
<TestFormWrapper context={context}>
|
|
72
|
-
<
|
|
61
|
+
<Count />
|
|
73
62
|
</TestFormWrapper>,
|
|
74
63
|
renderOpts
|
|
75
64
|
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<
|
|
3
|
+
exports[`<Count /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
6
|
class="required field"
|
|
7
7
|
>
|
|
8
8
|
<label>
|
|
9
|
-
|
|
9
|
+
quality_control.form.control_properties.count.errors_resource
|
|
10
10
|
</label>
|
|
11
11
|
<div
|
|
12
12
|
aria-expanded="false"
|
|
@@ -20,7 +20,7 @@ exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
|
20
20
|
class="divider default text"
|
|
21
21
|
role="alert"
|
|
22
22
|
>
|
|
23
|
-
|
|
23
|
+
queryables.resource.type
|
|
24
24
|
</div>
|
|
25
25
|
<i
|
|
26
26
|
aria-hidden="true"
|
|
@@ -39,7 +39,7 @@ exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
|
39
39
|
<span
|
|
40
40
|
class="text"
|
|
41
41
|
>
|
|
42
|
-
|
|
42
|
+
queryables.resource.type.data_structure
|
|
43
43
|
</span>
|
|
44
44
|
</div>
|
|
45
45
|
<div
|
|
@@ -52,7 +52,7 @@ exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
|
52
52
|
<span
|
|
53
53
|
class="text"
|
|
54
54
|
>
|
|
55
|
-
|
|
55
|
+
queryables.resource.type.reference_dataset
|
|
56
56
|
</span>
|
|
57
57
|
</div>
|
|
58
58
|
</div>
|