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


##########
dashboard/src/views/__tests__/EntityForm.test.tsx:
##########
@@ -266,6 +266,20 @@ describe('EntityForm - 100% Coverage', () => {
                        
expect(screen.getByTestId('modal-title')).toHaveTextContent('Create entity');
                });
 
+               test('opens in create mode when isAdd=true even if URL has 
guid', async () => {
+                       mockGuid = 'existing-guid-123';
+                       const store = createStore(mockEntityData, 
mockSessionData, mockTypeHeaderData);
+                       render(
+                               <Provider store={store}>
+                                       <MemoryRouter>
+                                               <EntityForm open={true} 
onClose={jest.fn()} isAdd={true} />
+                                       </MemoryRouter>
+                               </Provider>
+                       );
+                       
expect(screen.getByTestId('modal-title')).toHaveTextContent('Create entity');
+                       expect(mockGetEntity).not.toHaveBeenCalled();
+               });
+
                test('does not render when open is false', () => {

Review Comment:
   Can you confirm and update this test here
   
   1) Ensures getEntity is not called and title is "Create entity"
   - EntityForm with isAdd={true} + mockGuid='abc'
   2) Ensures edit behavior is unchanged
   - EntityForm with isAdd={false} + mockGuid='abc'
   
   -----------
   
   `it('opens in Create mode when isAdd=true even if URL has guid', async () => 
{
     mockGuid = 'detail-page-guid-123';
     render(
       <Provider store={store}>
         <MemoryRouter initialEntries={['/detailPage/detail-page-guid-123']}>
           <EntityForm open={true} onClose={jest.fn()} isAdd={true} />
         </MemoryRouter>
       </Provider>
     );
     expect(screen.getByTestId('modal-title')).toHaveTextContent('Create 
entity');
     expect(mockGetEntity).not.toHaveBeenCalled();
   });`



-- 
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