packages,plugins: migrate to using TestApiProvider and Registry

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-11-17 18:56:22 +01:00
parent 7ff56c2330
commit 29ef695410
118 changed files with 991 additions and 1112 deletions
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { renderInTestApp } from '@backstage/test-utils';
import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils';
import { lightTheme } from '@backstage/theme';
import { ThemeProvider } from '@material-ui/core';
import React from 'react';
@@ -23,7 +23,6 @@ import ProfileCatalog from './ProfileCatalog';
import {
ApiProvider,
ApiRegistry,
GithubAuth,
OAuthRequestManager,
UrlPatternDiscovery,
@@ -34,7 +33,7 @@ import { githubAuthApiRef } from '@backstage/core-plugin-api';
describe('ProfileCatalog', () => {
it('should render', async () => {
const oauthRequestApi = new OAuthRequestManager();
const apis = ApiRegistry.from([
const apis = TestApiRegistry.from(
[gitOpsApiRef, new GitOpsRestApi('http://localhost:3008')],
[
githubAuthApiRef,
@@ -45,7 +44,7 @@ describe('ProfileCatalog', () => {
oauthRequestApi,
}),
],
]);
);
const { getByText } = await renderInTestApp(
<ThemeProvider theme={lightTheme}>