Skip to content
Open

1st #91

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/components/tests/Episode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const testEpisode = {
image: "http://static.tvmaze.com/uploads/images/medium_landscape/67/168918.jpg",
season: 1,
number: 1,
summary: "",
summary: "test",
runtime: 1
}

Expand All @@ -17,15 +17,20 @@ const testEpisodeWithoutImage = {
}

test("renders without error", () => {

render(<Episode Episode={testEpisode}/>)
});

test("renders the summury test passed as prop", ()=>{

render(<Episode Episode={testEpisode}/>)
const summary = screen.queryByText(/test/i);
expect (summary).toHaveTextContent('test')

});

test("renders default image when image is not defined", ()=>{

render(<Episode Episode={testEpisodeWithoutImage}/>)
const image= screen.queryByAltText('./stranger_things.png')
expect(image).toBeInTheDocument();
})

//Tasks
Expand Down