From 439805d1d379969c53b44fb4c73409049b2b99ad Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Thu, 25 Feb 2021 23:41:13 -0500 Subject: [PATCH] Add config call to test Signed-off-by: Adam Harvey --- .../ApiExplorerPage/ApiExplorerPage.test.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx index 67462b630c..223734504b 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx @@ -15,7 +15,14 @@ */ import { Entity } from '@backstage/catalog-model'; -import { ApiProvider, ApiRegistry, storageApiRef } from '@backstage/core'; +import { + ApiProvider, + ApiRegistry, + storageApiRef, + ConfigApi, + configApiRef, + ConfigReader, +} from '@backstage/core'; import { CatalogApi, catalogApiRef } from '@backstage/plugin-catalog-react'; import { MockStorageApi, wrapInTestApp } from '@backstage/test-utils'; import { render } from '@testing-library/react'; @@ -50,6 +57,12 @@ describe('ApiCatalogPage', () => { Promise.resolve({ id: 'id', type: 'github', target: 'url' }), }; + const configApi: ConfigApi = new ConfigReader({ + organization: { + name: 'My Company', + }, + }); + const apiDocsConfig = { getApiDefinitionWidget: () => undefined, }; @@ -60,6 +73,7 @@ describe('ApiCatalogPage', () => { { // https://github.com/mbrn/material-table/issues/1293 it('should render', async () => { const { findByText } = renderWrapped(); - expect(await findByText(/Backstage API Explorer/)).toBeInTheDocument(); + expect(await findByText(/My Company API Explorer/)).toBeInTheDocument(); }); });