pawarprasad123 commented on code in PR #700:
URL: https://github.com/apache/atlas/pull/700#discussion_r3657170387


##########
dashboard/src/views/DetailPage/EntityDetailTabs/__tests__/AttributeProperties.test.tsx:
##########
@@ -337,7 +337,7 @@ describe('AttributeProperties', () => {
                                </TestWrapper>
                        );
 

Review Comment:
   1. Audit mode + undefined loading + empty Redux entityData (core bug path)
   
   it('should not render skeleton in auditDetails mode when loading is 
undefined', () => {
     mockUseSelector.mockImplementation((selector: any) =>
       selector({ entity: { entityData: {} } })
     );
     render(
       <TestWrapper>
         <AttributeProperties
           entity={defaultMockEntity}
           referredEntities={defaultMockReferredEntities}
           loading={undefined}
           auditDetails={true}
           propertiesName="Technical"
         />
       </TestWrapper>
     );
     expect(screen.queryByTestId('skeleton-loader')).not.toBeInTheDocument();
     expect(screen.getByText('Technical Properties')).toBeInTheDocument();
   });
   
   
   2. Audit mode + explicit loading still shows skeleton (negative case)
   
   it('should render skeleton in auditDetails mode when loading is true', () => 
{
     render(
       <TestWrapper>
         <AttributeProperties
           entity={defaultMockEntity}
           loading={true}
           auditDetails={true}
           propertiesName="Technical"
         />
       </TestWrapper>
     );
     expect(screen.getByTestId('skeleton-loader')).toBeInTheDocument();
   });
   
   
   3. AuditResults should assert loading={false} is passed
   
   The current mock only checks auditResultGuid:
   
   
   AuditResults.test.tsx
   Lines 113-117
   jest.mock('@views/DetailPage/EntityDetailTabs/AuditsTab', () => ({
     __esModule: true,
     default: ({ auditResultGuid }: any) => (
       <div data-testid="audits-tab">AuditsTab - {auditResultGuid}</div>
     )
   }));
   Extend the mock to expose data-loading={loading} and assert it in the purge 
modal test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to