fix tests

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-06-02 14:04:41 +02:00
parent d68692aee9
commit 8afb3dcf0a
12 changed files with 45 additions and 56 deletions
@@ -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',