refactor tests to use renderInTestApp

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-12-31 19:14:29 +01:00
parent db2e137744
commit 0f50c7c754
18 changed files with 234 additions and 401 deletions
@@ -15,18 +15,14 @@
*/
import React from 'react';
import { render } from '@testing-library/react';
import { renderInTestApp } from '@backstage/test-utils';
import { CodeClimateTable } from './CodeClimateTable';
import { mockData } from '../../api/mock/mock-api';
import { ThemeProvider } from '@material-ui/core';
import { lightTheme } from '@backstage/theme';
describe('CodeClimateTable', () => {
it('should render values in a table', async () => {
const table = await render(
<ThemeProvider theme={lightTheme}>
<CodeClimateTable codeClimateData={mockData} />
</ThemeProvider>,
const table = await renderInTestApp(
<CodeClimateTable codeClimateData={mockData} />,
);
expect(await table.findByText('3 months')).toBeInTheDocument();
expect(await table.findByText('88%')).toBeInTheDocument();