@truedat/dq 4.33.10 → 4.34.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/CHANGELOG.md +7 -0
- package/package.json +5 -5
- package/src/components/ConditionSummary.js +23 -21
- package/src/components/ExecutionDetails.js +11 -14
- package/src/components/ExecutionGroup.js +24 -15
- package/src/components/ImplementationResultBar.js +80 -0
- package/src/components/ImplementationSummary.js +33 -72
- package/src/components/InformationSummary.js +68 -0
- package/src/components/NewRuleImplementation.js +12 -0
- package/src/components/RuleForm.js +0 -178
- package/src/components/RuleImplementation.js +10 -6
- package/src/components/RuleImplementationProperties.js +31 -64
- package/src/components/RuleImplementationResults.js +87 -53
- package/src/components/RuleProperties.js +1 -10
- package/src/components/RuleResultDecorator.js +43 -26
- package/src/components/RuleResultRow.js +4 -1
- package/src/components/RuleRoutes.js +0 -13
- package/src/components/RuleSummary.js +15 -2
- package/src/components/__tests__/ExecutionGroup.spec.js +11 -7
- package/src/components/__tests__/ImplementationResultBar.spec.js +98 -0
- package/src/components/__tests__/ImplementationSummary.spec.js +9 -26
- package/src/components/__tests__/InformationSummary.spec.js +35 -0
- package/src/components/__tests__/NewRuleImplementation.spec.js +1 -1
- package/src/components/__tests__/RuleForm.spec.js +0 -191
- package/src/components/__tests__/RuleImplementation.spec.js +1 -0
- package/src/components/__tests__/RuleImplementationProperties.spec.js +23 -33
- package/src/components/__tests__/RuleProperties.spec.js +7 -9
- package/src/components/__tests__/RuleResultDecorator.spec.js +17 -11
- package/src/components/__tests__/RuleResultRow.spec.js +25 -46
- package/src/components/__tests__/RuleRow.spec.js +0 -4
- package/src/components/__tests__/RuleSummary.spec.js +6 -6
- package/src/components/__tests__/Rules.spec.js +15 -39
- package/src/components/__tests__/__snapshots__/ConditionSummary.spec.js.snap +55 -51
- package/src/components/__tests__/__snapshots__/ExecutionGroup.spec.js.snap +5 -4
- package/src/components/__tests__/__snapshots__/ImplementationResultBar.spec.js.snap +141 -0
- package/src/components/__tests__/__snapshots__/ImplementationSummary.spec.js.snap +194 -457
- package/src/components/__tests__/__snapshots__/InformationSummary.spec.js.snap +185 -0
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +6 -0
- package/src/components/__tests__/__snapshots__/RuleForm.spec.js.snap +0 -148
- package/src/components/__tests__/__snapshots__/RuleImplementation.spec.js.snap +20 -0
- package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +43 -49
- package/src/components/__tests__/__snapshots__/RuleImplementationResults.spec.js.snap +63 -61
- package/src/components/__tests__/__snapshots__/RuleProperties.spec.js.snap +0 -1
- package/src/components/__tests__/__snapshots__/RuleRow.spec.js.snap +0 -28
- package/src/components/__tests__/__snapshots__/Rules.spec.js.snap +0 -101
- package/src/components/ruleImplementationForm/InformationForm.js +5 -5
- package/src/components/ruleImplementationForm/LimitsForm.js +142 -0
- package/src/components/ruleImplementationForm/RuleImplementationForm.js +14 -4
- package/src/components/ruleImplementationForm/RuleImplementationRawForm.js +16 -6
- package/src/components/ruleImplementationForm/__tests__/LimitsForm.spec.js +186 -0
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +42 -35
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/LimitsForm.spec.js.snap +1104 -0
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +4 -1
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationRawForm.spec.js.snap +12 -1
- package/src/components/ruleImplementationForm/limitsValidation.js +72 -0
- package/src/messages/en.js +130 -71
- package/src/messages/es.js +253 -180
- package/src/reducers/__tests__/rule.spec.js +2 -4
- package/src/reducers/__tests__/ruleImplementation.spec.js +2 -0
- package/src/reducers/__tests__/ruleImplementations.spec.js +12 -8
- package/src/reducers/rule.js +0 -3
- package/src/reducers/ruleImplementation.js +3 -0
- package/src/reducers/ruleImplementations.js +3 -0
- package/src/selectors/getRuleImplementationColumns.js +38 -3
- package/src/selectors/ruleColumnsSelector.js +0 -31
- package/src/styles/ruleSummary.less +17 -10
|
@@ -8,10 +8,7 @@ describe("<RuleImplementationProperties />", () => {
|
|
|
8
8
|
rule: {
|
|
9
9
|
business_concept_id: "2D2B3",
|
|
10
10
|
description: "desc1",
|
|
11
|
-
goal: 10,
|
|
12
|
-
minimum: 1,
|
|
13
11
|
rule_type: { name: "type1" },
|
|
14
|
-
result_type: "percentage"
|
|
15
12
|
},
|
|
16
13
|
ruleImplementation: {
|
|
17
14
|
id: 10,
|
|
@@ -22,7 +19,7 @@ describe("<RuleImplementationProperties />", () => {
|
|
|
22
19
|
system: {
|
|
23
20
|
external_id: "Microstrategy",
|
|
24
21
|
id: 1,
|
|
25
|
-
name: "Microstrategy"
|
|
22
|
+
name: "Microstrategy",
|
|
26
23
|
},
|
|
27
24
|
system_params: {
|
|
28
25
|
table: { name: "aaaxxx" },
|
|
@@ -34,15 +31,18 @@ describe("<RuleImplementationProperties />", () => {
|
|
|
34
31
|
"Objetos Públicos",
|
|
35
32
|
"Informes",
|
|
36
33
|
"Validación",
|
|
37
|
-
"ACGC - 01.00 Análisis General Compañía"
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
}
|
|
34
|
+
"ACGC - 01.00 Análisis General Compañía",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
goal: 10,
|
|
39
|
+
minimum: 1,
|
|
40
|
+
result_type: "percentage",
|
|
41
41
|
},
|
|
42
42
|
ruleImplementationResults: [
|
|
43
43
|
{ date: "2019-08-12T02:00:00Z", result: 34 },
|
|
44
|
-
{ date: "2019-08-12T01:00:00Z", result: 33 }
|
|
45
|
-
]
|
|
44
|
+
{ date: "2019-08-12T01:00:00Z", result: 33 },
|
|
45
|
+
],
|
|
46
46
|
};
|
|
47
47
|
const wrapper = shallowWithIntl(
|
|
48
48
|
<RuleImplementationProperties {...props} />
|
|
@@ -55,10 +55,7 @@ describe("<RuleImplementationProperties />", () => {
|
|
|
55
55
|
rule: {
|
|
56
56
|
business_concept_id: "2D2B3",
|
|
57
57
|
description: "desc1",
|
|
58
|
-
goal: 10,
|
|
59
|
-
minimum: 1,
|
|
60
58
|
rule_type: { name: "type1" },
|
|
61
|
-
result_type: "percentage"
|
|
62
59
|
},
|
|
63
60
|
ruleImplementation: {
|
|
64
61
|
id: 10,
|
|
@@ -69,7 +66,7 @@ describe("<RuleImplementationProperties />", () => {
|
|
|
69
66
|
system: {
|
|
70
67
|
external_id: "Microstrategy",
|
|
71
68
|
id: 1,
|
|
72
|
-
name: "Microstrategy"
|
|
69
|
+
name: "Microstrategy",
|
|
73
70
|
},
|
|
74
71
|
system_params: {
|
|
75
72
|
table: { name: "aaaxxx" },
|
|
@@ -81,33 +78,26 @@ describe("<RuleImplementationProperties />", () => {
|
|
|
81
78
|
"Objetos Públicos",
|
|
82
79
|
"Informes",
|
|
83
80
|
"Validación",
|
|
84
|
-
"ACGC - 01.00 Análisis General Compañía"
|
|
85
|
-
]
|
|
86
|
-
}
|
|
87
|
-
}
|
|
81
|
+
"ACGC - 01.00 Análisis General Compañía",
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
goal: 10,
|
|
86
|
+
minimum: 1,
|
|
87
|
+
result_type: "percentage",
|
|
88
88
|
},
|
|
89
89
|
ruleImplementationResults: [
|
|
90
90
|
{ date: "2019-08-12T02:00:00Z", result: 34 },
|
|
91
|
-
{ date: "2019-08-12T01:00:00Z", result: 33 }
|
|
92
|
-
]
|
|
91
|
+
{ date: "2019-08-12T01:00:00Z", result: 33 },
|
|
92
|
+
],
|
|
93
93
|
};
|
|
94
94
|
const wrapper = shallowWithIntl(
|
|
95
95
|
<RuleImplementationProperties {...props} />
|
|
96
96
|
);
|
|
97
|
-
expect(
|
|
98
|
-
wrapper
|
|
99
|
-
.find("Label")
|
|
100
|
-
.at(0)
|
|
101
|
-
.prop("color")
|
|
102
|
-
).toEqual("olive");
|
|
97
|
+
expect(wrapper.find("Label").at(0).prop("color")).toEqual("olive");
|
|
103
98
|
wrapper.setProps({
|
|
104
|
-
ruleImplementation: { ...props.ruleImplementation, executable: false }
|
|
99
|
+
ruleImplementation: { ...props.ruleImplementation, executable: false },
|
|
105
100
|
});
|
|
106
|
-
expect(
|
|
107
|
-
wrapper
|
|
108
|
-
.find("Label")
|
|
109
|
-
.at(0)
|
|
110
|
-
.prop("color")
|
|
111
|
-
).toEqual("teal");
|
|
101
|
+
expect(wrapper.find("Label").at(0).prop("color")).toEqual("teal");
|
|
112
102
|
});
|
|
113
103
|
});
|
|
@@ -3,12 +3,12 @@ import { shallowWithIntl } from "@truedat/test/intl-stub";
|
|
|
3
3
|
import { RuleProperties } from "../RuleProperties";
|
|
4
4
|
|
|
5
5
|
const mockHistory = {
|
|
6
|
-
push: jest.fn()
|
|
6
|
+
push: jest.fn(),
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
jest.mock("react-router-dom", () => ({
|
|
10
10
|
...jest.requireActual("react-router-dom"),
|
|
11
|
-
useHistory: () => mockHistory
|
|
11
|
+
useHistory: () => mockHistory,
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
14
|
describe("<RuleProperties />", () => {
|
|
@@ -24,14 +24,12 @@ describe("<RuleProperties />", () => {
|
|
|
24
24
|
nodes: [
|
|
25
25
|
{
|
|
26
26
|
data: {},
|
|
27
|
-
nodes: [{ marks: [{ data: {}, object: "text", text: "desc1" }] }]
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
27
|
+
nodes: [{ marks: [{ data: {}, object: "text", text: "desc1" }] }],
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
minimum: 1,
|
|
34
|
-
rule_type: { name: "type1" }
|
|
32
|
+
rule_type: { name: "type1" },
|
|
35
33
|
};
|
|
36
34
|
const wrapper = shallowWithIntl(<RuleProperties {...props} />);
|
|
37
35
|
expect(wrapper).toMatchSnapshot();
|
|
@@ -7,8 +7,8 @@ describe("<RuleResultDecorator />", () => {
|
|
|
7
7
|
ruleResult: {
|
|
8
8
|
result: 42,
|
|
9
9
|
errors: 1234,
|
|
10
|
-
result_text: "result_text"
|
|
11
|
-
}
|
|
10
|
+
result_text: "result_text",
|
|
11
|
+
},
|
|
12
12
|
};
|
|
13
13
|
const renderOpts = {
|
|
14
14
|
messages: {
|
|
@@ -17,15 +17,18 @@ describe("<RuleResultDecorator />", () => {
|
|
|
17
17
|
no_data: "no_data_message",
|
|
18
18
|
"quality.result.percentage.description": "{result}%",
|
|
19
19
|
"quality.result.errors_number.description": "{result} errors",
|
|
20
|
-
"quality.result.no.data": "No data"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
20
|
+
"quality.result.no.data": "No data",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
it("decorates a percentage result", () => {
|
|
26
|
-
const
|
|
26
|
+
const ruleImplementation = { result_type: "percentage" };
|
|
27
27
|
const { container, queryByTitle } = render(
|
|
28
|
-
<RuleResultDecorator
|
|
28
|
+
<RuleResultDecorator
|
|
29
|
+
ruleImplementation={ruleImplementation}
|
|
30
|
+
{...props}
|
|
31
|
+
/>,
|
|
29
32
|
renderOpts
|
|
30
33
|
);
|
|
31
34
|
expect(container).toMatchSnapshot();
|
|
@@ -34,9 +37,12 @@ describe("<RuleResultDecorator />", () => {
|
|
|
34
37
|
});
|
|
35
38
|
|
|
36
39
|
it("decorates an error count result", () => {
|
|
37
|
-
const
|
|
40
|
+
const ruleImplementation = { result_type: "errors_number" };
|
|
38
41
|
const { container, queryByTitle } = render(
|
|
39
|
-
<RuleResultDecorator
|
|
42
|
+
<RuleResultDecorator
|
|
43
|
+
ruleImplementation={ruleImplementation}
|
|
44
|
+
{...props}
|
|
45
|
+
/>,
|
|
40
46
|
renderOpts
|
|
41
47
|
);
|
|
42
48
|
expect(container).toMatchSnapshot();
|
|
@@ -45,9 +51,9 @@ describe("<RuleResultDecorator />", () => {
|
|
|
45
51
|
});
|
|
46
52
|
|
|
47
53
|
it("decorates an implementation without result data", () => {
|
|
48
|
-
const
|
|
54
|
+
const ruleImplementation = { result_type: "errors_number" };
|
|
49
55
|
const ruleResult = { result_text: "no_data" };
|
|
50
|
-
const props = {
|
|
56
|
+
const props = { ruleImplementation, ruleResult };
|
|
51
57
|
const { container, queryByTitle } = render(
|
|
52
58
|
<RuleResultDecorator {...props} />,
|
|
53
59
|
renderOpts
|
|
@@ -16,15 +16,15 @@ describe("<RuleResultRow />", () => {
|
|
|
16
16
|
customColumns: [
|
|
17
17
|
{
|
|
18
18
|
name: "m_parm1",
|
|
19
|
-
fieldSelector: _.path("params.p1")
|
|
19
|
+
fieldSelector: _.path("params.p1"),
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
name: "m_parm2",
|
|
23
|
-
fieldSelector: _.path("params.p2")
|
|
24
|
-
}
|
|
23
|
+
fieldSelector: _.path("params.p2"),
|
|
24
|
+
},
|
|
25
25
|
],
|
|
26
26
|
date: "2019-08-12T02:00:00Z",
|
|
27
|
-
|
|
27
|
+
ruleImplementation: { minimum: 1, goal: 10, result_type: "percentage" },
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
|
|
@@ -53,26 +53,19 @@ describe("<RuleResultRow />", () => {
|
|
|
53
53
|
id: 10,
|
|
54
54
|
ruleResult: { result: 80 },
|
|
55
55
|
date: "2019-08-12T02:00:00Z",
|
|
56
|
-
|
|
56
|
+
ruleImplementation: {
|
|
57
57
|
minimum: 1,
|
|
58
58
|
goal: 10,
|
|
59
|
-
result_type: "percentage"
|
|
60
|
-
}
|
|
59
|
+
result_type: "percentage",
|
|
60
|
+
},
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
|
|
64
|
-
const cell = wrapper
|
|
65
|
-
.find("TableRow")
|
|
66
|
-
.find("TableCell")
|
|
67
|
-
.at(0)
|
|
68
|
-
.dive();
|
|
64
|
+
const cell = wrapper.find("TableRow").find("TableCell").at(0).dive();
|
|
69
65
|
|
|
70
66
|
expect(cell.find("td").find("Icon")).toHaveLength(1);
|
|
71
67
|
|
|
72
|
-
const icon = cell
|
|
73
|
-
.find("td")
|
|
74
|
-
.find("Icon")
|
|
75
|
-
.at(0);
|
|
68
|
+
const icon = cell.find("td").find("Icon").at(0);
|
|
76
69
|
|
|
77
70
|
expect(icon.props().color).toBe("green");
|
|
78
71
|
});
|
|
@@ -82,26 +75,19 @@ describe("<RuleResultRow />", () => {
|
|
|
82
75
|
id: 10,
|
|
83
76
|
ruleResult: { result: 80 },
|
|
84
77
|
date: "2019-08-12T02:00:00Z",
|
|
85
|
-
|
|
78
|
+
ruleImplementation: {
|
|
86
79
|
minimum: 81,
|
|
87
80
|
goal: 90,
|
|
88
|
-
result_type: "percentage"
|
|
89
|
-
}
|
|
81
|
+
result_type: "percentage",
|
|
82
|
+
},
|
|
90
83
|
};
|
|
91
84
|
|
|
92
85
|
const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
|
|
93
|
-
const cell = wrapper
|
|
94
|
-
.find("TableRow")
|
|
95
|
-
.find("TableCell")
|
|
96
|
-
.at(0)
|
|
97
|
-
.dive();
|
|
86
|
+
const cell = wrapper.find("TableRow").find("TableCell").at(0).dive();
|
|
98
87
|
|
|
99
88
|
expect(cell.find("td").find("Icon")).toHaveLength(1);
|
|
100
89
|
|
|
101
|
-
const icon = cell
|
|
102
|
-
.find("td")
|
|
103
|
-
.find("Icon")
|
|
104
|
-
.at(0);
|
|
90
|
+
const icon = cell.find("td").find("Icon").at(0);
|
|
105
91
|
|
|
106
92
|
expect(icon.props().color).toBe("red");
|
|
107
93
|
});
|
|
@@ -109,28 +95,21 @@ describe("<RuleResultRow />", () => {
|
|
|
109
95
|
it("yellow icon when result is between minimum and goal", () => {
|
|
110
96
|
const ruleResultRowProps = {
|
|
111
97
|
id: 10,
|
|
112
|
-
|
|
98
|
+
ruleImplementation: {
|
|
113
99
|
minimum: 81,
|
|
114
100
|
goal: 90,
|
|
115
|
-
result_type: "percentage"
|
|
101
|
+
result_type: "percentage",
|
|
116
102
|
},
|
|
117
103
|
ruleResult: { result: 82 },
|
|
118
|
-
date: "2019-08-12T02:00:00Z"
|
|
104
|
+
date: "2019-08-12T02:00:00Z",
|
|
119
105
|
};
|
|
120
106
|
|
|
121
107
|
const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
|
|
122
|
-
const cell = wrapper
|
|
123
|
-
.find("TableRow")
|
|
124
|
-
.find("TableCell")
|
|
125
|
-
.at(0)
|
|
126
|
-
.dive();
|
|
108
|
+
const cell = wrapper.find("TableRow").find("TableCell").at(0).dive();
|
|
127
109
|
|
|
128
110
|
expect(cell.find("td").find("Icon")).toHaveLength(1);
|
|
129
111
|
|
|
130
|
-
const icon = cell
|
|
131
|
-
.find("td")
|
|
132
|
-
.find("Icon")
|
|
133
|
-
.at(0);
|
|
112
|
+
const icon = cell.find("td").find("Icon").at(0);
|
|
134
113
|
|
|
135
114
|
expect(icon.props().color).toBe("yellow");
|
|
136
115
|
});
|
|
@@ -138,15 +117,15 @@ describe("<RuleResultRow />", () => {
|
|
|
138
117
|
it("renders delete cell in RuleResultRow when user isAdmin is true", () => {
|
|
139
118
|
const ruleResultRowProps = {
|
|
140
119
|
id: 10,
|
|
141
|
-
|
|
120
|
+
ruleImplementation: {
|
|
142
121
|
minimum: 81,
|
|
143
122
|
goal: 90,
|
|
144
|
-
result_type: "percentage"
|
|
123
|
+
result_type: "percentage",
|
|
145
124
|
},
|
|
146
125
|
ruleResult: { result: 82 },
|
|
147
126
|
date: "2019-08-12T02:00:00Z",
|
|
148
127
|
isAdmin: true,
|
|
149
|
-
deleteRuleResult: jest.fn()
|
|
128
|
+
deleteRuleResult: jest.fn(),
|
|
150
129
|
};
|
|
151
130
|
const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
|
|
152
131
|
const modal = wrapper
|
|
@@ -160,15 +139,15 @@ describe("<RuleResultRow />", () => {
|
|
|
160
139
|
it("does not render delete cell in RuleResultRow when user isAdmin is false", () => {
|
|
161
140
|
const ruleResultRowProps = {
|
|
162
141
|
id: 10,
|
|
163
|
-
|
|
142
|
+
ruleImplementation: {
|
|
164
143
|
minimum: 81,
|
|
165
144
|
goal: 90,
|
|
166
|
-
result_type: "percentage"
|
|
145
|
+
result_type: "percentage",
|
|
167
146
|
},
|
|
168
147
|
ruleResult: { result: 82 },
|
|
169
148
|
date: "2019-08-12T02:00:00Z",
|
|
170
149
|
isAdmin: false,
|
|
171
|
-
deleteRuleResult: jest.fn()
|
|
150
|
+
deleteRuleResult: jest.fn(),
|
|
172
151
|
};
|
|
173
152
|
const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
|
|
174
153
|
const modal = wrapper.find("ConfirmModal");
|
|
@@ -20,8 +20,6 @@ const default_rule = {
|
|
|
20
20
|
deleted_at: null,
|
|
21
21
|
name: "2s",
|
|
22
22
|
description: "aaaaa",
|
|
23
|
-
goal: 22,
|
|
24
|
-
minimum: 1,
|
|
25
23
|
active: true,
|
|
26
24
|
};
|
|
27
25
|
|
|
@@ -46,8 +44,6 @@ describe("<RuleRow />", () => {
|
|
|
46
44
|
id: 55,
|
|
47
45
|
name: "foo is the rule name",
|
|
48
46
|
description: "aaaaa",
|
|
49
|
-
goal: 22,
|
|
50
|
-
minimum: 1,
|
|
51
47
|
result_type: "percentage",
|
|
52
48
|
};
|
|
53
49
|
const columns = _.concat(defaultRuleColumns("es"), [
|
|
@@ -5,13 +5,13 @@ import { RuleSummary } from "../RuleSummary";
|
|
|
5
5
|
import messages from "../../messages/en";
|
|
6
6
|
|
|
7
7
|
describe("<RuleSummary />", () => {
|
|
8
|
-
const
|
|
8
|
+
const implementationLimits = {
|
|
9
9
|
goal: 90,
|
|
10
10
|
minimum: 80,
|
|
11
11
|
result_type: "percentage",
|
|
12
12
|
};
|
|
13
13
|
const overGoalExecution = {
|
|
14
|
-
|
|
14
|
+
...implementationLimits,
|
|
15
15
|
execution_result_info: {
|
|
16
16
|
date: "2021-07-19T00:01:20Z",
|
|
17
17
|
result: "99.99",
|
|
@@ -19,22 +19,22 @@ describe("<RuleSummary />", () => {
|
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
const underGoalExecution = {
|
|
22
|
-
|
|
22
|
+
...implementationLimits,
|
|
23
23
|
execution_result_info: {
|
|
24
24
|
date: "2021-03-21T19:08:19Z",
|
|
25
25
|
result: "85",
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
const underMinimumExecution = {
|
|
29
|
-
|
|
29
|
+
...implementationLimits,
|
|
30
30
|
execution_result_info: {
|
|
31
31
|
date: "2021-03-21T19:08:19Z",
|
|
32
32
|
result: "50",
|
|
33
33
|
},
|
|
34
34
|
};
|
|
35
|
-
const notExecuted = {
|
|
35
|
+
const notExecuted = { ...implementationLimits, execution_result_info: {} };
|
|
36
36
|
const failedExecution = {
|
|
37
|
-
|
|
37
|
+
...implementationLimits,
|
|
38
38
|
execution_result_info: {
|
|
39
39
|
date: "2021-07-19T00:01:20Z",
|
|
40
40
|
},
|
|
@@ -10,23 +10,19 @@ describe("<Rules />", () => {
|
|
|
10
10
|
business_concept_id: "2D2B3",
|
|
11
11
|
name: "control1",
|
|
12
12
|
description: "desc1",
|
|
13
|
-
goal: 10,
|
|
14
|
-
minimum: 1,
|
|
15
13
|
type: "type1",
|
|
16
14
|
type_params: {},
|
|
17
|
-
status: "status1"
|
|
15
|
+
status: "status1",
|
|
18
16
|
},
|
|
19
17
|
{
|
|
20
18
|
id: 122,
|
|
21
19
|
business_concept_id: "2D2B4",
|
|
22
20
|
name: "control2",
|
|
23
21
|
description: "desc2",
|
|
24
|
-
goal: 10,
|
|
25
|
-
minimum: 1,
|
|
26
22
|
type: "type2",
|
|
27
23
|
type_params: {},
|
|
28
|
-
status: "status2"
|
|
29
|
-
}
|
|
24
|
+
status: "status2",
|
|
25
|
+
},
|
|
30
26
|
];
|
|
31
27
|
const columns = ruleColumnsSelector({}, { locale: "es" });
|
|
32
28
|
const rulesSort = [{ "name.raw": "desc" }];
|
|
@@ -47,44 +43,24 @@ describe("<Rules />", () => {
|
|
|
47
43
|
it("sorts column in the direction set", () => {
|
|
48
44
|
const props = { rules, columns, rulesSort };
|
|
49
45
|
const wrapper = shallow(<Rules {...props} />);
|
|
50
|
-
expect(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.at(0)
|
|
54
|
-
.props().sorted
|
|
55
|
-
).toEqual("descending");
|
|
46
|
+
expect(wrapper.find("TableHeaderCell").at(0).props().sorted).toEqual(
|
|
47
|
+
"descending"
|
|
48
|
+
);
|
|
56
49
|
|
|
57
|
-
expect(
|
|
58
|
-
wrapper
|
|
59
|
-
.find("TableHeaderCell")
|
|
60
|
-
.at(1)
|
|
61
|
-
.props().sorted
|
|
62
|
-
).toEqual(null);
|
|
50
|
+
expect(wrapper.find("TableHeaderCell").at(1).props().sorted).toEqual(null);
|
|
63
51
|
});
|
|
64
52
|
|
|
65
53
|
it("handles sort when column header is clicked", () => {
|
|
66
54
|
const props = { rules, columns, sortRules };
|
|
67
55
|
const wrapper = shallow(<Rules {...props} />);
|
|
68
|
-
wrapper
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
expect(
|
|
73
|
-
wrapper
|
|
74
|
-
.find("TableHeaderCell")
|
|
75
|
-
.at(0)
|
|
76
|
-
.props().sorted
|
|
77
|
-
).toEqual("ascending");
|
|
56
|
+
wrapper.find("TableHeaderCell").at(0).simulate("click");
|
|
57
|
+
expect(wrapper.find("TableHeaderCell").at(0).props().sorted).toEqual(
|
|
58
|
+
"ascending"
|
|
59
|
+
);
|
|
78
60
|
|
|
79
|
-
wrapper
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
expect(
|
|
84
|
-
wrapper
|
|
85
|
-
.find("TableHeaderCell")
|
|
86
|
-
.at(0)
|
|
87
|
-
.props().sorted
|
|
88
|
-
).toEqual("descending");
|
|
61
|
+
wrapper.find("TableHeaderCell").at(0).simulate("click");
|
|
62
|
+
expect(wrapper.find("TableHeaderCell").at(0).props().sorted).toEqual(
|
|
63
|
+
"descending"
|
|
64
|
+
);
|
|
89
65
|
});
|
|
90
66
|
});
|
|
@@ -15,71 +15,75 @@ exports[`<ConditionSummary /> matches the latest snapshot 1`] = `
|
|
|
15
15
|
filters
|
|
16
16
|
</div>
|
|
17
17
|
</h3>
|
|
18
|
-
<
|
|
19
|
-
class="ui
|
|
18
|
+
<div
|
|
19
|
+
class="ui segment"
|
|
20
20
|
>
|
|
21
|
-
<
|
|
22
|
-
class=""
|
|
21
|
+
<table
|
|
22
|
+
class="ui very basic table"
|
|
23
23
|
>
|
|
24
|
-
<
|
|
24
|
+
<thead
|
|
25
25
|
class=""
|
|
26
26
|
>
|
|
27
|
-
<
|
|
27
|
+
<tr
|
|
28
28
|
class=""
|
|
29
29
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
30
|
+
<th
|
|
31
|
+
class=""
|
|
32
|
+
>
|
|
33
|
+
field
|
|
34
|
+
</th>
|
|
35
|
+
<th
|
|
36
|
+
class=""
|
|
37
|
+
>
|
|
38
|
+
operator
|
|
39
|
+
</th>
|
|
40
|
+
<th
|
|
41
|
+
class=""
|
|
42
|
+
>
|
|
43
|
+
values
|
|
44
|
+
</th>
|
|
45
|
+
</tr>
|
|
46
|
+
</thead>
|
|
47
|
+
<tbody
|
|
48
48
|
class=""
|
|
49
49
|
>
|
|
50
|
-
<
|
|
51
|
-
class="
|
|
50
|
+
<tr
|
|
51
|
+
class=""
|
|
52
52
|
>
|
|
53
|
-
<
|
|
54
|
-
|
|
53
|
+
<td
|
|
54
|
+
class="five wide"
|
|
55
|
+
>
|
|
56
|
+
<a
|
|
57
|
+
href="/structures/2598"
|
|
58
|
+
>
|
|
59
|
+
<span
|
|
60
|
+
class="highlighted"
|
|
61
|
+
>
|
|
62
|
+
"Mes"
|
|
63
|
+
</span>
|
|
64
|
+
</a>
|
|
65
|
+
</td>
|
|
66
|
+
<td
|
|
67
|
+
class="five wide"
|
|
55
68
|
>
|
|
56
69
|
<span
|
|
57
70
|
class="highlighted"
|
|
58
71
|
>
|
|
59
|
-
"
|
|
72
|
+
"in_list"
|
|
60
73
|
</span>
|
|
61
|
-
</
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class="five wide"
|
|
65
|
-
>
|
|
66
|
-
<span
|
|
67
|
-
class="highlighted"
|
|
68
|
-
>
|
|
69
|
-
"in_list"
|
|
70
|
-
</span>
|
|
71
|
-
</td>
|
|
72
|
-
<td
|
|
73
|
-
class="five wide"
|
|
74
|
-
>
|
|
75
|
-
<span
|
|
76
|
-
class="highlighted"
|
|
74
|
+
</td>
|
|
75
|
+
<td
|
|
76
|
+
class="five wide"
|
|
77
77
|
>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
<span
|
|
79
|
+
class="highlighted"
|
|
80
|
+
>
|
|
81
|
+
"4, 5, 6"
|
|
82
|
+
</span>
|
|
83
|
+
</td>
|
|
84
|
+
</tr>
|
|
85
|
+
</tbody>
|
|
86
|
+
</table>
|
|
87
|
+
</div>
|
|
84
88
|
</div>
|
|
85
89
|
`;
|
|
@@ -4,7 +4,8 @@ exports[`<ExecutionGroup /> matches the latest snapshot 1`] = `
|
|
|
4
4
|
<Fragment>
|
|
5
5
|
<ExecutionGroupMessage
|
|
6
6
|
count={1}
|
|
7
|
-
|
|
7
|
+
error={1}
|
|
8
|
+
pending={-1}
|
|
8
9
|
/>
|
|
9
10
|
<Table
|
|
10
11
|
as="table"
|
|
@@ -64,8 +65,11 @@ exports[`<ExecutionGroup /> matches the latest snapshot 1`] = `
|
|
|
64
65
|
Object {
|
|
65
66
|
"_embedded": Object {
|
|
66
67
|
"implementation": Object {
|
|
68
|
+
"goal": 20,
|
|
67
69
|
"id": 1,
|
|
68
70
|
"implementation_key": "foo",
|
|
71
|
+
"minimum": 10,
|
|
72
|
+
"result_type": "percentage",
|
|
69
73
|
"rule_id": 1,
|
|
70
74
|
},
|
|
71
75
|
"quality_events": Array [
|
|
@@ -89,11 +93,8 @@ exports[`<ExecutionGroup /> matches the latest snapshot 1`] = `
|
|
|
89
93
|
"result_type": "percentage",
|
|
90
94
|
},
|
|
91
95
|
"rule": Object {
|
|
92
|
-
"goal": 20,
|
|
93
96
|
"id": 1,
|
|
94
|
-
"minimum": 10,
|
|
95
97
|
"name": "rule_name",
|
|
96
|
-
"result_type": "percentage",
|
|
97
98
|
},
|
|
98
99
|
},
|
|
99
100
|
"id": 1,
|