Skip to content

Commit

Permalink
cleanup cleanup in new tests:
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed Sep 20, 2024
1 parent a5210a3 commit d3cad7d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/ui/TotalsNumber/TotalsNumber.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { cleanup, render, screen } from '@testing-library/react'
import { render, screen } from '@testing-library/react'

import TotalsNumber from './TotalsNumber'

afterEach(() => {
cleanup()
})

describe('TotalsNumber', () => {
describe('when rendered', () => {
it('renders commit change when there is a valid value', () => {
Expand Down
6 changes: 1 addition & 5 deletions src/ui/TruncatedMessage/TruncatedMessage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { cleanup, render, screen } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'

import { useTruncation } from './hooks'
import TruncatedMessage from './TruncatedMessage'

vi.mock('./hooks')

afterEach(() => {
cleanup()
})

describe('TruncatedMessage', () => {
function setup({ canTruncate = false }) {
// @ts-expect-error
Expand Down
6 changes: 1 addition & 5 deletions src/ui/TruncatedMessage/hooks/useTruncation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cleanup, renderHook } from '@testing-library/react'
import { renderHook } from '@testing-library/react'

import { useTruncation } from './useTruncation'

Expand Down Expand Up @@ -36,10 +36,6 @@ vi.mock('react', async () => {
}
})

afterEach(() => {
cleanup()
})

describe('useTruncation', () => {
function setup({
clientHeight = 0,
Expand Down

0 comments on commit d3cad7d

Please sign in to comment.