diff --git a/client/actions/movie.js b/client/actions/movie.js index cdb5066..cd73cb8 100644 --- a/client/actions/movie.js +++ b/client/actions/movie.js @@ -7,7 +7,8 @@ export const receiveMovie = (movie) => { } } - +//make your movie api here, unless there's an issue with netflix roulette api, you could just make your api call at client side. +// probably separate your randomizer logic with your client api and make it a function call. export function getMovie (movie) { return (dispatch) => { diff --git a/client/components/AddSnackForm.js b/client/components/AddSnackForm.js index 938a50f..c1dae5f 100644 --- a/client/components/AddSnackForm.js +++ b/client/components/AddSnackForm.js @@ -22,7 +22,7 @@ class AddSnackForm extends React.Component { this.setState({snack}) } - render () { + render () { //alan said make your p tags in line return (

this.handleChange(e)} />

@@ -33,7 +33,7 @@ class AddSnackForm extends React.Component { )} } -const mapStateToProps = (state) => { +const mapStateToProps = (state) => { //alan : indentation wasn't properly return {snack: state.snack} } diff --git a/client/components/App.jsx b/client/components/App.jsx index 6abd668..5d1a419 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react' //alan : clean up the indentation and remove unecessary spacing import Movie from './Movie' import Snack from './Snack' @@ -7,7 +7,7 @@ import Snack from './Snack' import Header from './Header' import Footer from './Footer' -const App = () => ( +const App = () => ( // move each of your div className row and twelve columns into the component
diff --git a/seeds/snacks.js b/seeds/snacks.js index f690254..8f2e9da 100644 --- a/seeds/snacks.js +++ b/seeds/snacks.js @@ -1,4 +1,4 @@ -exports.seed = function(knex, Promise) { +exports.seed = function(knex, Promise) { // don't need to insert id because your id is auto incremented // Deletes ALL existing entries return knex('snacks').del() .then(function () { diff --git a/tests/server/routes/movie.test.js b/tests/server/routes/movie.test.js index 3c16f3d..98a7a90 100644 --- a/tests/server/routes/movie.test.js +++ b/tests/server/routes/movie.test.js @@ -8,6 +8,22 @@ var configureDatabase = require('../helpers/database-config') configureDatabase(test, app) +// Could have these tests inside one block of code +// eg + +// test.cb('GET /movie', t => { +// request(t.context.app) +// .get('/api/movie') +// .expect(200) +// .end((err,res) => { +// t.deepEqual(Object.keys(res.body).length, 12) +// t.deepEqual(Object.keys(res.body).show_title) +// t.deepEqual(Object.keys(res.body).show_id) +// t.deepEqual(Object.keys(res.body).show_cast) +// t.end() +// }) +// }) + test.cb('GET /movie', t => { request(t.context.app) .get('/api/movie')