Movie_Search/movie-search/__tests__/MovieCard.test.jsx

16 lines
539 B
React
Raw Normal View History

2024-05-25 01:03:21 -04:00
import "@testing-library/jest-dom";
import {render, screen} from '@testing-library/react'
import MovieCard from '../src/common/components/MovieCard.tsx'
2024-05-25 01:03:21 -04:00
const movie = {
Title: "Dune",
Year: "2000",
imdbID: "tt0142032",
Type: "series",
Poster: "https://m.media-amazon.com/images/M/MV5BMTU4MjMyMTkxN15BMl5BanBnXkFtZTYwODA5OTU5._V1_SX300.jpg"
}
test('MovieCard Renders',()=>{
render(<MovieCard movie={movie} />)
const movieTitle = screen.getByRole('heading')
expect(movieTitle).toHaveTextContent('Dune')
})