From 7a7073f75c70f43a4a9334bfb98c130caffe495e Mon Sep 17 00:00:00 2001 From: Sarah Medeiros Date: Fri, 9 Dec 2022 14:57:00 -0500 Subject: [PATCH] Add test for new functionality Signed-off-by: Sarah Medeiros --- .../EntityLifecyclePicker.test.tsx | 18 +++++++++++++++++- .../EntityOwnerPicker.test.tsx | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.test.tsx b/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.test.tsx index d1fab823be..ef77f7615f 100644 --- a/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityLifecyclePicker/EntityLifecyclePicker.test.tsx @@ -184,7 +184,6 @@ describe('', () => { updateFilters, queryParameters: { lifecycles: ['production'] }, backendEntities: sampleEntities, - q, }} > @@ -194,4 +193,21 @@ describe('', () => { lifecycles: new EntityLifecycleFilter(['production']), }); }); + it('removes lifecycles from filters if there are no available lifecycles', () => { + const updateFilters = jest.fn(); + render( + + + , + ); + expect(updateFilters).toHaveBeenLastCalledWith({ + lifecycles: undefined, + }); + }); }); diff --git a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx index 6eebaa2409..b6e928b519 100644 --- a/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityOwnerPicker/EntityOwnerPicker.test.tsx @@ -207,4 +207,21 @@ describe('', () => { owners: new EntityOwnerFilter(['team-b']), }); }); + it('removes owners from filters if there are none available', () => { + const updateFilters = jest.fn(); + render( + + + , + ); + expect(updateFilters).toHaveBeenLastCalledWith({ + owners: undefined, + }); + }); });