From fb5988d5d8fc1d4fb82c58e006f1e77a0f2d8b8e Mon Sep 17 00:00:00 2001 From: Victor Perera Date: Fri, 8 Oct 2021 17:36:25 -0500 Subject: [PATCH] EntityFilterType test Signed-off-by: Victor Perera --- .../EntityTypePicker.test.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx index 9912f3d371..232f4f250d 100644 --- a/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx +++ b/plugins/catalog-react/src/components/EntityTypePicker/EntityTypePicker.test.tsx @@ -121,4 +121,27 @@ describe('', () => { expect(updateFilters).toHaveBeenLastCalledWith({ type: undefined }); }); + + it('respects the query parameter filter value', async () => { + const updateFilters = jest.fn(); + const queryParameters = { type: 'tool' }; + await renderWithEffects( + + + + , + , + ); + + expect(updateFilters).toHaveBeenLastCalledWith({ + type: new EntityTypeFilter(['tool']), + }); + }); });