diff --git a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/FrequentlyJoinedTables.test.tsx b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/FrequentlyJoinedTables.test.tsx index e6b9cfe5bfe..fb19b061ff0 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/FrequentlyJoinedTables.test.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/FrequentlyJoinedTables.test.tsx @@ -22,23 +22,23 @@ import FrequentlyJoinedTables from './FrequentlyJoinedTables'; const mockTableList = [ { - name: 'dim_customer', - fqn: 'string.1', + fullyQualifiedName: 'bigquery.shopify.fact_order', + joinCount: 150, + name: 'shopify/fact_order', + }, + { + fullyQualifiedName: 'bigquery.shopify.fact_sale', + joinCount: 55, + name: 'shopify/fact_sale', + }, + { + name: 'shopify/dim_product', + fullyQualifiedName: 'string.3', joinCount: 1, }, { - name: 'fact_sale', - fqn: 'string.2', - joinCount: 1, - }, - { - name: 'dim_product', - fqn: 'string.3', - joinCount: 1, - }, - { - name: 'dim_address', - fqn: 'string.4', + name: 'shopify/dim_address', + fullyQualifiedName: 'string.4', joinCount: 1, }, ]; @@ -69,9 +69,9 @@ describe('Test QueryDetails Component', () => { expect(tableData.length).toBe(4); expect(tableData.map((tableName) => tableName.textContent)).toStrictEqual([ - 'dim_address1', - 'dim_product1', - 'fact_sale1', + 'shopify/fact_order150', + 'shopify/fact_sale55', + 'shopify/dim_address1', '+ 1 more', ]); }); diff --git a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.test.tsx b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.test.tsx index d83922e3f3f..a7ba5acef42 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.test.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/my-data-details/SchemaTab.test.tsx @@ -15,7 +15,7 @@ * limitations under the License. */ -import { getByTestId, render } from '@testing-library/react'; +import { getByTestId, getByText, render } from '@testing-library/react'; import { TableDetail } from 'Models'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; @@ -60,6 +60,10 @@ jest.mock('./SampleDataTable', () => { return jest.fn().mockReturnValue(
SampleDataTable
); }); +jest.mock('./EntityTable', () => { + return jest.fn().mockReturnValue(EntityTable
); +}); + jest.mock('./SchemaTable', () => { return jest .fn() @@ -86,7 +90,7 @@ describe('Test SchemaTab Component', () => { expect(searchBar).toBeInTheDocument(); - const schemaTable = getByTestId(container, 'schema-table'); + const schemaTable = getByText(container, /EntityTable/i); expect(schemaTable).toBeInTheDocument(); expect(queryByTestId('sample-data-table')).toBeNull(); diff --git a/catalog-rest-service/src/main/resources/ui/src/pages/my-data-details/index.test.tsx b/catalog-rest-service/src/main/resources/ui/src/pages/my-data-details/index.test.tsx index f0ae717107a..acf2ba7fa3f 100644 --- a/catalog-rest-service/src/main/resources/ui/src/pages/my-data-details/index.test.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/pages/my-data-details/index.test.tsx @@ -43,6 +43,14 @@ jest.mock('../../components/my-data-details/ManageTab', () => { return jest.fn().mockReturnValue(ManageTab
); }); +jest.mock('../../components/dataset-lineage/EntityLineage', () => { + return jest.fn().mockReturnValue(Lineage
); +}); + +jest.mock('../../components/my-data-details/ProfilerTable', () => { + return jest.fn().mockReturnValue(ProfilerTable
); +}); + jest.mock('../../components/common/description/Description', () => { return jest.fn().mockReturnValue(Description
); }); @@ -60,7 +68,6 @@ jest.mock('../../utils/CommonUtils', () => ({ })); describe('Test MyDataDetailsPage page', () => { - // Rewrite this test as component has actual data from api and api is not mocked here it('Checks if the page has all the proper components rendered', () => { const { container } = render(