@truedat/dq 4.53.9 → 4.53.11

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/package.json +6 -6
  3. package/src/api/queries.js +76 -16
  4. package/src/components/ConceptRules.js +1 -1
  5. package/src/components/ConditionSummary.js +1 -1
  6. package/src/components/ExecutionGroups.js +4 -50
  7. package/src/components/ImplementationExecutionFilters.js +79 -0
  8. package/src/components/ImplementationExecutions.js +125 -0
  9. package/src/components/ImplementationStructureDelete.js +2 -6
  10. package/src/components/ImplementationsRoutes.js +18 -1
  11. package/src/components/ImplementationsUploadButton.js +1 -1
  12. package/src/components/RuleImplementationHistory.js +5 -8
  13. package/src/components/RuleImplementationHistoryRow.js +23 -28
  14. package/src/components/RuleImplementationResultTabs.js +2 -2
  15. package/src/components/RuleImplementationResults.js +24 -149
  16. package/src/components/RuleImplementationSelectedFilters.js +2 -1
  17. package/src/components/RuleImplementationTabs.js +14 -8
  18. package/src/components/RuleImplementationsTable.js +1 -4
  19. package/src/components/RuleResultDecorator.js +10 -9
  20. package/src/components/RuleResultRow.js +9 -15
  21. package/src/components/RuleResultsRoutes.js +2 -2
  22. package/src/components/RuleResultsTable.js +117 -0
  23. package/src/components/RuleResultsUpload.js +2 -6
  24. package/src/components/RulesUploadButton.js +1 -1
  25. package/src/components/__tests__/ImplementationExecutionFilters.spec.js +24 -0
  26. package/src/components/__tests__/ImplementationExecutions.spec.js +32 -0
  27. package/src/components/__tests__/RuleImplementationResults.spec.js +16 -45
  28. package/src/components/__tests__/RuleImplementationTabs.spec.js +1 -18
  29. package/src/components/__tests__/RuleResultDecorator.spec.js +12 -32
  30. package/src/components/__tests__/RuleResultDetails.spec.js +3 -3
  31. package/src/components/__tests__/RuleResultRemediations.spec.js +3 -3
  32. package/src/components/__tests__/RuleResultRoutes.spec.js +5 -5
  33. package/src/components/__tests__/RuleResultRow.spec.js +86 -82
  34. package/src/components/__tests__/RuleResultSegmentRow.spec.js +6 -6
  35. package/src/components/__tests__/RuleResultSegments.spec.js +1 -1
  36. package/src/components/__tests__/__fixtures__/executionMocks.js +80 -0
  37. package/src/components/__tests__/__snapshots__/ExecutionGroups.spec.js.snap +0 -1
  38. package/src/components/__tests__/__snapshots__/ImplementationExecutionFilters.spec.js.snap +37 -0
  39. package/src/components/__tests__/__snapshots__/ImplementationExecutions.spec.js.snap +194 -0
  40. package/src/components/__tests__/__snapshots__/RuleImplementation.spec.js.snap +6 -0
  41. package/src/components/__tests__/__snapshots__/RuleImplementationHistory.spec.js.snap +12 -24
  42. package/src/components/__tests__/__snapshots__/RuleImplementationResults.spec.js.snap +8 -8
  43. package/src/components/__tests__/__snapshots__/RuleImplementationTabs.spec.js.snap +12 -6
  44. package/src/components/__tests__/__snapshots__/RuleResultDecorator.spec.js.snap +4 -4
  45. package/src/components/ruleImplementationForm/DateField.js +2 -2
  46. package/src/components/ruleImplementationForm/DateTimeField.js +2 -2
  47. package/src/components/ruleImplementationForm/FieldModifier.js +1 -1
  48. package/src/components/ruleImplementationForm/FiltersFormGroup.js +3 -3
  49. package/src/components/ruleImplementationForm/FiltersGroup.js +2 -2
  50. package/src/components/ruleImplementationForm/LimitsForm.js +6 -6
  51. package/src/components/ruleImplementationForm/ValueConditions.js +1 -1
  52. package/src/functions/selectors.js +12 -4
  53. package/src/messages/en.js +6 -0
  54. package/src/messages/es.js +6 -0
  55. package/src/selectors/getRuleImplementationColumns.js +4 -2
  56. package/src/selectors/index.js +1 -1
  57. package/src/selectors/{getRuleResultsColumns.js → ruleResultsColumnsSelector.js} +1 -1
