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


##########
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:
   Added the requested test cases to explicitly verify both scenarios: it now 
confirms getEntity is bypassed in Create mode (isAdd=true) when a GUID is 
present, and verifies that the original Edit mode behavior (isAdd=false) 
remains unchanged.
   
   <img width="1366" height="768" alt="Screenshot from 2026-07-15 15-20-56" 
src="https://github.com/user-attachments/assets/1e4ad08a-0dfd-47e6-bd15-fa1aafbe9d4e";
 />
   



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