ui: included column test case count in explore page right hand panel (#13132)

This commit is contained in:
Shailesh Parmar 2023-09-12 14:28:06 +05:30 committed by GitHub
parent 54e7e81c09
commit 39169285af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 7 deletions

View File

@ -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);

View File

@ -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');
});
});