Skip to content

Commit 09018b5

Browse files
authored
chore(ui): Revamp Test case details page (#25118)
* chore(ui): Revamp Test case details page * fix failing unit tests * optimize code * address copilot comments * fix sonar issues * migrate from antd to mui components * address comments * nit * fix failing tests
1 parent a842433 commit 09018b5

File tree

14 files changed

+739
-376
lines changed

14 files changed

+739
-376
lines changed

openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/TestCaseResultTab/TestCaseResultTab.component.tsx

Lines changed: 254 additions & 120 deletions
Large diffs are not rendered by default.

openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/TestCaseResultTab/TestCaseResultTab.test.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,15 @@ describe('TestCaseResultTab', () => {
300300

301301
render(<TestCaseResultTab />);
302302

303-
expect(
304-
await screen.findByTestId('computed-row-count-container')
305-
).toBeInTheDocument();
303+
const parameterContainer = await screen.findByTestId(
304+
'parameter-container'
305+
);
306+
307+
expect(parameterContainer).toBeInTheDocument();
308+
// Check that compute row count label is present in the parameter section
309+
expect(screen.getByText('label.compute-row-count:')).toBeInTheDocument();
310+
// Check that the value "true" is present
311+
expect(screen.getByText('true')).toBeInTheDocument();
306312
});
307313

308314
it('should not show Compute Row Count when testDefinition does not support supportsRowLevelPassedFailed', async () => {
@@ -321,8 +327,9 @@ describe('TestCaseResultTab', () => {
321327

322328
await screen.findByTestId('test-case-result-tab-container');
323329

330+
// Compute row count should not be shown in parameter section when not supported
324331
expect(
325-
screen.queryByTestId('computed-row-count-container')
332+
screen.queryByText('label.compute-row-count:')
326333
).not.toBeInTheDocument();
327334
});
328335

@@ -342,8 +349,9 @@ describe('TestCaseResultTab', () => {
342349

343350
await screen.findByTestId('test-case-result-tab-container');
344351

352+
// Compute row count should not be shown when computePassedFailedRowCount is undefined
345353
expect(
346-
screen.queryByTestId('computed-row-count-container')
354+
screen.queryByText('label.compute-row-count:')
347355
).not.toBeInTheDocument();
348356
});
349357
});

openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/TestCaseResultTab/test-case-result-tab.style.less

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,80 @@
1111
* limitations under the License.
1212
*/
1313
@import (reference) '../../../../styles/variables.less';
14+
15+
// Parameter label and value text styles (global for reuse)
16+
.parameter-label {
17+
color: @grey-700;
18+
font-size: @font-size-base;
19+
font-style: normal;
20+
font-weight: @font-medium;
21+
min-width: 200px;
22+
display: inline-block;
23+
}
24+
25+
.parameter-value-text {
26+
color: @grey-900;
27+
font-size: @font-size-base;
28+
font-style: normal;
29+
font-weight: @font-medium;
30+
}
31+
1432
.test-case-result-tab {
1533
.test-case-result-tab-graph {
16-
background-color: @grey-5;
17-
padding: 16px;
34+
border: 1px solid @grey-200;
35+
border-radius: 10px;
36+
padding: @size-md;
1837
}
1938
.CodeMirror-gutters {
2039
background-color: @grey-5;
2140
}
2241
.parameter-value {
2342
background-color: @grey-5;
2443
}
44+
45+
// Parameter section styles
46+
.parameter-container {
47+
border-radius: 10px;
48+
background: @grey-25;
49+
padding: @size-md;
50+
}
51+
52+
.parameter-title {
53+
color: @grey-900;
54+
font-size: @font-size-base;
55+
font-style: normal;
56+
font-weight: @font-semibold;
57+
}
58+
59+
.parameter-rows-container {
60+
width: 100%;
61+
}
62+
63+
.parameter-row {
64+
padding: @size-xs 0;
65+
}
66+
67+
.parameter-row-divider {
68+
margin: @size-xs 0;
69+
border-top: 1px dashed @grey-300;
70+
border-bottom: none;
71+
border-left: none;
72+
border-right: none;
73+
}
74+
75+
.sql-expression-container {
76+
padding: @size-md;
77+
width: 100%;
78+
79+
.custom-code-mirror-theme {
80+
.CodeMirror {
81+
background: @white;
82+
}
83+
.CodeMirror-gutters {
84+
background-color: @grey-25;
85+
}
86+
}
87+
}
2588
}
2689
.version-sql-expression-container {
2790
background-color: @grey-100;

openmetadata-ui/src/main/resources/ui/src/components/DataQuality/IncidentManager/incident-manager.style.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
@import (reference) '../../../styles/variables.less';
1515

1616
.parameter-value-container {
17-
background: @grey-1;
18-
border-radius: 4px;
19-
padding: 8px 10px;
17+
background: transparent;
18+
border-radius: 0;
19+
padding: 0;
2020
}
2121

2222
.severity {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2026 Collate.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/
13+
14+
export const TEST_SUMMARY_CHART_MARGIN = {
15+
top: 16,
16+
bottom: 100,
17+
right: 40,
18+
left: 16,
19+
} as const;
20+
21+
export const STATUS_DOT_RADIUS = 4;
22+
export const STATUS_DOT_SIZE = STATUS_DOT_RADIUS * 2;
23+
24+
export const TOOLTIP_OFFSET_DEFAULT = -200;
25+
export const TOOLTIP_OFFSET_NEAR_EDGE = -20;
26+
export const TOOLTIP_EDGE_THRESHOLD = 200;

openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TestSummary/TestSummaryGraph.test.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ describe('TestSummaryGraph', () => {
171171
expect(screen.getByText('Legend')).toBeInTheDocument();
172172
expect(screen.getByTestId('min')).toBeInTheDocument();
173173
expect(screen.getByTestId('max')).toBeInTheDocument();
174-
expect(screen.getByTestId('label.incident')).toBeInTheDocument();
175174
});
176175

177176
it("legend filter should update the graph's activeKeys", async () => {
@@ -194,26 +193,6 @@ describe('TestSummaryGraph', () => {
194193
expect(maxLineChart).not.toBeInTheDocument();
195194
});
196195

197-
it('legend should not filter on Incident click', async () => {
198-
render(<TestSummaryGraph {...mockProps} />);
199-
const incidentButton = screen.getByTestId('label.incident');
200-
const minLineChart = screen.getByTestId('line-min');
201-
const maxLineChart = screen.getByTestId('line-max');
202-
203-
expect(incidentButton).toBeInTheDocument();
204-
expect(minLineChart).toBeInTheDocument();
205-
expect(maxLineChart).toBeInTheDocument();
206-
207-
screen.debug(document.body);
208-
209-
await act(async () => {
210-
await fireEvent.click(incidentButton);
211-
});
212-
213-
expect(minLineChart).toBeInTheDocument();
214-
expect(maxLineChart).toBeInTheDocument();
215-
});
216-
217196
it('should call mockSetShowAILearningBanner', () => {
218197
render(<TestSummaryGraph {...mockProps} />);
219198

0 commit comments

Comments
 (0)