From 45ed89b281f12cb677358e82c7edfdedeba3356f Mon Sep 17 00:00:00 2001 From: Raghunandan Date: Fri, 26 Jun 2020 14:30:07 +0200 Subject: [PATCH] Fix tests --- .../ProfileCatalog/ProfileCatalog.test.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx index 463e493afc..50268e6a50 100644 --- a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx +++ b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.test.tsx @@ -20,13 +20,28 @@ import mockFetch from 'jest-fetch-mock'; import ProfileCatalog from './ProfileCatalog'; import { ThemeProvider } from '@material-ui/core'; import { lightTheme } from '@backstage/theme'; -import { ApiProvider, ApiRegistry } from '@backstage/core'; +import { + ApiProvider, + ApiRegistry, + githubAuthApiRef, + GithubAuth, + OAuthRequestManager, +} from '@backstage/core'; import { gitOpsApiRef, GitOpsRestApi } from '../../api'; describe('ProfileCatalog', () => { it('should render', () => { + const oauthRequestApi = new OAuthRequestManager(); const apis = ApiRegistry.from([ [gitOpsApiRef, new GitOpsRestApi('http://localhost:3008')], + [ + githubAuthApiRef, + GithubAuth.create({ + apiOrigin: 'http://localhost:7000', + basePath: '/auth/', + oauthRequestApi, + }), + ], ]); mockFetch.mockResponse(() => new Promise(() => {})); const rendered = render(