@@ -1,28 +1,11 @@
1
1
  import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import { render } from "@truedat/test/render";
4
- import { intl } from "@truedat/test/intl-stub";
5
4
  import {
6
5
  RuleImplementationResults,
7
6
  getCustomColumnsWithData,
8
7
  } from "../RuleImplementationResults";
9
8
 
10
- const renderOpts = {
11
- messages: {
12
- en: {
13
- "ruleResult.props.date": "date",
14
- "ruleResult.props.quality": "quality",
15
- "ruleResult.props.records": "records",
16
- "ruleResult.props.errors": "errors",
17
- "quality.error": "errors",
18
- },
19
- },
20
- };
21
-
22
- // workaround for enzyme issue with React.useContext
23
- // see https://github.com/airbnb/enzyme/issues/2176#issuecomment-532361526
24
- jest.spyOn(React, "useContext").mockImplementation(() => intl);
25
-
26
9
  describe("<RuleImplementationResults />", () => {
27
10
  const ruleImplementation = {
28
11
  id: 1,
@@ -36,21 +19,21 @@ describe("<RuleImplementationResults />", () => {
36
19
  results: [
37
20
  {
38
21
  errors: 2,
39
- has_remediation: false,
40
- has_segments: true,
22
+ hasRemediation: false,
23
+ hasSegments: true,
41
24
  id: "66577",
42
25
  records: 31,
43
26
  result: "93.54",
44
- result_type: "percentage",
27
+ resultType: "percentage",
45
28
  },
46
29
  {
47
30
  errors: 2,
48
- has_remediation: false,
49
- has_segments: true,
31
+ hasRemediation: false,
32
+ hasSegments: true,
50
33
  id: "66578",
51
34
  records: 31,
52
35
  result: "93.54",
53
- result_type: "percentage",
36
+ resultType: "percentage",
54
37
  },
55
38
  ],
56
39
  },
@@ -62,21 +45,21 @@ describe("<RuleImplementationResults />", () => {
62
45
  results: [
63
46
  {
64
47
  errors: 2,
65
- has_remediation: false,
66
- has_segments: true,
48
+ hasRemediation: false,
49
+ hasSegments: true,
67
50
  id: "66579",
68
51
  records: 31,
69
52
  result: "93.54",
70
- result_type: "percentage",
53
+ resultType: "percentage",
71
54
  },
72
55
  {
73
56
  errors: 2,
74
- has_remediation: false,
75
- has_segments: true,
57
+ hasRemediation: false,
58
+ hasSegments: true,
76
59
  id: "66580",
77
60
  records: 31,
78
61
  result: "93.54",
79
- result_type: "percentage",
62
+ resultType: "percentage",
80
63
  },
81
64
  ],
82
65
  },
@@ -89,10 +72,7 @@ describe("<RuleImplementationResults />", () => {
89
72
  };
90
73
 
91
74
  it("matches the latest snapshot", () => {
92
- const { container } = render(
93
- <RuleImplementationResults {...props} />,
94
- renderOpts
95
- );
75
+ const { container } = render(<RuleImplementationResults {...props} />);
96
76
  expect(container).toMatchSnapshot();
97
77
  });
98
78
  });
@@ -105,18 +85,9 @@ describe("getCustomColumnsWithData", () => {
105
85
  { result: 20, params: { p1: "2" } },
106
86
  ];
107
87
  const customColumns = [
108
- {
109
- name: "p1",
110
- fieldSelector: _.path("params.p1"),
111
- },
112
- {
113
- name: "p2",
114
- fieldSelector: _.path("params.p2"),
115
- },
116
- {
117
- name: "p3",
118
- fieldSelector: _.path("params.p3"),
119
- },
88
+ { name: "p1", fieldSelector: _.path("params.p1") },
89
+ { name: "p2", fieldSelector: _.path("params.p2") },
90
+ { name: "p3", fieldSelector: _.path("params.p3") },
120
91
  ];
121
92
 
122
93
  const filteredColumns = getCustomColumnsWithData(
@@ -3,20 +3,6 @@ import { render } from "@truedat/test/render";
3
3
  import { RuleImplementationTabs } from "../RuleImplementationTabs";
4
4
 
5
5
  describe("<RuleImplementationTabs />", () => {
6
- const renderOpts = {
7
- messages: {
8
- en: {
9
- "tabs.dq.ruleImplementation": "ruleImplementation",
10
- "tabs.dq.implementation.links.concepts": "concepts",
11
- "tabs.dq.implementation.structures": "structures",
12
- "tabs.dq.ruleImplementation.results": "results",
13
- "tabs.dq.ruleImplementation.details": "details",
14
- "tabs.dq.ruleImplementation.audit": "audit",
15
- "tabs.dq.ruleImplementation.history": "history",
16
- },
17
- },
18
- };
19
-
20
6
  const props = {
21
7
  rule: { id: 8 },
22
8
  ruleImplementation: { id: 1 },
@@ -24,10 +10,7 @@ describe("<RuleImplementationTabs />", () => {
24
10
  canCreateLink: true,
25
11
  };
26
12
  it("matches the latest snapshot", () => {
27
- const { container } = render(
28
- <RuleImplementationTabs {...props} />,
29
- renderOpts
30
- );
13
+ const { container } = render(<RuleImplementationTabs {...props} />);
31
14
  expect(container).toMatchSnapshot();
32
15
  });
33
16
  });
@@ -7,64 +7,44 @@ describe("<RuleResultDecorator />", () => {
7
7
  ruleResult: {
8
8
  result: 42,
9
9
  errors: 1234,
10
- result_text: "result_text",
11
- },
12
- };
13
- const renderOpts = {
14
- messages: {
15
- en: {
16
- result_text: "result_message",
17
- no_data: "no_data_message",
18
- "quality.result.percentage.description": "{result}%",
19
- "quality.result.errors_number.description": "{result} errors",
20
- "quality.result.no.data": "No data",
21
- },
10
+ result_text: "Something happened",
22
11
  },
23
12
  };
24
13
 
25
14
  it("decorates a percentage result", () => {
26
- const ruleImplementation = { result_type: "percentage" };
15
+ const ruleImplementation = { resultType: "percentage" };
27
16
  const { container, queryByTitle } = render(
28
- <RuleResultDecorator
29
- ruleImplementation={ruleImplementation}
30
- {...props}
31
- />,
32
- renderOpts
17
+ <RuleResultDecorator ruleImplementation={ruleImplementation} {...props} />
33
18
  );
34
19
  expect(container).toMatchSnapshot();
35
20
  expect(container).toHaveTextContent("42%");
36
- expect(queryByTitle("result_message")).not.toBeNull();
21
+ expect(queryByTitle("Something happened")).toBeInTheDocument();
37
22
  });
38
23
 
39
24
  it("decorates an error count result", () => {
40
- const ruleImplementation = { result_type: "errors_number" };
25
+ const ruleImplementation = { resultType: "errors_number" };
41
26
  const { container, queryByTitle } = render(
42
- <RuleResultDecorator
43
- ruleImplementation={ruleImplementation}
44
- {...props}
45
- />,
46
- renderOpts
27
+ <RuleResultDecorator ruleImplementation={ruleImplementation} {...props} />
47
28
  );
48
29
  expect(container).toMatchSnapshot();
49
30
  expect(container).toHaveTextContent("1,234 errors");
50
- expect(queryByTitle("result_message")).not.toBeNull();
31
+ expect(queryByTitle("Something happened")).toBeInTheDocument();
51
32
  });
52
33
 
53
34
  it("decorates an implementation without result data", () => {
54
- const ruleImplementation = { result_type: "errors_number" };
35
+ const ruleImplementation = { resultType: "errors_number" };
55
36
  const ruleResult = { result_text: "no_data" };
56
37
  const props = { ruleImplementation, ruleResult };
57
38
  const { container, queryByTitle } = render(
58
- <RuleResultDecorator {...props} />,
59
- renderOpts
39
+ <RuleResultDecorator {...props} />
60
40
  );
61
41
  expect(container).toMatchSnapshot();
62
- expect(container).toHaveTextContent("No data");
63
- expect(queryByTitle("no_data_message")).not.toBeNull();
42
+ expect(container).toHaveTextContent("No information about quality");
43
+ expect(queryByTitle("no_data")).toBeInTheDocument();
64
44
  });
65
45
 
66
46
  it("handles missing execution result", () => {
67
- const { container } = render(<RuleResultDecorator />, renderOpts);
47
+ const { container } = render(<RuleResultDecorator />);
68
48
  expect(container).toBeEmptyDOMElement();
69
49
  });
70
50
  });
@@ -25,7 +25,7 @@ const commonProps = {
25
25
  implementation_key: "key",
26
26
  minimum: 10,
27
27
  goal: 20,
28
- result_type: "percentage",
28
+ resultType: "percentage",
29
29
  },
30
30
  ruleResult: {
31
31
  id: 100,
@@ -35,8 +35,8 @@ const commonProps = {
35
35
  records: 31,
36
36
  date: "2022-06-24",
37
37
  errors: 2,
38
- has_remediation: true,
39
- has_segments: true,
38
+ hasRemediation: true,
39
+ hasSegments: true,
40
40
  },
41
41
  };
42
42
 
@@ -23,7 +23,7 @@ describe("<RuleResultRemediations />", () => {
23
23
  id: 852,
24
24
  minimum: 1,
25
25
  goal: 10,
26
- result_type: "percentage",
26
+ resultType: "percentage",
27
27
  },
28
28
  ruleResult: {
29
29
  id: 65599,
@@ -33,8 +33,8 @@ describe("<RuleResultRemediations />", () => {
33
33
  records: 31,
34
34
  date: "2022-06-24",
35
35
  errors: 2,
36
- has_remediation: true,
37
- has_segments: true,
36
+ hasRemediation: true,
37
+ hasSegments: true,
38
38
  },
39
39
  };
40
40
 
@@ -5,7 +5,7 @@ import {
5
5
  IMPLEMENTATION_RESULT_SEGMENTS_RESULTS,
6
6
  IMPLEMENTATION_RESULT_REMEDIATION_PLAN,
7
7
  } from "@truedat/core/routes";
8
- import { IMPLEMENTATION_RESULT } from "../../api/queries";
8
+ import { IMPLEMENTATION_RESULT_QUERY } from "../../api/queries";
9
9
  import { RuleResultsRoutes } from "../RuleResultsRoutes";
10
10
 
11
11
  jest.mock("react-router-dom", () => ({
@@ -18,19 +18,19 @@ describe("<RuleResultsRoutes>", () => {
18
18
  implementationResult: {
19
19
  date: "2022-06-24",
20
20
  errors: 2,
21
- has_remediation: true,
22
- has_segments: true,
21
+ hasRemediation: true,
22
+ hasSegments: true,
23
23
  id: 1,
24
24
  records: 31,
25
25
  details: {},
26
26
  result: "93.54",
27
27
  params: {},
28
- result_type: "percentage",
28
+ resultType: "percentage",
29
29
  },
30
30
  };
31
31
 
32
32
  const mock = {
33
- request: { query: IMPLEMENTATION_RESULT, variables: { id: 1 } },
33
+ request: { query: IMPLEMENTATION_RESULT_QUERY, variables: { id: 1 } },
34
34
  result: { data: implementationResult },
35
35
  };
36
36
  const key = "mi implementación molona";
@@ -1,16 +1,18 @@
1
1
  import _ from "lodash/fp";
2
2
  import React from "react";
3
- import { shallow } from "enzyme";
4
- import { intl } from "@truedat/test/intl-stub";
3
+ import { useAuthorized } from "@truedat/core/hooks";
4
+ import { render } from "@truedat/test/render";
5
5
  import { RuleResultRow } from "../RuleResultRow";
6
6
 
7
- // workaround for enzyme issue with React.useContext
8
- // see https://github.com/airbnb/enzyme/issues/2176#issuecomment-532361526
9
- jest.spyOn(React, "useContext").mockImplementation(() => intl);
7
+ jest.mock("@truedat/core/hooks");
8
+
9
+ beforeEach(() => {
10
+ useAuthorized.mockImplementation(() => true);
11
+ });
10
12
 
11
13
  describe("<RuleResultRow />", () => {
12
14
  it("renders customColumns values when passed", () => {
13
- const ruleResultRowProps = {
15
+ const props = {
14
16
  rule: { id: 10 },
15
17
  ruleResult: {
16
18
  id: 54,
@@ -18,47 +20,33 @@ describe("<RuleResultRow />", () => {
18
20
  params: { p1: "1", p2: "2", p3: "no" },
19
21
  },
20
22
  customColumns: [
21
- {
22
- name: "m_parm1",
23
- fieldSelector: _.path("params.p1"),
24
- },
25
- {
26
- name: "m_parm2",
27
- fieldSelector: _.path("params.p2"),
28
- },
23
+ { name: "m_parm1", fieldSelector: _.path("params.p1") },
24
+ { name: "m_parm2", fieldSelector: _.path("params.p2") },
29
25
  ],
30
26
  date: "2019-08-12T02:00:00Z",
31
27
  ruleImplementation: {
32
28
  id: 23,
33
29
  minimum: 1,
34
30
  goal: 10,
35
- result_type: "percentage",
31
+ resultType: "percentage",
36
32
  },
37
33
  };
38
34
 
39
- const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
40
-
41
- const customColumn = wrapper
42
- .find("TableRow")
43
- .find("TableCell")
44
- .at(2)
45
- .props().children;
46
-
47
- expect(customColumn).toBe("1");
48
-
49
- const customColumn2 = wrapper
50
- .find("TableRow")
51
- .find("TableCell")
52
- .at(3)
53
- .props().children;
54
-
55
- expect(customColumn2).toBe("2");
56
-
57
- expect(wrapper.find("TableRow").find("TableCell")).toHaveLength(4);
35
+ const { queryByText, getAllByRole } = render(
36
+ <table>
37
+ <tbody>
38
+ <RuleResultRow {...props} />
39
+ </tbody>
40
+ </table>
41
+ );
42
+ expect(queryByText("1")).toBeInTheDocument();
43
+ expect(queryByText("2")).toBeInTheDocument();
44
+ expect(getAllByRole("row")).toHaveLength(1);
45
+ expect(getAllByRole("cell")).toHaveLength(5);
58
46
  });
59
47
 
60
48
  it("green icon when result is over goal", () => {
61
- const ruleResultRowProps = {
49
+ const props = {
62
50
  rule: { id: 10 },
63
51
  ruleResult: { id: 54, result: 80 },
64
52
  date: "2019-08-12T02:00:00Z",
@@ -66,22 +54,24 @@ describe("<RuleResultRow />", () => {
66
54
  id: 23,
67
55
  minimum: 1,
68
56
  goal: 10,
69
- result_type: "percentage",
57
+ resultType: "percentage",
70
58
  },
71
59
  };
72
60
 
73
- const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
74
- const cell = wrapper.find("TableRow").find("TableCell").at(1).dive();
75
-
76
- expect(cell.find("td").find("Icon")).toHaveLength(1);
77
-
78
- const icon = cell.find("td").find("Icon").at(0);
79
-
80
- expect(icon.props().color).toBe("green");
61
+ const { container } = render(
62
+ <table>
63
+ <tbody>
64
+ <RuleResultRow {...props} />
65
+ </tbody>
66
+ </table>
67
+ );
68
+ expect(
69
+ container.querySelector("td > i.green.circle.icon")
70
+ ).toBeInTheDocument();
81
71
  });
82
72
 
83
73
  it("red icon when result is under minimum", () => {
84
- const ruleResultRowProps = {
74
+ const props = {
85
75
  rule: { id: 10 },
86
76
  ruleResult: { id: 54, result: 80 },
87
77
  date: "2019-08-12T02:00:00Z",
@@ -89,82 +79,96 @@ describe("<RuleResultRow />", () => {
89
79
  id: 23,
90
80
  minimum: 81,
91
81
  goal: 90,
92
- result_type: "percentage",
82
+ resultType: "percentage",
93
83
  },
94
84
  };
95
85
 
96
- const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
97
- const cell = wrapper.find("TableRow").find("TableCell").at(1).dive();
98
-
99
- expect(cell.find("td").find("Icon")).toHaveLength(1);
100
-
101
- const icon = cell.find("td").find("Icon").at(0);
102
-
103
- expect(icon.props().color).toBe("red");
86
+ const { container } = render(
87
+ <table>
88
+ <tbody>
89
+ <RuleResultRow {...props} />
90
+ </tbody>
91
+ </table>
92
+ );
93
+ expect(
94
+ container.querySelector("td > i.red.circle.icon")
95
+ ).toBeInTheDocument();
104
96
  });
105
97
 
106
98
  it("yellow icon when result is between minimum and goal", () => {
107
- const ruleResultRowProps = {
99
+ const props = {
108
100
  rule: { id: 10 },
109
101
  ruleImplementation: {
110
102
  id: 23,
111
103
  minimum: 81,
112
104
  goal: 90,
113
- result_type: "percentage",
105
+ resultType: "percentage",
114
106
  },
115
107
  ruleResult: { id: 54, result: 82 },
116
108
  date: "2019-08-12T02:00:00Z",
117
109
  };
118
110
 
119
- const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
120
- const cell = wrapper.find("TableRow").find("TableCell").at(1).dive();
121
-
122
- expect(cell.find("td").find("Icon")).toHaveLength(1);
123
-
124
- const icon = cell.find("td").find("Icon").at(0);
125
-
126
- expect(icon.props().color).toBe("yellow");
111
+ const { container } = render(
112
+ <table>
113
+ <tbody>
114
+ <RuleResultRow {...props} />
115
+ </tbody>
116
+ </table>
117
+ );
118
+ expect(
119
+ container.querySelector("td > i.yellow.circle.icon")
120
+ ).toBeInTheDocument();
127
121
  });
128
122
 
129
- it("renders delete cell in RuleResultRow when user isAdmin is true", () => {
130
- const ruleResultRowProps = {
123
+ it("renders delete cell in RuleResultRow when user is admin", () => {
124
+ const props = {
131
125
  rule: { id: 10 },
132
126
  ruleImplementation: {
133
127
  id: 23,
134
128
  minimum: 81,
135
129
  goal: 90,
136
- result_type: "percentage",
130
+ resultType: "percentage",
137
131
  },
138
132
  ruleResult: { id: 54, result: 82 },
139
133
  date: "2019-08-12T02:00:00Z",
140
- isAdmin: true,
141
134
  deleteRuleResult: jest.fn(),
142
135
  };
143
- const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
144
- const modal = wrapper
145
- .find("TableRow")
146
- .find("TableCell")
147
- .at(2)
148
- .find("ConfirmModal");
149
- expect(modal).toHaveLength(1);
136
+ const { container } = render(
137
+ <table>
138
+ <tbody>
139
+ <RuleResultRow {...props} />
140
+ </tbody>
141
+ </table>
142
+ );
143
+ expect(
144
+ container.querySelector("td > i.red.trash.alternate.outline.icon")
145
+ ).toBeInTheDocument();
150
146
  });
151
147
 
152
- it("does not render delete cell in RuleResultRow when user isAdmin is false", () => {
153
- const ruleResultRowProps = {
148
+ it("does not render delete cell in RuleResultRow when user is not admin", () => {
149
+ useAuthorized.mockImplementation(() => false);
150
+
151
+ const props = {
154
152
  rule: { id: 10 },
155
153
  ruleImplementation: {
156
154
  id: 23,
157
155
  minimum: 81,
158
156
  goal: 90,
159
- result_type: "percentage",
157
+ resultType: "percentage",
160
158
  },
161
159
  ruleResult: { id: 54, result: 82 },
162
160
  date: "2019-08-12T02:00:00Z",
163
- isAdmin: false,
164
161
  deleteRuleResult: jest.fn(),
165
162
  };
166
- const wrapper = shallow(<RuleResultRow {...ruleResultRowProps} />);
167
- const modal = wrapper.find("ConfirmModal");
168
- expect(modal).toHaveLength(0);
163
+ const { container } = render(
164
+ <table>
165
+ <tbody>
166
+ <RuleResultRow {...props} />
167
+ </tbody>
168
+ </table>
169
+ );
170
+ expect(
171
+ container.querySelector("td > i.red.trash.alternate.outline.icon")
172
+ ).not.toBeInTheDocument();
169
173
  });
170
174
  });
@@ -32,7 +32,7 @@ describe("<RuleResultSegmentRow />", () => {
32
32
  id: 23,
33
33
  minimum: 1,
34
34
  goal: 10,
35
- result_type: "percentage",
35
+ resultType: "percentage",
36
36
  },
37
37
  };
38
38
 
@@ -69,7 +69,7 @@ describe("<RuleResultSegmentRow />", () => {
69
69
  id: 23,
70
70
  minimum: 1,
71
71
  goal: 10,
72
- result_type: "percentage",
72
+ resultType: "percentage",
73
73
  },
74
74
  };
75
75
 
@@ -94,7 +94,7 @@ describe("<RuleResultSegmentRow />", () => {
94
94
  id: 23,
95
95
  minimum: 81,
96
96
  goal: 90,
97
- result_type: "percentage",
97
+ resultType: "percentage",
98
98
  },
99
99
  };
100
100
 
@@ -117,7 +117,7 @@ describe("<RuleResultSegmentRow />", () => {
117
117
  id: 23,
118
118
  minimum: 81,
119
119
  goal: 90,
120
- result_type: "percentage",
120
+ resultType: "percentage",
121
121
  },
122
122
  segmentResult: { id: 54, result: 82, params: { segment_name: "foo" } },
123
123
  date: "2019-08-12T02:00:00Z",
@@ -142,7 +142,7 @@ describe("<RuleResultSegmentRow />", () => {
142
142
  id: 23,
143
143
  minimum: 81,
144
144
  goal: 90,
145
- result_type: "percentage",
145
+ resultType: "percentage",
146
146
  },
147
147
  segmentResult: { id: 54, result: 82, params: { segment_name: "foo" } },
148
148
  date: "2019-08-12T02:00:00Z",
@@ -167,7 +167,7 @@ describe("<RuleResultSegmentRow />", () => {
167
167
  id: 23,
168
168
  minimum: 81,
169
169
  goal: 90,
170
- result_type: "percentage",
170
+ resultType: "percentage",
171
171
  },
172
172
  segmentResult: { id: 54, result: 82, params: { segment_name: "foo" } },
173
173
  date: "2019-08-12T02:00:00Z",
@@ -13,7 +13,7 @@ jest.spyOn(React, "useContext").mockImplementation(() => intl);
13
13
 
14
14
  describe("<RuleResultSegments />", () => {
15
15
  const rule = {
16
- result_type: "percentage",
16
+ resultType: "percentage",
17
17
  minimum: 50,
18
18
  goal: 100,
19
19
  };