diff --git a/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx b/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx
index 05fa1dc07f..0fd336da42 100644
--- a/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx
+++ b/plugins/catalog-react/src/components/EntityNamespacePicker/EntityNamespacePicker.test.tsx
@@ -215,7 +215,7 @@ describe('', () => {
}),
);
});
- it('namespace picker is invisible if there are only 1 available option', async () => {
+ it('namespace picker is visible if there are only 1 available option', async () => {
const defaultNamespaces = ['default', 'default', 'default'];
const mockCatalogApiRefDefaultNamespace = {
getEntityFacets: async () => ({
@@ -236,6 +236,27 @@ describe('', () => {
,
);
+ await waitFor(() =>
+ expect(screen.queryByText('Namespace')).toBeInTheDocument(),
+ );
+ });
+ it('namespace picker is invisible if there is zero available option', async () => {
+ const mockCatalogApiRefDefaultNamespace = {
+ getEntityFacets: async () => ({
+ facets: {
+ 'metadata.namespace': [],
+ },
+ }),
+ } as unknown as CatalogApi;
+ await renderInTestApp(
+
+
+
+
+ ,
+ );
await waitFor(() =>
expect(screen.queryByText('Namespace')).not.toBeInTheDocument(),
);