From af9f453c5f9b7456d45ca23f8234e8616581fcf4 Mon Sep 17 00:00:00 2001 From: Mark Dunphy Date: Thu, 1 May 2025 13:48:54 -0400 Subject: [PATCH] add extra test case Signed-off-by: Mark Dunphy --- .../EntityContextMenuItemBlueprint.test.tsx | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.test.tsx b/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.test.tsx index 5a272c33ca..81272de8b4 100644 --- a/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.test.tsx +++ b/plugins/catalog-react/src/alpha/blueprints/EntityContextMenuItemBlueprint.test.tsx @@ -77,7 +77,7 @@ describe('EntityContextMenuItemBlueprint', () => { `); }); - it('should filter items based on the filter function', async () => { + it('should exclude items based on the filter function', async () => { const extension = EntityContextMenuItemBlueprint.make({ name: 'test', params: { @@ -107,6 +107,36 @@ describe('EntityContextMenuItemBlueprint', () => { }); }); + it('should include items based on the filter function', async () => { + const extension = EntityContextMenuItemBlueprint.make({ + name: 'test', + params: { + icon: Icon, + filter: e => e.kind.toLowerCase() === 'component', + useProps: () => ({ + title: 'Test', + onClick: () => {}, + }), + }, + }); + + renderInTestApp( + +
    {createExtensionTester(extension).reactElement()}
+
, + ); + + await waitFor(() => { + expect(screen.getByText('Test')).toBeInTheDocument(); + }); + }); + it('should render a menu item', async () => { const extension = EntityContextMenuItemBlueprint.make({ name: 'test',