mirror of
https://github.com/kremalicious/blog.git
synced 2024-06-28 00:27:58 +02:00
* Bump eslint-plugin-testing-library from 3.10.2 to 4.6.0 Bumps [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library) from 3.10.2 to 4.6.0. - [Release notes](https://github.com/testing-library/eslint-plugin-testing-library/releases) - [Changelog](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/.releaserc.json) - [Commits](https://github.com/testing-library/eslint-plugin-testing-library/compare/v3.10.2...v4.6.0) Signed-off-by: dependabot[bot] <support@github.com> * testing library fixes Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthias Kretschmann <m@kretschmann.io>
17 lines
482 B
TypeScript
17 lines
482 B
TypeScript
import React from 'react'
|
|
import { render, fireEvent, screen } from '@testing-library/react'
|
|
import RelatedPosts from './RelatedPosts'
|
|
|
|
describe('RelatedPosts', () => {
|
|
it('renders correctly', () => {
|
|
const { container, rerender } = render(
|
|
<RelatedPosts tags={['hello', 'design']} />
|
|
)
|
|
expect(container.firstChild).toBeInTheDocument()
|
|
|
|
fireEvent.click(screen.getByText('Refresh'))
|
|
|
|
rerender(<RelatedPosts tags={['hello', 'design']} isPhotos />)
|
|
})
|
|
})
|