@@ -32,12 +32,7 @@ describe('<ConsumedApisCard />', () => {
|
||||
getApiDefinitionWidget: jest.fn(),
|
||||
} as any;
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
getLocationById: jest.fn(),
|
||||
getEntityByName: jest.fn(),
|
||||
getEntities: jest.fn(),
|
||||
addLocation: jest.fn(),
|
||||
getLocationByRef: jest.fn(),
|
||||
removeEntityByUid: jest.fn(),
|
||||
getEntitiesByRefs: jest.fn(),
|
||||
} as any;
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
@@ -99,7 +94,7 @@ describe('<ConsumedApisCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
catalogApi.getEntities.mockResolvedValue({
|
||||
catalogApi.getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -32,12 +32,7 @@ describe('<HasApisCard />', () => {
|
||||
getApiDefinitionWidget: jest.fn(),
|
||||
} as any;
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
getLocationById: jest.fn(),
|
||||
getEntityByName: jest.fn(),
|
||||
getEntities: jest.fn(),
|
||||
addLocation: jest.fn(),
|
||||
getLocationByRef: jest.fn(),
|
||||
removeEntityByUid: jest.fn(),
|
||||
getEntitiesByRefs: jest.fn(),
|
||||
} as any;
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
@@ -99,7 +94,7 @@ describe('<HasApisCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
catalogApi.getEntities.mockResolvedValue({
|
||||
catalogApi.getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -32,12 +32,7 @@ describe('<ProvidedApisCard />', () => {
|
||||
getApiDefinitionWidget: jest.fn(),
|
||||
} as any;
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
getLocationById: jest.fn(),
|
||||
getEntityByName: jest.fn(),
|
||||
getEntities: jest.fn(),
|
||||
addLocation: jest.fn(),
|
||||
getLocationByRef: jest.fn(),
|
||||
removeEntityByUid: jest.fn(),
|
||||
getEntitiesByRefs: jest.fn(),
|
||||
} as any;
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
@@ -99,7 +94,7 @@ describe('<ProvidedApisCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
catalogApi.getEntities.mockResolvedValue({
|
||||
catalogApi.getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -28,12 +28,7 @@ import { ConsumingComponentsCard } from './ConsumingComponentsCard';
|
||||
|
||||
describe('<ConsumingComponentsCard />', () => {
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
getLocationById: jest.fn(),
|
||||
getEntityByName: jest.fn(),
|
||||
getEntities: jest.fn(),
|
||||
addLocation: jest.fn(),
|
||||
getLocationByRef: jest.fn(),
|
||||
removeEntityByUid: jest.fn(),
|
||||
getEntitiesByRefs: jest.fn(),
|
||||
} as any;
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
@@ -102,7 +97,7 @@ describe('<ConsumingComponentsCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
catalogApi.getEntities.mockResolvedValue({
|
||||
catalogApi.getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -28,12 +28,7 @@ import { ProvidingComponentsCard } from './ProvidingComponentsCard';
|
||||
|
||||
describe('<ProvidingComponentsCard />', () => {
|
||||
const catalogApi: jest.Mocked<CatalogApi> = {
|
||||
getLocationById: jest.fn(),
|
||||
getEntityByName: jest.fn(),
|
||||
getEntities: jest.fn(),
|
||||
addLocation: jest.fn(),
|
||||
getLocationByRef: jest.fn(),
|
||||
removeEntityByUid: jest.fn(),
|
||||
getEntitiesByRefs: jest.fn(),
|
||||
} as any;
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
@@ -102,7 +97,7 @@ describe('<ProvidingComponentsCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
catalogApi.getEntities.mockResolvedValue({
|
||||
catalogApi.getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
+5
-3
@@ -27,12 +27,14 @@ import React from 'react';
|
||||
import { DependencyOfComponentsCard } from './DependencyOfComponentsCard';
|
||||
|
||||
describe('<DependencyOfComponentsCard />', () => {
|
||||
const getEntities: jest.MockedFunction<CatalogApi['getEntities']> = jest.fn();
|
||||
const getEntitiesByRefs: jest.MockedFunction<
|
||||
CatalogApi['getEntitiesByRefs']
|
||||
> = jest.fn();
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
beforeEach(() => {
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntities }]]}>
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntitiesByRefs }]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
@@ -85,7 +87,7 @@ describe('<DependencyOfComponentsCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
getEntities.mockResolvedValue({
|
||||
getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
+5
-3
@@ -27,12 +27,14 @@ import React from 'react';
|
||||
import { DependsOnComponentsCard } from './DependsOnComponentsCard';
|
||||
|
||||
describe('<DependsOnComponentsCard />', () => {
|
||||
const getEntities: jest.MockedFunction<CatalogApi['getEntities']> = jest.fn();
|
||||
const getEntitiesByRefs: jest.MockedFunction<
|
||||
CatalogApi['getEntitiesByRefs']
|
||||
> = jest.fn();
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
beforeEach(() => {
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntities }]]}>
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntitiesByRefs }]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
@@ -85,7 +87,7 @@ describe('<DependsOnComponentsCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
getEntities.mockResolvedValue({
|
||||
getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
+5
-3
@@ -27,12 +27,14 @@ import React from 'react';
|
||||
import { DependsOnResourcesCard } from './DependsOnResourcesCard';
|
||||
|
||||
describe('<DependsOnResourcesCard />', () => {
|
||||
const getEntities: jest.MockedFunction<CatalogApi['getEntities']> = jest.fn();
|
||||
const getEntitiesByRefs: jest.MockedFunction<
|
||||
CatalogApi['getEntitiesByRefs']
|
||||
> = jest.fn();
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
beforeEach(() => {
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntities }]]}>
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntitiesByRefs }]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
@@ -85,7 +87,7 @@ describe('<DependsOnResourcesCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
getEntities.mockResolvedValue({
|
||||
getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -27,12 +27,14 @@ import React from 'react';
|
||||
import { HasComponentsCard } from './HasComponentsCard';
|
||||
|
||||
describe('<HasComponentsCard />', () => {
|
||||
const getEntities: jest.MockedFunction<CatalogApi['getEntities']> = jest.fn();
|
||||
const getEntitiesByRefs: jest.MockedFunction<
|
||||
CatalogApi['getEntitiesByRefs']
|
||||
> = jest.fn();
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
beforeEach(() => {
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntities }]]}>
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntitiesByRefs }]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
@@ -85,7 +87,7 @@ describe('<HasComponentsCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
getEntities.mockResolvedValue({
|
||||
getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -27,12 +27,14 @@ import React from 'react';
|
||||
import { HasResourcesCard } from './HasResourcesCard';
|
||||
|
||||
describe('<HasResourcesCard />', () => {
|
||||
const getEntities: jest.MockedFunction<CatalogApi['getEntities']> = jest.fn();
|
||||
const getEntitiesByRefs: jest.MockedFunction<
|
||||
CatalogApi['getEntitiesByRefs']
|
||||
> = jest.fn();
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
beforeEach(() => {
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntities }]]}>
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntitiesByRefs }]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
@@ -80,7 +82,7 @@ describe('<HasResourcesCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
getEntities.mockResolvedValue({
|
||||
getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -27,12 +27,14 @@ import React from 'react';
|
||||
import { HasSubcomponentsCard } from './HasSubcomponentsCard';
|
||||
|
||||
describe('<HasSubcomponentsCard />', () => {
|
||||
const getEntities: jest.MockedFunction<CatalogApi['getEntities']> = jest.fn();
|
||||
const getEntitiesByRefs: jest.MockedFunction<
|
||||
CatalogApi['getEntitiesByRefs']
|
||||
> = jest.fn();
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
beforeEach(() => {
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntities }]]}>
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntitiesByRefs }]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
@@ -85,7 +87,7 @@ describe('<HasSubcomponentsCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
getEntities.mockResolvedValue({
|
||||
getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
@@ -27,12 +27,14 @@ import React from 'react';
|
||||
import { HasSystemsCard } from './HasSystemsCard';
|
||||
|
||||
describe('<HasSystemsCard />', () => {
|
||||
const getEntities: jest.MockedFunction<CatalogApi['getEntities']> = jest.fn();
|
||||
const getEntitiesByRefs: jest.MockedFunction<
|
||||
CatalogApi['getEntitiesByRefs']
|
||||
> = jest.fn();
|
||||
let Wrapper: React.ComponentType<React.PropsWithChildren<{}>>;
|
||||
|
||||
beforeEach(() => {
|
||||
Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntities }]]}>
|
||||
<TestApiProvider apis={[[catalogApiRef, { getEntitiesByRefs }]]}>
|
||||
{children}
|
||||
</TestApiProvider>
|
||||
);
|
||||
@@ -85,7 +87,7 @@ describe('<HasSystemsCard />', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
getEntities.mockResolvedValue({
|
||||
getEntitiesByRefs.mockResolvedValue({
|
||||
items: [
|
||||
{
|
||||
apiVersion: 'v1',
|
||||
|
||||
Reference in New Issue
Block a user