Skip to content

V3 10 #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: v3-10
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@
],
"plugins": [
"babel-plugin-transform-class-properties"
]
],
"env": {
"test": {
"plugins": [
"transform-es2015-modules-commonjs"
]
}
}
}
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"env": {
"es6": true,
"browser": true,
"node": true
"node": true,
"jest": true
}
}
4 changes: 2 additions & 2 deletions js/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import preload from '../data.json';

class Search extends Component {
state = {
searchTerm: 'game'
searchTerm: ''
};
handleSearchTermChange = event => {
this.setState({ searchTerm: event.target.value });
Expand All @@ -13,7 +13,7 @@ class Search extends Component {
return (
<div className="search">
<header>
<h1>svideo</h1>
<h1>z-video</h1>
<input
onChange={this.handleSearchTermChange}
value={this.state.searchTerm}
Expand Down
2 changes: 1 addition & 1 deletion js/ShowCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ShowCard.propTypes = {
poster: string.isRequired,
title: string.isRequired,
year: string.isRequired,
description: string.isRequired
description: string.isRequired,
};

export default ShowCard;
10 changes: 10 additions & 0 deletions js/__test__/Search.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { shallow } from 'enzyme';
import Search from '../Search';

// console.log(process.env.NODE_ENV);

test('Search renders correctly', () => {
const component = shallow(<Search />);
expect(component).toMatchSnapshot();
});
141 changes: 141 additions & 0 deletions js/__test__/__snapshots__/Search.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Search renders correctly 1`] = `
<div
className="search"
>
<header>
<h1>
z-video
</h1>
<input
onChange={[Function]}
placeholder="Search"
type="text"
value=""
/>
</header>
<div>
<ShowCard
description="Two cousins, with different views on art versus commerce, on their way up through the Atlanta rap scene; \\"Earnest 'Earn' Marks,\\" an ambitious college drop-out and his estranged cousin, who suddenly becomes a star."
imdbID="tt4288182"
poster="a.jpg"
title="Atlanta"
trailer="MpEdJ-mmTlY"
year="2008–2013"
/>
<ShowCard
description="U.S. Attorney Chuck Rhoades goes after hedge fund king, Bobby \\"Axe\\" Axelrod in a battle between two powerful New York figures."
imdbID="tt4270492"
poster="b.jpg"
title="Billions"
trailer="_raEUMLL-ZI"
year="2016–"
/>
<ShowCard
description="A television anthology series that shows the dark side of life and technology."
imdbID="tt2085059"
poster="bm.jpg"
title="Black Mirror"
trailer="jDiYGjp5iFg"
year="2011–"
/>
<ShowCard
description="A high school chemistry teacher diagnosed with inoperable lung cancer turns to manufacturing and selling methamphetamine in order to secure his family's future."
imdbID="tt0903747"
poster="bb.jpg"
title="Breaking Bad"
trailer="XZ8daibM3AE"
year="2008–2013"
/>
<ShowCard
description="Nine noble families fight for control over the mythical lands of Westeros, while a forgotten race returns after being dormant for thousands of years."
imdbID="tt0944947"
poster="got.jpg"
title="Game of Thrones"
trailer="giYeaKsXnsI"
year="2011–"
/>
<ShowCard
description="A bipolar CIA operative becomes convinced a prisoner of war has been turned by al-Qaeda and is planning to carry out a terrorist attack on American soil."
imdbID="tt1796960"
poster="h.jpg"
title="Homeland"
trailer="KyFmS3wRPCQ"
year="2011–"
/>
<ShowCard
description="A Congressman works with his equally conniving wife to exact revenge on the people who betrayed him."
imdbID="tt1856010"
poster="hoc.jpg"
title="House of Cards"
trailer="NTzycsqxYJ0"
year="2013–"
/>
<ShowCard
description="The personal and professional life of Dev, a 30-year-old actor in New York."
imdbID="tt4635276"
poster="mon.jpg"
title="Master of None"
trailer="6bFvb3WKISk"
year="2015–"
/>
<ShowCard
description="A chronicled look at the criminal exploits of Colombian drug lord Pablo Escobar."
imdbID="tt2707408"
poster="n.jpg"
title="Narcos"
trailer="U7elNhHwgBU"
year="2015–"
/>
<ShowCard
description="The story of Piper Chapman, a woman in her thirties who is sentenced to fifteen months in prison after being convicted of a decade-old crime of transporting money for her drug-dealing girlfriend."
imdbID="tt2372162"
poster="oitnb.jpg"
title="Orange Is the New Black"
trailer="th8WT_pxGqg"
year="2013–"
/>
<ShowCard
description="Follows the struggle of Richard Hendricks, a silicon valley engineer trying to build his own company called Pied Piper."
imdbID="tt2575988"
poster="sv.jpg"
title="Silicon Valley"
trailer="69V__a49xtw"
year="2014–"
/>
<ShowCard
description="When a young boy disappears, his mother, a police chief, and his friends must confront terrifying forces in order to get him back."
imdbID="tt4574334"
poster="st.jpg"
title="Stranger Things"
trailer="9Egf5U8xLo8"
year="2016–"
/>
<ShowCard
description="Two Soviet intelligence agents pose as a married couple to spy on the American government."
imdbID="tt2149175"
poster="ta.jpg"
title="The Americans"
trailer="HjuUkbhsI24"
year="2013–"
/>
<ShowCard
description="Former Senator Selina Meyer finds that being Vice President of the United States is nothing like she hoped and everything that everyone ever warned her about."
imdbID="tt1759761"
poster="v.jpg"
title="Veep"
trailer="I2HoCG_iyhU"
year="2012–"
/>
<ShowCard
description="Set at the intersection of the near future and the reimagined past, explore a world in which every human appetite, no matter how noble or depraved, can be indulged without consequence."
imdbID="tt0475784"
poster="ww.jpg"
title="Westworld"
trailer="eX3u0IlBBO4"
year="2016–"
/>
</div>
</div>
`;
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
"dev": "webpack-dev-server",
"format": "prettier --write --single-quote --print-width=120 --parser=flow --tab-width=2 \"js/**/*.{js,jsx}\"",
"lint": "eslint **/*.{js,jsx} --quiet",
"test": "jest",
"test:update": "jest -u",
"watch": "webpack --watch"
},
"jest": {
"snapshotSerializers": ["jest-serializer-enzyme"]
},
"dependencies": {
"axios": "0.16.1",
"babel-plugin-dynamic-import-webpack": "1.0.1",
Expand Down