Merge pull request #14618 from backstage/freben/catalog-client-tests

update tests to be more robust against catalog-client changes
This commit is contained in:
Fredrik Adelöw
2022-11-15 14:35:46 +01:00
committed by GitHub
13 changed files with 269 additions and 224 deletions
@@ -21,8 +21,8 @@ import React from 'react';
import { DefaultExplorePage } from './DefaultExplorePage';
describe('<DefaultExplorePage />', () => {
const catalogApi: jest.Mocked<typeof catalogApiRef.T> = {
addLocation: jest.fn(_a => new Promise(() => {})),
const catalogApi = {
addLocation: jest.fn(),
getEntities: jest.fn(),
getLocationByRef: jest.fn(),
getLocationById: jest.fn(),
@@ -22,8 +22,8 @@ import React from 'react';
import { DomainExplorerContent } from './DomainExplorerContent';
describe('<DomainExplorerContent />', () => {
const catalogApi: jest.Mocked<typeof catalogApiRef.T> = {
addLocation: jest.fn(_a => new Promise(() => {})),
const catalogApi = {
addLocation: jest.fn(),
getEntities: jest.fn(),
getLocationByRef: jest.fn(),
getLocationById: jest.fn(),
@@ -22,8 +22,8 @@ import React from 'react';
import { GroupsExplorerContent } from '../GroupsExplorerContent';
describe('<GroupsExplorerContent />', () => {
const catalogApi: jest.Mocked<typeof catalogApiRef.T> = {
addLocation: jest.fn(_a => new Promise(() => {})),
const catalogApi = {
addLocation: jest.fn(),
getEntities: jest.fn(),
getLocationByRef: jest.fn(),
getLocationById: jest.fn(),