Fix new test-library eslint errors

This commit is contained in:
Deluan
2022-09-28 21:30:20 -04:00
parent 86ab35069d
commit 6b09dc7198
7 changed files with 100 additions and 92 deletions
+7 -7
View File
@@ -1,5 +1,5 @@
import * as React from 'react'
import { cleanup, render } from '@testing-library/react'
import { cleanup, render, screen } from '@testing-library/react'
import { createMemoryHistory } from 'history'
import { Router } from 'react-router-dom'
import StarIcon from '@material-ui/icons/Star'
@@ -14,12 +14,12 @@ describe('<DynamicMenuIcon />', () => {
const route = '/test'
history.push(route)
const { getByTestId } = render(
render(
<Router history={history}>
<DynamicMenuIcon icon={StarIcon} path={'test'} />
</Router>
)
expect(getByTestId('icon')).not.toBeNull()
expect(screen.getByTestId('icon')).not.toBeNull()
})
it('renders icon if path does not match the URL', () => {
@@ -27,7 +27,7 @@ describe('<DynamicMenuIcon />', () => {
const route = '/path'
history.push(route)
const { getByTestId } = render(
render(
<Router history={history}>
<DynamicMenuIcon
icon={StarIcon}
@@ -36,7 +36,7 @@ describe('<DynamicMenuIcon />', () => {
/>
</Router>
)
expect(getByTestId('icon')).not.toBeNull()
expect(screen.getByTestId('icon')).not.toBeNull()
})
it('renders activeIcon if path matches the URL', () => {
@@ -44,7 +44,7 @@ describe('<DynamicMenuIcon />', () => {
const route = '/path'
history.push(route)
const { getByTestId } = render(
render(
<Router history={history}>
<DynamicMenuIcon
icon={StarIcon}
@@ -53,6 +53,6 @@ describe('<DynamicMenuIcon />', () => {
/>
</Router>
)
expect(getByTestId('activeIcon')).not.toBeNull()
expect(screen.getByTestId('activeIcon')).not.toBeNull()
})
})