diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.component.tsx index 699bed19dd0..79df56fc39f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.component.tsx @@ -136,15 +136,14 @@ function TableSummary({ results: { ...INITIAL_TEST_RESULT_SUMMARY }, }; data.forEach((test) => { - if (test.entityFQN === entityDetails?.fullyQualifiedName) { - tableTests.tests.push(test); + tableTests.tests.push(test); - updateTestResults( - tableTests.results, - test.testCaseResult?.testCaseStatus || '' - ); - } + updateTestResults( + tableTests.results, + test.testCaseResult?.testCaseStatus || '' + ); }); + setTableTests(tableTests); } catch (error) { showErrorToast(error as AxiosError); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.test.tsx index 19e297301b1..77989b49248 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/EntitySummaryPanel/TableSummary/TableSummary.test.tsx @@ -12,9 +12,11 @@ */ import { act, render, screen } from '@testing-library/react'; +import { MOCK_TEST_CASE } from 'mocks/TestSuite.mock'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; import { getLatestTableProfileByFqn } from 'rest/tableAPI'; +import { getListTestCase } from 'rest/testAPI'; import { DRAWER_NAVIGATION_OPTIONS } from 'utils/EntityUtils'; import { mockTableEntityDetails } from '../mocks/TableSummary.mock'; import TableSummary from './TableSummary.component'; @@ -178,4 +180,24 @@ describe('TableSummary component tests', () => { expect(testsAbortedValue).toContainHTML('00'); expect(testsFailedValue).toContainHTML('00'); }); + + it('column test case count should appear', async () => { + (getListTestCase as jest.Mock).mockImplementation(() => ({ + data: MOCK_TEST_CASE, + })); + (getLatestTableProfileByFqn as jest.Mock).mockImplementationOnce(() => ({ + ...mockTableEntityDetails, + profile: { rowCount: 30, columnCount: 2, timestamp: 38478857 }, + })); + await act(async () => { + render(); + }); + const testsPassedValue = screen.getByTestId('test-passed-value'); + const testsAbortedValue = screen.getByTestId('test-aborted-value'); + const testsFailedValue = screen.getByTestId('test-failed-value'); + + expect(testsPassedValue).toContainHTML('03'); + expect(testsAbortedValue).toContainHTML('01'); + expect(testsFailedValue).toContainHTML('01'); + }); });