From ad40cdc1496e0c426715b3adf13a3317851efa6d Mon Sep 17 00:00:00 2001
From: Abhishek Porwal <80886271+Abhishek332@users.noreply.github.com>
Date: Thu, 8 Feb 2024 12:20:41 +0530
Subject: [PATCH] unit test for DatabaseSchemaVersionPage (#15081)
* adding unit test for DatabaseSchemaVersionPage
* added some more testcases
---
.../DatabaseSchemaVersionPage.test.tsx | 228 ++++++++++++++++++
.../mocks/DatabaseSchemaVersionPage.mock.ts | 34 +++
2 files changed, 262 insertions(+)
create mode 100644 openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.test.tsx
create mode 100644 openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/mocks/DatabaseSchemaVersionPage.mock.ts
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.test.tsx
new file mode 100644
index 00000000000..07a0ca7fa09
--- /dev/null
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/DatabaseSchemaVersionPage/DatabaseSchemaVersionPage.test.tsx
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2024 Collate.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { act, render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import React from 'react';
+import DatabaseSchemaVersionPage from './DatabaseSchemaVersionPage';
+import {
+ CURRENT_TABLE_PAGE,
+ CUSTOM_PROPERTY_TABLE,
+ CUSTOM_PROPERTY_TAB_NAME,
+ DATABASE_SCHEMA_ID,
+ DATA_ASSET_VERSION_HEADER,
+ DATA_PRODUCT_CONTAINER,
+ ENTITY_VERSION_TIMELINE,
+ ERROR_PLACEHOLDER,
+ LOADER,
+ MOCK_FQN,
+ MOCK_PARAMS,
+ SCHEMA_TABLE_TAB,
+ TAGS_CONTAINER_V2,
+} from './mocks/DatabaseSchemaVersionPage.mock';
+
+jest.mock(
+ '../../components/common/CustomPropertyTable/CustomPropertyTable',
+ () => ({
+ CustomPropertyTable: jest
+ .fn()
+ .mockImplementation(() =>