From aa7b95a515a6a72b7bad5f49aa19963b85c25be7 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Mon, 7 Oct 2024 17:10:28 +0530 Subject: [PATCH] MINOR: supported search filter and only all show in case of all node value selected (#18136) * supported search filter and only all show in case of all node value selected * updated the playwright test as per the all selector * fix playwright and unit test --- .../ui/playwright/e2e/Pages/SearchIndexApplication.spec.ts | 5 ++++- .../JSONSchema/JsonSchemaWidgets/TreeSelectWidget.test.tsx | 4 ++-- .../Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.tsx | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchIndexApplication.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchIndexApplication.spec.ts index 3ed0cfb80b6..f8ade277ef4 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchIndexApplication.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/SearchIndexApplication.spec.ts @@ -105,7 +105,10 @@ test('Search Index Application', async ({ page }) => { await page.click('[data-testid="configuration"]'); await page.fill('#root\\/batchSize', '0'); - await page.getByTitle('chart').getByLabel('close').click(); + await page.getByTestId('tree-select-widget').click(); + + // uncheck the entity + await page.getByRole('tree').getByTitle('Topic').click(); await page.click( '[data-testid="select-widget"] > .ant-select-selector > .ant-select-selection-item' diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.test.tsx index 13ef257bc65..4adfe9091d9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.test.tsx @@ -89,10 +89,10 @@ describe('Test TreeSelectWidget Component', () => { userEvent.click(treeSelectInput); }); - await waitForElement(() => screen.getAllByText('Table')); + await waitForElement(() => screen.getByText('Table')); await act(async () => { - fireEvent.click(screen.getAllByText('Table')[1]); + fireEvent.click(screen.getByText('Table')); }); expect(mockOnChange).toHaveBeenCalledTimes(1); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.tsx index 3fbda8b4cbb..44e3baf96ac 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/Form/JSONSchema/JsonSchemaWidgets/TreeSelectWidget.tsx @@ -49,7 +49,7 @@ const TreeSelectWidget: FC = ({ treeDefaultExpandAll data-testid="tree-select-widget" disabled={rest.disabled} - filterTreeNode={false} + showCheckedStrategy={TreeSelect.SHOW_PARENT} style={{ width: '100%', }}