diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-05-07 16:54:27 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-05-07 16:54:27 -0400 |
| commit | c9a2b488c83dcaae0a00d2177d3bfe1f185c28bf (patch) | |
| tree | ee3b0ad93874e434a212b43194286f366f13fbe1 /frontend/components | |
| parent | dbd39fcc3861facecdd4413c90ae85cebd5db67f (diff) | |
TEST ESTSE TS ETSETST
Diffstat (limited to 'frontend/components')
| -rw-r--r-- | frontend/components/CreateItem.js | 4 | ||||
| -rw-r--r-- | frontend/components/EditUser.js | 2 | ||||
| -rw-r--r-- | frontend/components/ResetRequest.js | 2 | ||||
| -rw-r--r-- | frontend/components/TakeMyMoney.js | 4 |
4 files changed, 7 insertions, 5 deletions
diff --git a/frontend/components/CreateItem.js b/frontend/components/CreateItem.js index 2aabb5b..3dd929f 100644 --- a/frontend/components/CreateItem.js +++ b/frontend/components/CreateItem.js @@ -48,8 +48,8 @@ class CreateItem extends Component { <Mutation mutation={CREATE_ITEM_MUTATION} variables={this.state} - // TODO - update all items - // refetchQueries={[{ query: ALL_ITEMS_QUERY }]} + // TODO - update all items + // refetchQueries={[{ query: ALL_ITEMS_QUERY }]} > {(createItem, { loading, error }) => ( <Form diff --git a/frontend/components/EditUser.js b/frontend/components/EditUser.js index eeba72e..506966b 100644 --- a/frontend/components/EditUser.js +++ b/frontend/components/EditUser.js @@ -31,7 +31,6 @@ class EditUser extends React.Component { <Query query={CURRENT_USER_QUERY}> {({ data: { me }, loading }) => { if (loading) return <p>Loading...</p>; - if (!me) return <p>You must be logged in</p>; return ( <Mutation mutation={UPDATE_USER_MUTATION} @@ -42,6 +41,7 @@ class EditUser extends React.Component { <Form onSubmit={e => this.handleSubmit(e, updateUser)}> <Error error={error} /> <fieldset disabled={loading} aria-busy={loading}> + {called && !error && <p data-test="updated">Updated!</p>} <label htmlFor="name"> Name: <input diff --git a/frontend/components/ResetRequest.js b/frontend/components/ResetRequest.js index 2302173..67ab787 100644 --- a/frontend/components/ResetRequest.js +++ b/frontend/components/ResetRequest.js @@ -16,8 +16,8 @@ class ResetRequest extends React.Component { <Form onSubmit={async e => { e.preventDefault(); - // I wanna spy on this const res = await resetMutation(); + console.log('HEYY'); console.log(res); }} data-test="ResetRequest" diff --git a/frontend/components/TakeMyMoney.js b/frontend/components/TakeMyMoney.js index e8b11f2..fb5f727 100644 --- a/frontend/components/TakeMyMoney.js +++ b/frontend/components/TakeMyMoney.js @@ -5,6 +5,7 @@ import Router from 'next/router'; import NProgress from 'nprogress'; import { CREATE_ORDER_MUTATION, CURRENT_USER_QUERY } from '../queries/queries'; import calcTotalPrice from '../lib/calcTotalPrice'; +import Error from './ErrorMessage'; function totalItems(cart) { return cart.reduce((tally, cartItem) => tally + cartItem.quantity, 0); @@ -29,8 +30,9 @@ class TakeMyMoney extends Component { render() { return ( <Query query={CURRENT_USER_QUERY}> - {({ data: { me } }) => { + {({ data: { me }, error }) => { if (!me || !me.cart.length) return null; + if (error) return <Error error={error} />; return ( <Mutation mutation={CREATE_ORDER_MUTATION} |
