mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 17:37:33 +00:00
build(react): Fix typescript errors in test files (#9982)
Co-authored-by: Andrew Sikowitz <andrew.sikowitz@acryl.io>
This commit is contained in:
parent
eed0abe076
commit
3e31ae4127
@ -1,9 +1,10 @@
|
||||
import { DateInterval, TimeSeriesChart } from '../../../../types.generated';
|
||||
import { computeLines } from '../TimeSeriesChart';
|
||||
|
||||
describe('timeSeriesChart', () => {
|
||||
describe('computeLines', () => {
|
||||
it('compute lines works works correctly for weekly case', () => {
|
||||
const chartData = {
|
||||
const chartData: TimeSeriesChart = {
|
||||
title: 'Weekly Active Users',
|
||||
lines: [
|
||||
{
|
||||
@ -15,7 +16,7 @@ describe('timeSeriesChart', () => {
|
||||
start: '1672012800000',
|
||||
end: '1677369600000',
|
||||
},
|
||||
interval: 'WEEK',
|
||||
interval: DateInterval.Week,
|
||||
};
|
||||
const result = computeLines(chartData, true);
|
||||
expect(result[0]).toEqual({
|
||||
@ -35,7 +36,7 @@ describe('timeSeriesChart', () => {
|
||||
});
|
||||
|
||||
it('compute lines works works correctly for monthly case', () => {
|
||||
const chartData = {
|
||||
const chartData:TimeSeriesChart = {
|
||||
title: 'Weekly Active Users',
|
||||
lines: [
|
||||
{
|
||||
@ -51,7 +52,7 @@ describe('timeSeriesChart', () => {
|
||||
start: '1648771200000',
|
||||
end: '1680307199999',
|
||||
},
|
||||
interval: 'MONTH',
|
||||
interval: DateInterval.Month,
|
||||
};
|
||||
const result = computeLines(chartData, true);
|
||||
expect(result[0]).toEqual({
|
||||
|
||||
@ -13,11 +13,11 @@ import { mocks } from '../../../../../Mocks';
|
||||
import { SchemaTab } from '../../../shared/tabs/Dataset/Schema/SchemaTab';
|
||||
import EntityContext from '../../../shared/EntityContext';
|
||||
import { EntityType, SchemaMetadata } from '../../../../../types.generated';
|
||||
import { SchemaRow } from'../../../shared/tabs/Dataset/Schema/components/SchemaRow';
|
||||
import { SchemaRow } from '../../../shared/tabs/Dataset/Schema/components/SchemaRow';
|
||||
|
||||
vi.mock('virtualizedtableforantd4', async () => {
|
||||
return {
|
||||
...await vi.importActual<object>('virtualizedtableforantd4'),
|
||||
...(await vi.importActual<object>('virtualizedtableforantd4')),
|
||||
useVT: () => [{ body: { row: SchemaRow } }, vi.fn()],
|
||||
};
|
||||
});
|
||||
@ -38,6 +38,9 @@ describe('Schema', () => {
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -60,13 +63,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchema as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -97,13 +105,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchemaWithTags as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -124,13 +137,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchemaWithTags as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -150,13 +168,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchemaWithTags as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -176,13 +199,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchemaWithPkFk as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -202,13 +230,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchemaWithPkFk as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -234,13 +267,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchemaWithKeyValueFields as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -273,13 +311,18 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchemaWithoutFields as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
@ -325,7 +368,9 @@ describe('Schema', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
schemaMetadata: sampleSchema as SchemaMetadata,
|
||||
},
|
||||
baseEntity: {
|
||||
@ -337,6 +382,9 @@ describe('Schema', () => {
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<SchemaTab />
|
||||
|
||||
@ -4,6 +4,7 @@ import React from 'react';
|
||||
import { mocks } from '../../../../../Mocks';
|
||||
import TestPageContainer from '../../../../../utils/test-utils/TestPageContainer';
|
||||
import { Preview } from '../Preview';
|
||||
import { PreviewType } from '../../../Entity';
|
||||
|
||||
describe('Preview', () => {
|
||||
it('renders', () => {
|
||||
@ -15,6 +16,7 @@ describe('Preview', () => {
|
||||
name="name"
|
||||
description="definition"
|
||||
owners={null}
|
||||
previewType={PreviewType.PREVIEW}
|
||||
/>
|
||||
</TestPageContainer>
|
||||
</MockedProvider>,
|
||||
|
||||
@ -7,7 +7,7 @@ import GlossaryTermHeader from '../GlossaryTermHeader';
|
||||
|
||||
const glossaryTermHeaderData = {
|
||||
definition: 'this is sample definition',
|
||||
termSource: 'termSource',
|
||||
sourceUrl: 'sourceUrl',
|
||||
sourceRef: 'Source ref',
|
||||
fqdn: 'fqdn',
|
||||
};
|
||||
@ -19,9 +19,9 @@ describe('Glossary Term Header', () => {
|
||||
<TestPageContainer>
|
||||
<GlossaryTermHeader
|
||||
definition={glossaryTermHeaderData.definition}
|
||||
termSource={glossaryTermHeaderData.termSource}
|
||||
sourceUrl={glossaryTermHeaderData.sourceUrl}
|
||||
sourceRef={glossaryTermHeaderData.sourceRef}
|
||||
fqdn={glossaryTermHeaderData.fqdn}
|
||||
ownership={undefined}
|
||||
/>
|
||||
</TestPageContainer>
|
||||
</MockedProvider>,
|
||||
|
||||
@ -51,8 +51,8 @@ describe('EntityProfile', () => {
|
||||
display: {
|
||||
visible: (_, _1) => true,
|
||||
enabled: (_, dataset: GetDatasetQuery) =>
|
||||
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -136,8 +136,8 @@ describe('EntityProfile', () => {
|
||||
display: {
|
||||
visible: (_, _1) => true,
|
||||
enabled: (_, dataset: GetDatasetQuery) =>
|
||||
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -220,8 +220,8 @@ describe('EntityProfile', () => {
|
||||
display: {
|
||||
visible: (_, _1) => true,
|
||||
enabled: (_, dataset: GetDatasetQuery) =>
|
||||
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -314,12 +314,6 @@ describe('EntityProfile', () => {
|
||||
{
|
||||
name: 'Lineage',
|
||||
component: LineageTab,
|
||||
display: {
|
||||
visible: (_, _1) => true,
|
||||
enabled: (_, dataset: GetDatasetQuery) =>
|
||||
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Queries',
|
||||
@ -401,8 +395,8 @@ describe('EntityProfile', () => {
|
||||
display: {
|
||||
visible: (_, _1) => true,
|
||||
enabled: (_, dataset: GetDatasetQuery) =>
|
||||
(dataset?.dataset?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
(dataset?.dataset?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
((dataset?.dataset as any)?.upstreamLineage?.entities?.length || 0) > 0 ||
|
||||
((dataset?.dataset as any)?.downstreamLineage?.entities?.length || 0) > 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@ -29,6 +29,12 @@ describe('Form', () => {
|
||||
urn: '',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: mockEntityDataWithFieldPrompts,
|
||||
baseEntity: {},
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<Form formUrn="urn:li:form:1" />
|
||||
@ -50,6 +56,12 @@ describe('Form', () => {
|
||||
urn: '',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: mockEntityData,
|
||||
baseEntity: {},
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<Form formUrn="urn:li:form:3" />
|
||||
|
||||
@ -80,6 +80,8 @@ describe('handleAccessRoles', () => {
|
||||
createTags: true,
|
||||
manageGlobalViews: true,
|
||||
manageOwnershipTypes: true,
|
||||
manageGlobalAnnouncements: true,
|
||||
manageTokens: true,
|
||||
__typename: 'PlatformPrivileges',
|
||||
},
|
||||
__typename: 'AuthenticatedUser',
|
||||
@ -155,6 +157,8 @@ describe('handleAccessRoles', () => {
|
||||
createTags: true,
|
||||
manageGlobalViews: true,
|
||||
manageOwnershipTypes: true,
|
||||
manageGlobalAnnouncements: true,
|
||||
manageTokens: true,
|
||||
__typename: 'PlatformPrivileges',
|
||||
},
|
||||
__typename: 'AuthenticatedUser',
|
||||
@ -246,6 +250,8 @@ describe('handleAccessRoles', () => {
|
||||
createTags: true,
|
||||
manageGlobalViews: true,
|
||||
manageOwnershipTypes: true,
|
||||
manageGlobalAnnouncements: true,
|
||||
manageTokens: true,
|
||||
__typename: 'PlatformPrivileges',
|
||||
},
|
||||
__typename: 'AuthenticatedUser',
|
||||
|
||||
@ -25,6 +25,10 @@ describe('SchemaDescriptionField', () => {
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
refetch: vi.fn(),
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<DocumentationTab />
|
||||
@ -44,7 +48,9 @@ describe('SchemaDescriptionField', () => {
|
||||
urn: 'urn:li:dataset:123',
|
||||
entityType: EntityType.Dataset,
|
||||
entityData: {
|
||||
description: 'This is a description',
|
||||
properties: {
|
||||
description: 'This is a description',
|
||||
},
|
||||
editableProperties: {
|
||||
description: 'Edited description',
|
||||
},
|
||||
@ -52,6 +58,10 @@ describe('SchemaDescriptionField', () => {
|
||||
baseEntity: {},
|
||||
updateEntity: vi.fn(),
|
||||
routeToTab: vi.fn(),
|
||||
loading: true,
|
||||
lineage: undefined,
|
||||
refetch: vi.fn(),
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<DocumentationTab />
|
||||
|
||||
@ -27,6 +27,8 @@ describe('DataJobFlowTab', () => {
|
||||
routeToTab: vi.fn(),
|
||||
refetch: vi.fn(),
|
||||
lineage: undefined,
|
||||
loading: true,
|
||||
dataNotCombinedWithSiblings: null,
|
||||
}}
|
||||
>
|
||||
<DataJobFlowTab />
|
||||
|
||||
@ -63,7 +63,7 @@ describe('LineageEdges', () => {
|
||||
|
||||
expect(queryByTestId('empty-lineage')).not.toBeInTheDocument();
|
||||
expect(entityItems).toHaveLength(1);
|
||||
expect(getByText(dataset4WithLineage.downstream.relationships[0].entity.properties.name)).toBeInTheDocument();
|
||||
expect(getByText(dataset4WithLineage.downstream.relationships[0]!.entity!.properties!.name!)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should remove entities from the displayed list if the urn is in entitiesToRemove', async () => {
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
dataset6WithLineage,
|
||||
mocks,
|
||||
} from '../../../Mocks';
|
||||
import { Direction, FetchedEntities } from '../types';
|
||||
import { Direction, EntityAndType, FetchedEntities } from '../types';
|
||||
import constructTree from '../utils/constructTree';
|
||||
import LineageTree from '../LineageTree';
|
||||
import extendAsyncEntities from '../utils/extendAsyncEntities';
|
||||
@ -47,7 +47,7 @@ describe('LineageTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity, type: EntityType.Dataset } as EntityAndType,
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -78,7 +78,7 @@ describe('LineageTree', () => {
|
||||
scaleXMax={2}
|
||||
scaleYMin={1 / 8}
|
||||
scaleYMax={2}
|
||||
transformMatrix={initialTransform}
|
||||
initialTransformMatrix={initialTransform}
|
||||
>
|
||||
{(zoom) => (
|
||||
<svg>
|
||||
@ -90,13 +90,13 @@ describe('LineageTree', () => {
|
||||
onLineageExpand={vi.fn()}
|
||||
canvasHeight={yMax}
|
||||
margin={margin}
|
||||
direction={Direction.Upstream}
|
||||
setIsDraggingNode={vi.fn()}
|
||||
draggedNodes={{}}
|
||||
setDraggedNodes={vi.fn()}
|
||||
onEntityCenter={vi.fn()}
|
||||
setHoveredEntity={vi.fn()}
|
||||
fetchedEntities={mockFetchedEntities}
|
||||
setUpdatedLineages={vi.fn()}
|
||||
/>
|
||||
</svg>
|
||||
)}
|
||||
|
||||
@ -14,9 +14,9 @@ import {
|
||||
import constructTree from '../utils/constructTree';
|
||||
import extendAsyncEntities from '../utils/extendAsyncEntities';
|
||||
import adjustVXTreeLayout from '../utils/adjustVXTreeLayout';
|
||||
import { NodeData, Direction, FetchedEntities } from '../types';
|
||||
import { NodeData, Direction, FetchedEntities, EntityAndType } from '../types';
|
||||
import { getTestEntityRegistry } from '../../../utils/test-utils/TestPageContainer';
|
||||
import { EntityType } from '../../../types.generated';
|
||||
import { Dataset, Entity, EntityType } from '../../../types.generated';
|
||||
|
||||
const testEntityRegistry = getTestEntityRegistry();
|
||||
|
||||
@ -34,7 +34,7 @@ describe('adjustVXTreeLayout', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity, type: EntityType.Dataset } as EntityAndType,
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -85,7 +85,7 @@ describe('adjustVXTreeLayout', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity, type: EntityType.Dataset } as EntityAndType,
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -141,7 +141,7 @@ describe('adjustVXTreeLayout', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity, type: EntityType.Dataset } as EntityAndType,
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -149,7 +149,7 @@ describe('adjustVXTreeLayout', () => {
|
||||
|
||||
const upstreamData = hierarchy(
|
||||
constructTree(
|
||||
{ entity: dataset7WithSelfReferentialLineage, type: EntityType.Dataset },
|
||||
{ entity: dataset7WithSelfReferentialLineage as Entity, type: EntityType.Dataset } as EntityAndType,
|
||||
mockFetchedEntities,
|
||||
Direction.Upstream,
|
||||
testEntityRegistry,
|
||||
@ -186,7 +186,7 @@ describe('adjustVXTreeLayout', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Dataset, type: EntityType.Dataset },
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -231,7 +231,7 @@ describe('adjustVXTreeLayout', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Dataset, type: EntityType.Dataset },
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { dataset1, dataset2, dataJob1, dataset1FetchedEntity, dataset2FetchedEntity } from '../../../Mocks';
|
||||
import { EntityType } from '../../../types.generated';
|
||||
import { Entity, EntityType } from '../../../types.generated';
|
||||
import { Direction, EntityAndType, FetchedEntity } from '../types';
|
||||
import { shouldIncludeChildEntity } from '../utils/constructFetchedNode';
|
||||
|
||||
@ -55,7 +55,7 @@ describe('shouldIncludeChildEntity', () => {
|
||||
it('should return true if the parent has a datajob child that is not a child of the dataset child', () => {
|
||||
const updatedDataset1FetchedEntity = {
|
||||
...dataset1FetchedEntity,
|
||||
downstreamChildren: [{ type: EntityType.Dataset, entity: dataset2 }],
|
||||
downstreamChildren: [{ type: EntityType.Dataset, entity: dataset2 as Entity }],
|
||||
} as FetchedEntity;
|
||||
|
||||
const shouldBeIncluded = shouldIncludeChildEntity(
|
||||
|
||||
@ -10,9 +10,9 @@ import {
|
||||
dataFlow1,
|
||||
dataset1,
|
||||
} from '../../../Mocks';
|
||||
import { DataPlatform, EntityType, RelationshipDirection } from '../../../types.generated';
|
||||
import { DataPlatform, Dataset, Entity, EntityType, RelationshipDirection } from '../../../types.generated';
|
||||
import { getTestEntityRegistry } from '../../../utils/test-utils/TestPageContainer';
|
||||
import { Direction, FetchedEntities, UpdatedLineages } from '../types';
|
||||
import { Direction, EntityAndType, FetchedEntities, UpdatedLineages } from '../types';
|
||||
import constructTree from '../utils/constructTree';
|
||||
import extendAsyncEntities from '../utils/extendAsyncEntities';
|
||||
|
||||
@ -58,7 +58,7 @@ describe('constructTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Dataset, type: EntityType.Dataset },
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -66,7 +66,7 @@ describe('constructTree', () => {
|
||||
|
||||
expect(
|
||||
constructTree(
|
||||
{ entity: dataset6WithLineage, type: EntityType.Dataset },
|
||||
{ entity: dataset6WithLineage as Dataset, type: EntityType.Dataset },
|
||||
mockFetchedEntities,
|
||||
Direction.Downstream,
|
||||
testEntityRegistry,
|
||||
@ -110,7 +110,7 @@ describe('constructTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Dataset, type: EntityType.Dataset },
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -118,7 +118,7 @@ describe('constructTree', () => {
|
||||
|
||||
expect(
|
||||
constructTree(
|
||||
{ entity: dataset6WithLineage, type: EntityType.Dataset },
|
||||
{ entity: dataset6WithLineage as Dataset, type: EntityType.Dataset },
|
||||
mockFetchedEntities,
|
||||
Direction.Upstream,
|
||||
testEntityRegistry,
|
||||
@ -163,7 +163,7 @@ describe('constructTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Dataset, type: EntityType.Dataset },
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -258,7 +258,7 @@ describe('constructTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Dataset, type: EntityType.Dataset },
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -289,7 +289,7 @@ describe('constructTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Entity, type: EntityType.Dataset } as EntityAndType,
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -376,14 +376,14 @@ describe('constructTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: entry.entity.type },
|
||||
{ entity: entry.entity as Dataset, type: entry.entity.type as EntityType } as EntityAndType,
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
);
|
||||
expect(
|
||||
constructTree(
|
||||
{ entity: updatedDataset6WithLineage, type: EntityType.Dataset },
|
||||
{ entity: updatedDataset6WithLineage as Dataset, type: EntityType.Dataset },
|
||||
mockFetchedEntities,
|
||||
Direction.Upstream,
|
||||
testEntityRegistry,
|
||||
@ -431,7 +431,7 @@ describe('constructTree', () => {
|
||||
{},
|
||||
acc,
|
||||
testEntityRegistry,
|
||||
{ entity: entry.entity, type: EntityType.Dataset },
|
||||
{ entity: entry.entity as Dataset, type: EntityType.Dataset },
|
||||
entry.fullyFetched,
|
||||
),
|
||||
{} as FetchedEntities,
|
||||
@ -447,7 +447,7 @@ describe('constructTree', () => {
|
||||
|
||||
expect(
|
||||
constructTree(
|
||||
{ entity: dataset6WithLineage, type: EntityType.Dataset },
|
||||
{ entity: dataset6WithLineage as Dataset, type: EntityType.Dataset },
|
||||
mockFetchedEntities,
|
||||
Direction.Upstream,
|
||||
testEntityRegistry,
|
||||
|
||||
@ -57,7 +57,7 @@ export type FetchedEntity = {
|
||||
schemaMetadata?: SchemaMetadata;
|
||||
inputFields?: InputFields;
|
||||
canEditLineage?: boolean;
|
||||
health?: Health[];
|
||||
health?: Maybe<Health[]>;
|
||||
};
|
||||
|
||||
export type NodeData = {
|
||||
@ -81,7 +81,7 @@ export type NodeData = {
|
||||
canEditLineage?: boolean;
|
||||
upstreamRelationships?: Array<LineageRelationship>;
|
||||
downstreamRelationships?: Array<LineageRelationship>;
|
||||
health?: Health[];
|
||||
health?: Maybe<Health[]>;
|
||||
};
|
||||
|
||||
export type VizNode = {
|
||||
|
||||
@ -4,7 +4,7 @@ import { MockedProvider } from '@apollo/client/testing';
|
||||
|
||||
import TagTermGroup from '../TagTermGroup';
|
||||
import TestPageContainer from '../../../../utils/test-utils/TestPageContainer';
|
||||
import { EntityType, GlossaryTerms } from '../../../../types.generated';
|
||||
import { EntityType, GlobalTags, GlossaryTerms } from '../../../../types.generated';
|
||||
import { mocks } from '../../../../Mocks';
|
||||
|
||||
const legacyTag = {
|
||||
@ -50,7 +50,7 @@ describe('TagTermGroup', () => {
|
||||
const { getByText, getByLabelText, queryAllByLabelText, queryByText } = render(
|
||||
<MockedProvider mocks={mocks} addTypename={false}>
|
||||
<TestPageContainer>
|
||||
<TagTermGroup editableTags={globalTags1} canRemove />
|
||||
<TagTermGroup editableTags={globalTags1 as GlobalTags} canRemove />
|
||||
</TestPageContainer>
|
||||
</MockedProvider>,
|
||||
);
|
||||
@ -72,7 +72,7 @@ describe('TagTermGroup', () => {
|
||||
const { getByText, queryByLabelText, queryByText } = render(
|
||||
<MockedProvider mocks={mocks} addTypename={false}>
|
||||
<TestPageContainer>
|
||||
<TagTermGroup uneditableTags={globalTags2} />
|
||||
<TagTermGroup uneditableTags={globalTags2 as GlobalTags} />
|
||||
</TestPageContainer>
|
||||
</MockedProvider>,
|
||||
);
|
||||
@ -85,7 +85,11 @@ describe('TagTermGroup', () => {
|
||||
const { getByText, queryByText, queryAllByLabelText } = render(
|
||||
<MockedProvider mocks={mocks} addTypename={false}>
|
||||
<TestPageContainer>
|
||||
<TagTermGroup uneditableTags={globalTags1} editableTags={globalTags2} canRemove />
|
||||
<TagTermGroup
|
||||
uneditableTags={globalTags1 as GlobalTags}
|
||||
editableTags={globalTags2 as GlobalTags}
|
||||
canRemove
|
||||
/>
|
||||
</TestPageContainer>
|
||||
</MockedProvider>,
|
||||
);
|
||||
@ -102,8 +106,8 @@ describe('TagTermGroup', () => {
|
||||
<TagTermGroup
|
||||
entityUrn="urn:li:chart:123"
|
||||
entityType={EntityType.Chart}
|
||||
uneditableTags={globalTags1}
|
||||
editableTags={globalTags2}
|
||||
uneditableTags={globalTags1 as GlobalTags}
|
||||
editableTags={globalTags2 as GlobalTags}
|
||||
canRemove
|
||||
canAddTag
|
||||
/>
|
||||
@ -124,8 +128,8 @@ describe('TagTermGroup', () => {
|
||||
<TagTermGroup
|
||||
entityUrn="urn:li:chart:123"
|
||||
entityType={EntityType.Chart}
|
||||
uneditableTags={globalTags1}
|
||||
editableTags={globalTags2}
|
||||
uneditableTags={globalTags1 as GlobalTags}
|
||||
editableTags={globalTags2 as GlobalTags}
|
||||
canRemove
|
||||
canAddTerm
|
||||
/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user