From 5805251b73c45138f9caf63abc016408705293c7 Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Wed, 13 Jan 2021 15:50:00 +0100 Subject: [PATCH] Fix tests after changes from master. --- .../components/ImportComponentForm.test.tsx | 6 +++++- .../components/ImportComponentPage.test.tsx | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-import/src/components/ImportComponentForm.test.tsx b/plugins/catalog-import/src/components/ImportComponentForm.test.tsx index dcacfcc76f..91a5208bee 100644 --- a/plugins/catalog-import/src/components/ImportComponentForm.test.tsx +++ b/plugins/catalog-import/src/components/ImportComponentForm.test.tsx @@ -57,7 +57,11 @@ describe('', () => { ) { return await renderInTestApp( - + , ); } diff --git a/plugins/catalog-import/src/components/ImportComponentPage.test.tsx b/plugins/catalog-import/src/components/ImportComponentPage.test.tsx index 0e03a467e5..3f6f878b29 100644 --- a/plugins/catalog-import/src/components/ImportComponentPage.test.tsx +++ b/plugins/catalog-import/src/components/ImportComponentPage.test.tsx @@ -16,9 +16,15 @@ import React from 'react'; import { msw, renderInTestApp } from '@backstage/test-utils'; import { ImportComponentPage } from './ImportComponentPage'; -import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core'; +import { + ApiProvider, + ApiRegistry, + configApiRef, + errorApiRef, +} from '@backstage/core'; import { catalogApiRef, CatalogClient } from '@backstage/plugin-catalog'; import { catalogImportApiRef, CatalogImportClient } from '../api'; + import { fireEvent, screen, waitFor } from '@testing-library/react'; import { rest } from 'msw'; @@ -107,6 +113,17 @@ describe('', () => { configApi: {} as any, }), ], + [ + configApiRef, + { + getOptional: () => 'Title', + getOptionalConfigArray: () => [], + has: () => true, + getConfig: () => ({ + has: () => true, + }), + }, + ], [errorApiRef, mockErrorApi], ]); });