mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-26 17:34:41 +00:00
ui: included column test case count in explore page right hand panel (#13132)
This commit is contained in:
parent
54e7e81c09
commit
39169285af
@ -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);
|
||||
|
@ -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(<TableSummary entityDetails={mockTableEntityDetails} />);
|
||||
});
|
||||
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');
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user