packages,plugins: migrate to using TestApiProvider and Registry
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import { fireEvent } from '@testing-library/react';
|
||||
import {
|
||||
setupRequestMockHandlers,
|
||||
renderInTestApp,
|
||||
TestApiRegistry,
|
||||
} from '@backstage/test-utils';
|
||||
import {
|
||||
GithubDeployment,
|
||||
@@ -42,11 +43,7 @@ import { Entity } from '@backstage/catalog-model';
|
||||
import { GithubDeploymentsTable } from './GithubDeploymentsTable';
|
||||
import { Box } from '@material-ui/core';
|
||||
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
ConfigReader,
|
||||
} from '@backstage/core-app-api';
|
||||
import { ApiProvider, ConfigReader } from '@backstage/core-app-api';
|
||||
import {
|
||||
errorApiRef,
|
||||
configApiRef,
|
||||
@@ -95,14 +92,14 @@ const githubAuthApi: OAuthApi = {
|
||||
getAccessToken: async _ => 'access_token',
|
||||
};
|
||||
|
||||
const apis = ApiRegistry.from([
|
||||
const apis = TestApiRegistry.from(
|
||||
[configApiRef, configApi],
|
||||
[errorApiRef, errorApiMock],
|
||||
[
|
||||
githubDeploymentsApiRef,
|
||||
new GithubDeploymentsApiClient({ scmIntegrationsApi, githubAuthApi }),
|
||||
],
|
||||
]);
|
||||
);
|
||||
|
||||
const assertFetchedData = async () => {
|
||||
const rendered = await renderInTestApp(
|
||||
|
||||
Reference in New Issue
Block a user