diff --git a/dashboard/src/views/Administrator/Audits/AuditResults.tsx b/dashboard/src/views/Administrator/Audits/AuditResults.tsx index 984221b1529..acde90ff397 100644 --- a/dashboard/src/views/Administrator/Audits/AuditResults.tsx +++ b/dashboard/src/views/Administrator/Audits/AuditResults.tsx @@ -232,7 +232,7 @@ const AuditResults = ({ componentProps, row }: any) => { button2Handler={undefined} maxWidth="lg" > - + )} diff --git a/dashboard/src/views/Administrator/Audits/__tests__/AuditResults.test.tsx b/dashboard/src/views/Administrator/Audits/__tests__/AuditResults.test.tsx index 0fc580d4d17..1896838f7d6 100644 --- a/dashboard/src/views/Administrator/Audits/__tests__/AuditResults.test.tsx +++ b/dashboard/src/views/Administrator/Audits/__tests__/AuditResults.test.tsx @@ -112,8 +112,8 @@ jest.mock('@utils/Muiutils', () => ({ jest.mock('@views/DetailPage/EntityDetailTabs/AuditsTab', () => ({ __esModule: true, - default: ({ auditResultGuid }: any) => ( -
AuditsTab - {auditResultGuid}
+ default: ({ auditResultGuid, loading }: any) => ( +
AuditsTab - {auditResultGuid}
) })); @@ -425,6 +425,7 @@ describe('AuditResults Component', () => { expect(screen.getByTestId('modal-title')).toHaveTextContent('Purged Entity Details: guid-1'); expect(screen.getByTestId('audits-tab')).toBeInTheDocument(); + expect(screen.getByTestId('audits-tab')).toHaveAttribute('data-loading', 'false'); }); it('should open auto purge modal with correct title', async () => { diff --git a/dashboard/src/views/DetailPage/EntityDetailTabs/AttributeProperties.tsx b/dashboard/src/views/DetailPage/EntityDetailTabs/AttributeProperties.tsx index 0aaeb774ef3..bdf10246d6d 100644 --- a/dashboard/src/views/DetailPage/EntityDetailTabs/AttributeProperties.tsx +++ b/dashboard/src/views/DetailPage/EntityDetailTabs/AttributeProperties.tsx @@ -222,7 +222,7 @@ const AttributeProperties = ({ - {loading == undefined || loading || isEmpty(entityData) ? ( + {loading === true || (!auditDetails && isEmpty(entityData)) ? ( <> diff --git a/dashboard/src/views/DetailPage/EntityDetailTabs/__tests__/AttributeProperties.test.tsx b/dashboard/src/views/DetailPage/EntityDetailTabs/__tests__/AttributeProperties.test.tsx index 2eb488a385b..158b9b66fe1 100644 --- a/dashboard/src/views/DetailPage/EntityDetailTabs/__tests__/AttributeProperties.test.tsx +++ b/dashboard/src/views/DetailPage/EntityDetailTabs/__tests__/AttributeProperties.test.tsx @@ -325,7 +325,7 @@ describe('AttributeProperties', () => { expect(screen.getByTestId('skeleton-loader')).toBeInTheDocument(); }); - it('should render loading skeleton when loading is undefined', () => { + it('should render properties when loading is undefined and entityData is available', () => { render( { ); - expect(screen.getByTestId('skeleton-loader')).toBeInTheDocument(); + expect(screen.queryByTestId('skeleton-loader')).not.toBeInTheDocument(); }); it('should render loading skeleton when entityData is empty', () => { @@ -364,6 +364,40 @@ describe('AttributeProperties', () => { expect(screen.getByTestId('skeleton-loader')).toBeInTheDocument(); }); + it('should not render skeleton in auditDetails mode when loading is undefined', () => { + mockUseSelector.mockImplementation((selector: any) => + selector({ entity: { entityData: {} } }) + ); + render( + + + + ); + expect(screen.queryByTestId('skeleton-loader')).not.toBeInTheDocument(); + expect(screen.getByText('Technical Properties')).toBeInTheDocument(); + }); + + it('should render skeleton in auditDetails mode when loading is true', () => { + render( + + + + ); + expect(screen.getByTestId('skeleton-loader')).toBeInTheDocument(); + }); + it('should render "No Record Found" when properties are empty', () => { const emptyEntity = { typeName: 'DataSet',