fix: tests
This commit is contained in:
@@ -17,15 +17,26 @@
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import CatalogPage from './CatalogPage';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import { ApiRegistry, ApiProvider, errorApiRef } from '@backstage/core';
|
||||
import { wrapInTheme } from '@backstage/test-utils';
|
||||
import { catalogApiRef } from '../..';
|
||||
|
||||
const errorApi = { post: () => {} };
|
||||
const catalogApi = { getEntities: () => Promise.resolve([{ kind: '' }]) };
|
||||
|
||||
describe('CatalogPage', () => {
|
||||
it('should render', async () => {
|
||||
const rendered = render(
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<CatalogPage />
|
||||
</ThemeProvider>,
|
||||
wrapInTheme(
|
||||
<ApiProvider
|
||||
apis={ApiRegistry.from([
|
||||
[errorApiRef, errorApi],
|
||||
[catalogApiRef, catalogApi],
|
||||
])}
|
||||
>
|
||||
<CatalogPage />
|
||||
</ApiProvider>,
|
||||
),
|
||||
);
|
||||
expect(
|
||||
await rendered.findByText('Keep track of your software'),
|
||||
|
||||
@@ -17,7 +17,6 @@ import ComponentPage from './ComponentPage';
|
||||
import { render } from '@testing-library/react';
|
||||
import * as React from 'react';
|
||||
import { wrapInTheme } from '@backstage/test-utils';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { ApiProvider, ApiRegistry, errorApiRef } from '@backstage/core';
|
||||
|
||||
const getTestProps = (componentName: string) => {
|
||||
|
||||
Reference in New Issue
Block a user