Brijesh619 commented on code in PR #688:
URL: https://github.com/apache/atlas/pull/688#discussion_r3841301818
##########
dashboard/src/components/EntityDisplayImage.tsx:
##########
@@ -38,7 +39,7 @@ const DisplayImage = ({
const primaryUrl = getEntityIconPath({ entityData }) || "";
const fallbackUrl = getEntityIconPath({ entityData, errorUrl: primaryUrl })
|| "";
- const handleError = (e: React.SyntheticEvent<HTMLImageElement, Event>) => {
+ const handleError = (e: SyntheticEvent<HTMLImageElement, Event>) => {
Review Comment:
I have fixed the image fallback check in EntityDisplayImage.tsx. It now uses
!target.src.endsWith(fallbackUrl) instead of a strict equality check to
correctly account for the browser resolving target.src to an absolute URL while
the fallbackUrl may be relative.
##########
dashboard/src/views/SideBar/__tests__/SideBarBody.test.tsx:
##########
@@ -497,11 +500,32 @@ describe('SideBarBody', () => {
expect(mockHandleOpenAboutModal).toHaveBeenCalled();
});
- it('should pass loading prop to ClassificationTree', () => {
- const props = { ...defaultProps, loading: true };
- renderWithProviders(props);
-
- expect(screen.getByTestId('classification-tree')).toBeInTheDocument();
+ it('should show "Version unavailable" if versionError is set', () => {
+ const stateWithVersionError = {
+ session: {
+ versionData: {
+ loading: false,
+ data: null,
+ error: { message: "Failed to fetch version" }
+ }
+ }
+ };
+ renderWithProviders({}, { store: createMockStore(stateWithVersionError)
});
+
+ expect(screen.getByText('Version unavailable')).toBeInTheDocument();
+ });
+
+ it('should hide relationships icon when relationshipSearch is falsy', ()
=> {
Review Comment:
I have updated the SideBarBody.test.tsx file as per your suggestions:
Overridden the Enum mock for the relationshipSearch behavior test, collapsed
the drawer, and asserted the absence of relationships icon and
relationships-tree.
Added missing test cases to comprehensively validate active state markers
for Glossary, Classifications, Business Metadata, and Relationships modules.
##########
dashboard/src/views/SideBar/SideBarTree/SideBarTree.tsx:
##########
@@ -970,10 +970,7 @@ const BarTreeView: FC<{
<LightTooltip title={label} disableHoverListener={!isOverflown}>
<span
Review Comment:
I have removed searchTerm from the useEffect dependency array for
TreeLabelWithTooltip. The recalculation is now correctly scoped only to label
changes.
--
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]