have code follow eslint rules

Signed-off-by: Mohamed Mohamed <mohamed.mohamed2@aa.com>
This commit is contained in:
Mohamed Mohamed
2022-11-10 11:37:41 -06:00
parent dfbe08a24b
commit d09df7ac27
2 changed files with 7 additions and 5 deletions
@@ -4,6 +4,7 @@ import { ThemeProvider } from '@material-ui/core';
import { lightTheme } from '@backstage/theme';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { screen } from '@testing-library/react';
import {
setupRequestMockHandlers,
renderInTestApp,
@@ -22,11 +23,11 @@ describe('ExampleComponent', () => {
});
it('should render', async () => {
const rendered = await renderInTestApp(
await renderInTestApp(
<ThemeProvider theme={lightTheme}>
<ExampleComponent />
</ThemeProvider>,
);
expect(rendered.getByText('Welcome to {{ id }}!')).toBeInTheDocument();
expect(screen.getByText('Welcome to {{ id }}!')).toBeInTheDocument();
});
});
@@ -1,10 +1,11 @@
import React from 'react';
import { render } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { ExampleFetchComponent } from './ExampleFetchComponent';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { setupRequestMockHandlers } from '@backstage/test-utils';
describe('ExampleFetchComponent', () => {
const server = setupServer();
// Enable sane handlers for network requests
@@ -19,7 +20,7 @@ describe('ExampleFetchComponent', () => {
);
});
it('should render', async () => {
const rendered = render(<ExampleFetchComponent />);
expect(await rendered.findByTestId('progress')).toBeInTheDocument();
await render(<ExampleFetchComponent />);
expect(await screen.findByTestId('progress')).toBeInTheDocument();
});
});