From 553da2d82c0b08bd072635774711aa492f880db3 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 20 Jun 2021 15:05:44 +0200 Subject: [PATCH] graphiql: mock config api in tests Signed-off-by: Patrik Oldsberg --- .../GraphiQLPage/GraphiQLPage.test.tsx | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx index a4d3062f5b..71c7d83851 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.test.tsx @@ -21,7 +21,12 @@ import { lightTheme } from '@backstage/theme'; import { act } from 'react-dom/test-utils'; import { renderWithEffects } from '@backstage/test-utils'; import { GraphQLBrowseApi, graphQlBrowseApiRef } from '../../lib/api'; -import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; +import { configApiRef } from '@backstage/core-plugin-api'; +import { + ApiProvider, + ApiRegistry, + ConfigReader, +} from '@backstage/core-app-api'; jest.mock('../GraphiQLBrowser', () => ({ GraphiQLBrowser: () => '', @@ -38,7 +43,12 @@ describe('GraphiQLPage', () => { }; const rendered = await renderWithEffects( - + @@ -61,7 +71,12 @@ describe('GraphiQLPage', () => { }; const rendered = await renderWithEffects( - + @@ -80,7 +95,12 @@ describe('GraphiQLPage', () => { }; const rendered = await renderWithEffects( - +