Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/elements/content-explorer/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const Content = ({
{view === VIEW_ERROR || view === VIEW_SELECTED ? null : <ProgressBar percent={percentLoaded} />}

{!isMetadataViewV2Feature && isViewEmpty && <EmptyView view={view} isLoading={percentLoaded !== 100} />}
{isMetadataViewV2Feature && view === VIEW_ERROR && <EmptyView view={view} isLoading={false} />}
{!isMetadataViewV2Feature && !isViewEmpty && isMetadataBasedView && (
<MetadataBasedItemList
currentCollection={currentCollection}
Expand Down
3 changes: 1 addition & 2 deletions src/elements/content-explorer/MetadataViewContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ const MetadataViewContainer = ({
id: FIELD_ITEM_NAME,
isItemMetadata: true,
isRowHeader: true,
minWidth: 250,
maxWidth: 250,
minWidth: 300,
textValue: formatMessage(messages.name),
type: 'string',
},
Expand Down
28 changes: 27 additions & 1 deletion src/elements/content-explorer/__tests__/Content.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('Content Component', () => {
expect(screen.getByLabelText('File')).toBeInTheDocument();
});

describe('contentExplorer.metadataViewV2 feature', () => {
describe('MetadataView V2 feature', () => {
const features = {
contentExplorer: { metadataViewV2: true },
};
Expand Down Expand Up @@ -123,5 +123,31 @@ describe('Content Component', () => {

expect(screen.getByText('MetadataViewContainer')).toBeInTheDocument();
});

describe('EmptyView rendering for VIEW_ERROR with metadataViewV2 feature', () => {
test('renders EmptyView with isLoading=false when metadataViewV2 feature is enabled and view is VIEW_ERROR', () => {
// This test verifies that the EmptyView receives isLoading={false}
// We can verify this by checking that the loading message is not shown
renderComponent({
features,
view: VIEW_ERROR,
});

// Should show error message, not loading message
expect(screen.getByText('A network error has occurred while trying to load.')).toBeInTheDocument();
expect(screen.queryByText('Please wait while the items load...')).not.toBeInTheDocument();
});

test('does not render EmptyView when metadataViewV2 feature is enabled but view is not VIEW_ERROR', () => {
renderComponent({
features,
view: VIEW_FOLDER,
});

expect(
screen.queryByText('A network error has occurred while trying to load.'),
).not.toBeInTheDocument();
});
});
});
});