diff --git a/src/elements/content-explorer/Content.tsx b/src/elements/content-explorer/Content.tsx
index d1ed0da368..a4bcb6e83d 100644
--- a/src/elements/content-explorer/Content.tsx
+++ b/src/elements/content-explorer/Content.tsx
@@ -80,6 +80,7 @@ const Content = ({
{view === VIEW_ERROR || view === VIEW_SELECTED ? null : }
{!isMetadataViewV2Feature && isViewEmpty && }
+ {isMetadataViewV2Feature && view === VIEW_ERROR && }
{!isMetadataViewV2Feature && !isViewEmpty && isMetadataBasedView && (
{
expect(screen.getByLabelText('File')).toBeInTheDocument();
});
- describe('contentExplorer.metadataViewV2 feature', () => {
+ describe('MetadataView V2 feature', () => {
const features = {
contentExplorer: { metadataViewV2: true },
};
@@ -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();
+ });
+ });
});
});