Minor: fixed data quality page type issue (#16556)

This commit is contained in:
Shailesh Parmar 2024-06-06 19:51:25 +05:30 committed by GitHub
parent 9fbc37839d
commit 6c510a567b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 5 deletions

View File

@ -164,9 +164,9 @@ export const TestSuites = ({ summaryPanel }: { summaryPanel: ReactNode }) => {
title: `${t('label.success')} %`,
dataIndex: 'summary',
key: 'success',
render: (value: TestSummary) => {
render: (value: TestSuite['summary']) => {
const percent =
value.total && value.success ? value.success / value.total : 0;
value?.total && value?.success ? value.success / value.total : 0;
return (
<ProfilerProgressWidget

View File

@ -33,6 +33,34 @@ const mockLocation = {
search: '',
};
const mockList = {
data: [
{
id: 'id',
name: 'sample_data.ecommerce_db.shopify.dim_address.testSuite',
fullyQualifiedName:
'sample_data.ecommerce_db.shopify.dim_address.testSuite',
description: 'This is an executable test suite linked to an entity',
serviceType: 'TestSuite',
href: 'href',
deleted: false,
executable: true,
executableEntityReference: {
id: 'id1',
type: 'table',
name: 'dim_address',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.dim_address',
},
testCaseResultSummary: [],
},
],
paging: {
offset: 0,
limit: 15,
total: 1,
},
};
jest.mock('../../../../context/PermissionProvider/PermissionProvider', () => ({
usePermissionProvider: jest.fn().mockImplementation(() => ({
permissions: {
@ -45,9 +73,7 @@ jest.mock('../../../../rest/testAPI', () => {
...jest.requireActual('../../../../rest/testAPI'),
getListTestSuitesBySearch: jest
.fn()
.mockImplementation(() =>
Promise.resolve({ data: [], paging: { total: 0 } })
),
.mockImplementation(() => Promise.resolve(mockList)),
};
});
jest.mock('react-router-dom', () => {