From 436b4f50bb1e697391dd071eff78729605f77c1a Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Wed, 22 Feb 2023 12:00:09 -0500 Subject: [PATCH] Add namespace check as well. Signed-off-by: Aramis Sennyey --- .../EntityOwnerPicker.test.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx index 00b820f5b2..f33fde19b0 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx @@ -57,6 +57,15 @@ const ownerEntities: Entity[] = [ title: 'Another Owner', }, }, + { + apiVersion: '1', + kind: 'Group', + metadata: { + namespace: 'test-namespace', + name: 'another-owner-2', + title: 'Another Owner in Another Namespace', + }, + }, ]; const sampleEntities: Entity[] = [ @@ -88,6 +97,10 @@ const sampleEntities: Entity[] = [ type: 'ownedBy', targetRef: 'group:default/another-owner', }, + { + type: 'ownedBy', + targetRef: 'group:test-namespace/another-owner-2', + }, ], }, { @@ -134,7 +147,12 @@ describe('', () => { expect(screen.getByText('Owner')).toBeInTheDocument(); fireEvent.click(screen.getByTestId('owner-picker-expand')); - ['Another Owner', 'some-owner', 'Some Owner 2'].forEach(owner => { + [ + 'Another Owner', + 'some-owner', + 'Some Owner 2', + 'Another Owner in Another Namespace', + ].forEach(owner => { expect(screen.getByText(owner)).toBeInTheDocument(); }); }); @@ -155,6 +173,7 @@ describe('', () => { expect(screen.getAllByRole('option').map(o => o.textContent)).toEqual([ 'Another Owner', + 'Another Owner in Another Namespace', 'some-owner', 'Some Owner 2', ]);