Skip to content

Commit

Permalink
cli: fix plugin template by using renderInTestApp in component test
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
  • Loading branch information
Rugvip committed Mar 4, 2021
1 parent f6171e4 commit 946615d
Showing 1 changed file with 3 additions and 4 deletions.
@@ -1,11 +1,10 @@
import React from 'react';
import { render } from '@testing-library/react';
import { ExampleComponent } from './ExampleComponent';
import { ThemeProvider } from '@material-ui/core';
import { lightTheme } from '@backstage/theme';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { msw } from '@backstage/test-utils';
import { msw, renderInTestApp } from '@backstage/test-utils';

describe('ExampleComponent', () => {
const server = setupServer();
Expand All @@ -19,8 +18,8 @@ describe('ExampleComponent', () => {
);
});

it('should render', () => {
const rendered = render(
it('should render', async () => {
const rendered = await renderInTestApp(
<ThemeProvider theme={lightTheme}>
<ExampleComponent />
</ThemeProvider>,
Expand Down

0 comments on commit 946615d

Please sign in to comment.