diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-09-14 12:18:12 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-09-14 12:18:12 -0400 |
| commit | 2d145b026cfdf54a63bef0b9d6324b6785390307 (patch) | |
| tree | f6c1d8f987437803a5c026e70535bf9ff244e885 /finished-application/frontend/__tests__/__snapshots__ | |
| parent | 8a5825d52271d712ec7c8348447d433067e13ef2 (diff) | |
move finished folder
Diffstat (limited to 'finished-application/frontend/__tests__/__snapshots__')
13 files changed, 691 insertions, 0 deletions
diff --git a/finished-application/frontend/__tests__/__snapshots__/AddToCart.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/AddToCart.test.js.snap new file mode 100644 index 0000000..2f489d4 --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/AddToCart.test.js.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<AddToCart/> renders and matches the snap shot 1`] = ` +<button + disabled={false} + onClick={[Function]} +> + Add + To Cart 🛒 +</button> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/Cart.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/Cart.test.js.snap new file mode 100644 index 0000000..d5c0d92 --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/Cart.test.js.snap @@ -0,0 +1,32 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<Cart/> renders and matches snappy 1`] = ` +<header> + <CloseButton + onClick={[Function]} + title="close" + > + <button + className="CloseButton-sc-1seb878-0 lbNKfp" + onClick={[Function]} + title="close" + > + × + </button> + </CloseButton> + <Supreme> + <h3 + className="Supreme-xv30qb-0 hpaXsq" + > + Miss Coleman Berge + 's Cart + </h3> + </Supreme> + <p> + You Have + 1 + Item + in your cart. + </p> +</header> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/CartCount.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/CartCount.test.js.snap new file mode 100644 index 0000000..92ee89a --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/CartCount.test.js.snap @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<CartCount/> matches the snapshot 1`] = ` +<CartCount__AnimationStyles> + <TransitionGroup + childFactory={[Function]} + component="div" + > + <CSSTransition + className="count" + classNames="count" + key="11" + timeout={ + Object { + "enter": 400, + "exit": 400, + } + } + unmountOnExit={true} + > + <CartCount__Dot> + 11 + </CartCount__Dot> + </CSSTransition> + </TransitionGroup> +</CartCount__AnimationStyles> +`; + +exports[`<CartCount/> updates via props 1`] = ` +<CartCount__AnimationStyles> + <TransitionGroup + childFactory={[Function]} + component="div" + > + <CSSTransition + className="count" + classNames="count" + key="50" + timeout={ + Object { + "enter": 400, + "exit": 400, + } + } + unmountOnExit={true} + > + <CartCount__Dot> + 50 + </CartCount__Dot> + </CSSTransition> + </TransitionGroup> +</CartCount__AnimationStyles> +`; + +exports[`<CartCount/> updates via props 2`] = ` +<CartCount__AnimationStyles> + <TransitionGroup + childFactory={[Function]} + component="div" + > + <CSSTransition + className="count" + classNames="count" + key="10" + timeout={ + Object { + "enter": 400, + "exit": 400, + } + } + unmountOnExit={true} + > + <CartCount__Dot> + 10 + </CartCount__Dot> + </CSSTransition> + </TransitionGroup> +</CartCount__AnimationStyles> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/CreateItem.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/CreateItem.test.js.snap new file mode 100644 index 0000000..59d8557 --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/CreateItem.test.js.snap @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<CreateItem/> renders and matches snapshot 1`] = ` +<form + className="Form-sc-1xszr8q-0 krRxky" + data-test="form" + onSubmit={[Function]} +> + <DisplayError + error={Object {}} + /> + <fieldset + aria-busy={false} + disabled={false} + > + <label + htmlFor="file" + > + Image + <input + id="file" + name="file" + onChange={[Function]} + placeholder="Upload an image" + required={true} + type="file" + /> + </label> + <label + htmlFor="title" + > + Title + <input + id="title" + name="title" + onChange={[Function]} + placeholder="Title" + required={true} + type="text" + value="" + /> + </label> + <label + htmlFor="price" + > + Price + <input + id="price" + name="price" + onChange={[Function]} + placeholder="Price" + required={true} + type="number" + value={0} + /> + </label> + <label + htmlFor="description" + > + Description + <textarea + id="description" + name="description" + onChange={[Function]} + placeholder="Enter A Description" + required={true} + value="" + /> + </label> + <button + type="submit" + > + Submit + </button> + </fieldset> +</form> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/Item.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/Item.test.js.snap new file mode 100644 index 0000000..70e4aa8 --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/Item.test.js.snap @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<Item/> renders and matches the snapshot 1`] = ` +<ItemStyles__Item> + <img + alt="A Cool Item" + src="dog.jpg" + /> + <Title> + <Link + href={ + Object { + "pathname": "/item", + "query": Object { + "id": "ABC123", + }, + } + } + > + <a> + A Cool Item + </a> + </Link> + </Title> + <PriceTag> + $40 + </PriceTag> + <p> + This item is really cool! + </p> + <div + className="buttonList" + > + <Link + href={ + Object { + "pathname": "update", + "query": Object { + "id": "ABC123", + }, + } + } + > + <a> + Edit ✏️ + </a> + </Link> + <AddToCart + id="ABC123" + /> + <DeleteItem + id="ABC123" + > + Delete This Item + </DeleteItem> + </div> +</ItemStyles__Item> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/Nav.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/Nav.test.js.snap new file mode 100644 index 0000000..c3155a9 --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/Nav.test.js.snap @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<Nav/> renders a minimal nav when signed out 1`] = ` +<ul + className="NavStyles-sc-11c0d2g-0 YVEeD" + data-test="nav" +> + <Link + href="/items" + > + <a + href="/items" + onClick={[Function]} + > + Shop + </a> + </Link> + <Link + href="/signup" + > + <a + href="/signup" + onClick={[Function]} + > + Sign In + </a> + </Link> +</ul> +`; + +exports[`<Nav/> renders the amount of items in the cart 1`] = ` +<div + className="count CartCount__Dot-xxvp4g-1 fJsVOg" +> + 9 +</div> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/Order.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/Order.test.js.snap new file mode 100644 index 0000000..9dce80b --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/Order.test.js.snap @@ -0,0 +1,118 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<Order/> renders the order 1`] = ` +<div + className="OrderStyles-sc-4oqalm-0 eDzsVm" + data-test="order" +> + <SideEffect(Head)> + <Head /> + </SideEffect(Head)> + <p> + <span> + Order ID: + </span> + <span> + ord123 + </span> + </p> + <p> + <span> + Charge + </span> + <span> + ch_123 + </span> + </p> + <p> + <span> + Date + </span> + <span> + March 31, 2018 8:00 PM + </span> + </p> + <p> + <span> + Order Total + </span> + <span> + $400 + </span> + </p> + <p> + <span> + Item Count + </span> + <span> + 2 + </span> + </p> + <div + className="items" + > + <div + className="order-item" + key="3a430a73-c9e9-4bcc-b46a-41618965ffea" + > + <img + alt="soluta non omnis consequatur enim quia autem" + src="reprehenderit.jpg" + /> + <div + className="item-details" + > + <h2> + soluta non omnis consequatur enim quia autem + </h2> + <p> + Qty: + 1 + </p> + <p> + Each: + $42.34 + </p> + <p> + SubTotal: + $42.34 + </p> + <p> + et modi tenetur amet modi reprehenderit omnis + </p> + </div> + </div> + <div + className="order-item" + key="2393e090-592f-4d03-b808-c9d81098deec" + > + <img + alt="quia sed exercitationem omnis laborum exercitationem est" + src="sint.jpg" + /> + <div + className="item-details" + > + <h2> + quia sed exercitationem omnis laborum exercitationem est + </h2> + <p> + Qty: + 1 + </p> + <p> + Each: + $42.34 + </p> + <p> + SubTotal: + $42.34 + </p> + <p> + sapiente laudantium molestias assumenda quasi adipisci mollitia + </p> + </div> + </div> + </div> +</div> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/Pagination.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/Pagination.test.js.snap new file mode 100644 index 0000000..110f59d --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/Pagination.test.js.snap @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<Pagination/> renders pagination for 18 items 1`] = ` +<div + className="PaginationStyles-aduuar-0 ewJsCc" + data-test="pagination" +> + <SideEffect(Head)> + <Head /> + </SideEffect(Head)> + <Link + href={ + Object { + "pathname": "items", + "query": Object { + "page": 0, + }, + } + } + prefetch={true} + > + <a + aria-disabled={true} + className="prev" + href="items?page=0" + onClick={[Function]} + > + ← Prev + </a> + </Link> + <p> + Page + 1 + of + <span + className="totalPages" + > + 5 + </span> + ! + </p> + <p> + 18 + Items Total + </p> + <Link + href={ + Object { + "pathname": "items", + "query": Object { + "page": 2, + }, + } + } + prefetch={true} + > + <a + aria-disabled={false} + className="next" + href="items?page=2" + onClick={[Function]} + > + Next → + </a> + </Link> +</div> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/RemoveFromCart.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/RemoveFromCart.test.js.snap new file mode 100644 index 0000000..db8687b --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/RemoveFromCart.test.js.snap @@ -0,0 +1,12 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<RemoveFromCart/> renders and matches snapshot 1`] = ` +<button + className="RemoveFromCart__BigButton-emvtd6-0 gPWNSn" + disabled={false} + onClick={[Function]} + title="Delete Item" +> + × +</button> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/RequestReset.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/RequestReset.test.js.snap new file mode 100644 index 0000000..c0de705 --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/RequestReset.test.js.snap @@ -0,0 +1,39 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<RequestReset/> renders and matches snapshot 1`] = ` +<form + className="Form-sc-1xszr8q-0 krRxky" + data-test="form" + method="post" + onSubmit={[Function]} +> + <fieldset + aria-busy={false} + disabled={false} + > + <h2> + Request a password reset + </h2> + <DisplayError + error={Object {}} + /> + <label + htmlFor="email" + > + Email + <input + name="email" + onChange={[Function]} + placeholder="email" + type="email" + value="" + /> + </label> + <button + type="submit" + > + Request Reset! + </button> + </fieldset> +</form> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/Signup.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/Signup.test.js.snap new file mode 100644 index 0000000..bb61ff1 --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/Signup.test.js.snap @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<Signup/> renders and matches snapshot 1`] = ` +<form + className="Form-sc-1xszr8q-0 krRxky" + method="post" + onSubmit={[Function]} +> + <fieldset + aria-busy={false} + disabled={false} + > + <h2> + Sign Up for An Account + </h2> + <DisplayError + error={Object {}} + /> + <label + htmlFor="email" + > + Email + <input + name="email" + onChange={[Function]} + placeholder="email" + type="email" + value="" + /> + </label> + <label + htmlFor="name" + > + Name + <input + name="name" + onChange={[Function]} + placeholder="name" + type="text" + value="" + /> + </label> + <label + htmlFor="password" + > + Password + <input + name="password" + onChange={[Function]} + placeholder="password" + type="password" + value="" + /> + </label> + <button + type="submit" + > + Sign Up! + </button> + </fieldset> +</form> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/SingleItem.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/SingleItem.test.js.snap new file mode 100644 index 0000000..2f41d4c --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/SingleItem.test.js.snap @@ -0,0 +1,32 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<SingleItem/> Errors with a not found item 1`] = ` +<p + data-test="graphql-error" +> + <strong> + Shoot! + </strong> + Items Not Found! +</p> +`; + +exports[`<SingleItem/> renders with proper data 1`] = ` +<h2> + Viewing + dogs are best +</h2> +`; + +exports[`<SingleItem/> renders with proper data 2`] = ` +<img + alt="dogs are best" + src="dog.jpg" +/> +`; + +exports[`<SingleItem/> renders with proper data 3`] = ` +<p> + dogs +</p> +`; diff --git a/finished-application/frontend/__tests__/__snapshots__/TakeMyMoney.test.js.snap b/finished-application/frontend/__tests__/__snapshots__/TakeMyMoney.test.js.snap new file mode 100644 index 0000000..02a112e --- /dev/null +++ b/finished-application/frontend/__tests__/__snapshots__/TakeMyMoney.test.js.snap @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`<TakeMyMoney/> renders and matches snapshot 1`] = ` +<ReactStripeCheckout + ComponentClass="span" + amount={15000} + className="StripeCheckout" + currency="USD" + description="Order of 3 items!" + email="Delmer.Smith@yahoo.com" + image="dog-small.jpg" + label="Pay With Card" + locale="auto" + name="Sick Fits" + reconfigureOnUpdate={false} + stripeKey="pk_test_Vtknn6vSdcZWSG2JWvEiWSqC" + token={[Function]} + triggerEvent="onClick" +> + <button + className="StripeCheckout" + onBlur={[Function]} + onClick={[Function]} + onFocus={[Function]} + onMouseDown={[Function]} + onMouseOut={[Function]} + onMouseUp={[Function]} + style={ + Object { + "background": "linear-gradient(#28a0e5,#015e94)", + "border": 0, + "borderRadius": 5, + "boxShadow": "0 1px 0 rgba(0,0,0,0.2)", + "cursor": "pointer", + "display": "inline-block", + "overflow": "hidden", + "padding": 1, + "textDecoration": "none", + "userSelect": "none", + "visibility": "visible", + } + } + > + <span + style={ + Object { + "backgroundImage": "linear-gradient(#7dc5ee,#008cdd 85%,#30a2e4)", + "borderRadius": 4, + "boxShadow": "inset 0 1px 0 rgba(255,255,255,0.25)", + "color": "#fff", + "display": "block", + "fontFamily": "\\"Helvetica Neue\\",Helvetica,Arial,sans-serif", + "fontSize": 14, + "fontWeight": "bold", + "height": 30, + "lineHeight": "30px", + "padding": "0 12px", + "position": "relative", + "textShadow": "0 -1px 0 rgba(0,0,0,0.25)", + } + } + > + Pay With Card + </span> + </button> +</ReactStripeCheckout> +`; |
