-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
233 additions
and
26 deletions.
There are no files selected for viewing
Empty file.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import 'jest-styled-components' | ||
import MovieCard from './MovieCard' | ||
|
||
describe('MoviesCards component basic render test', () => { | ||
const currentItem = { | ||
id: 'cool99', | ||
imageURL: 'https://google.com/images.jpg', | ||
title: 'Matrix', | ||
summary: 'lorem ipsum', | ||
rating: 6.7 | ||
} | ||
test('Render example movie item', () => { | ||
const component = renderer.create(<MovieCard item={currentItem} />) | ||
const tree = component.toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import 'jest-styled-components' | ||
import MoviesCards from './MoviesCards' | ||
|
||
describe('MoviesCards component basic render test', () => { | ||
const movies = [ | ||
{ | ||
id: 'cool99', | ||
imageURL: 'https://google.com/images.jpg', | ||
title: 'Matrix', | ||
summary: 'lorem ipsum', | ||
rating: 6.7 | ||
}, | ||
{ | ||
id: 'daddy78', | ||
imageURL: 'https://google.com/imagesDaddy.jpg', | ||
title: 'Avatar', | ||
summary: 'cool movie', | ||
rating: 9.9 | ||
} | ||
] | ||
test('Render example movie item', () => { | ||
const component = renderer.create(<MoviesCards movies={movies} />) | ||
const tree = component.toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`MoviesCards component basic render test Render example movie item 1`] = ` | ||
.c0 { | ||
position: relative; | ||
margin: auto; | ||
border-radius: 10px; | ||
overflow: hidden; | ||
background-image: url(https://google.com/images.jpg); | ||
background-size: 100%; | ||
background-repeat: no-repeat; | ||
min-height: 580px; | ||
box-shadow: 10px 7px 65px -13px rgba(0,0,0,0.75); | ||
} | ||
.c1 { | ||
padding: 20px; | ||
position: absolute; | ||
bottom: 20px; | ||
} | ||
.c7 { | ||
box-sizing: border-box; | ||
padding: 40px; | ||
max-width: 400px; | ||
width: 100%; | ||
margin: auto; | ||
margin-top: 590px; | ||
display: none; | ||
} | ||
.c2 { | ||
text-align: left; | ||
color: white; | ||
} | ||
.c5 { | ||
text-align: left; | ||
color: white; | ||
} | ||
.c4 { | ||
text-align: left; | ||
color: white; | ||
} | ||
.c3 { | ||
background-color: rgba(0,0,0,0.3); | ||
} | ||
.c6 { | ||
width: 30px; | ||
height: 30px; | ||
position: absolute; | ||
right: 5px; | ||
bottom: 5px; | ||
border-radius: 90px; | ||
cursor: pointer; | ||
border: none; | ||
font-size: 14px; | ||
outline: 0; | ||
box-shadow: 0 0 0 0 rgba(0,0,0,1); | ||
-webkit-transform: scale(1); | ||
-ms-transform: scale(1); | ||
transform: scale(1); | ||
-webkit-animation: pulse 2s infinite; | ||
animation: pulse 2s infinite; | ||
} | ||
@media (max-width:400px) { | ||
.c0 { | ||
min-height: calc(100vw * 1.45); | ||
} | ||
} | ||
@media (max-width:400px) { | ||
.c7 { | ||
margin-top: calc(100vw * 1.45); | ||
} | ||
} | ||
<div | ||
className="c0" | ||
> | ||
<div | ||
className="c1" | ||
> | ||
<h1 | ||
className="c2" | ||
> | ||
<span | ||
className="c3" | ||
> | ||
Matrix | ||
</span> | ||
</h1> | ||
<p | ||
className="c4" | ||
> | ||
<span | ||
className="c3" | ||
> | ||
6.7 | ||
/10 | ||
</span> | ||
</p> | ||
<p | ||
className="c5" | ||
> | ||
<span | ||
className="c3" | ||
> | ||
lorem ipsum | ||
</span> | ||
</p> | ||
</div> | ||
<button | ||
className="c6" | ||
onClick={[Function]} | ||
> | ||
i | ||
</button> | ||
<div | ||
className="c7" | ||
> | ||
<h1 | ||
className="c2" | ||
> | ||
Matrix | ||
</h1> | ||
<p | ||
className="c4" | ||
> | ||
6.7 | ||
/10 | ||
</p> | ||
<p | ||
className="c5" | ||
> | ||
lorem ipsum | ||
</p> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`MoviesCards component basic render test Render example movie item 1`] = ` | ||
<div> | ||
rendering | ||
</div> | ||
`; |