From b9e57c71e80964dbd094868cba5eee635caa0314 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Sat, 27 Jul 2024 10:39:13 +0530 Subject: [PATCH] Minor: fixed test case and mysql query bug (#17205) --- .../resources/ui/playwright/e2e/Pages/TestCases.spec.ts | 4 ++-- .../DataQuality/AddDataQualityTest/EditTestCaseModal.tsx | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts index 0d5c7759fda..91c6506b965 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/TestCases.spec.ts @@ -119,7 +119,7 @@ test('Table difference test case', async ({ page }) => { await test.step('Delete', async () => { await deleteTestCase(page, testCase.name); }); - } catch (error) { + } finally { await table1.delete(apiContext); await table2.delete(apiContext); @@ -212,7 +212,7 @@ test('Custom SQL Query', async ({ page }) => { await test.step('Delete', async () => { await deleteTestCase(page, testCase.name); }); - } catch (error) { + } finally { await table.delete(apiContext); await afterAction(); } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/EditTestCaseModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/EditTestCaseModal.tsx index 6548d6150a6..e772b82ceb6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/EditTestCaseModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/AddDataQualityTest/EditTestCaseModal.tsx @@ -44,6 +44,7 @@ import { } from '../../../utils/EntityUtils'; import { getEntityFQN } from '../../../utils/FeedUtils'; import { generateFormFields } from '../../../utils/formUtils'; +import { isValidJSONString } from '../../../utils/StringsUtils'; import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils'; import Loader from '../../common/Loader/Loader'; import RichTextEditor from '../../common/RichTextEditor/RichTextEditor'; @@ -144,7 +145,10 @@ const EditTestCaseModal: React.FC = ({ (definition) => definition.name === curr.name ); - if (param?.dataType === TestDataType.Array) { + if ( + param?.dataType === TestDataType.Array && + isValidJSONString(curr.value) + ) { const value = JSON.parse(curr.value || '[]'); return {