diff --git a/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx b/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx
index c92d7f6236..7dd13620c7 100644
--- a/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx
+++ b/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx
@@ -194,7 +194,7 @@ describe('', () => {
const mockCatalogApiRefNoNamespace = {
getEntityFacets: async () => ({
facets: {
- 'metadata.tags': {},
+ 'metadata.namespace': {},
},
}),
} as unknown as CatalogApi;
@@ -217,4 +217,29 @@ describe('', () => {
}),
);
});
+ it('namespace picker is invisible if there are only 1 available option', async () => {
+ const defaultNamespaces = ['default', 'default', 'default'];
+ const mockCatalogApiRefDefaultNamespace = {
+ getEntityFacets: async () => ({
+ facets: {
+ 'metadata.namespace': defaultNamespaces.map((value, idx) => ({
+ value,
+ count: idx,
+ })),
+ },
+ }),
+ } as unknown as CatalogApi;
+ render(
+
+
+
+
+ ,
+ );
+ await waitFor(() =>
+ expect(screen.queryByText('Namespace')).not.toBeInTheDocument(),
+ );
+ });
});