Skip to content
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
3 changes: 2 additions & 1 deletion client/actions/movie.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 2 additions & 2 deletions client/components/AddSnackForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AddSnackForm extends React.Component {
this.setState({snack})
}

render () {
render () { //alan said make your p tags in line
return (
<div className='form'>
<p><input type='text' id='name' name='name' placeholder='Snack name' onChange={(e) => this.handleChange(e)} /></p>
Expand All @@ -33,7 +33,7 @@ class AddSnackForm extends React.Component {
)}
}

const mapStateToProps = (state) => {
const mapStateToProps = (state) => { //alan : indentation wasn't properly
return {snack: state.snack}

}
Expand Down
4 changes: 2 additions & 2 deletions client/components/App.jsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
<div className='app-container container '>

<div className='row'>
Expand Down
2 changes: 1 addition & 1 deletion seeds/snacks.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
16 changes: 16 additions & 0 deletions tests/server/routes/movie.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down