-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stephen Rugh <[email protected]>
- Loading branch information
Showing
6 changed files
with
443 additions
and
23 deletions.
There are no files selected for viewing
190 changes: 190 additions & 0 deletions
190
...ents/CartPage/PriceAdjustments/CouponCode/__tests__/__snapshots__/couponCode.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`disables remove button on click 1`] = ` | ||
<div> | ||
<span> | ||
COUPON | ||
</span> | ||
<button | ||
className="removeButton" | ||
disabled={true} | ||
onClick={[Function]} | ||
> | ||
Remove | ||
</button> | ||
</div> | ||
`; | ||
|
||
exports[`disables submit button on coupon entry 1`] = ` | ||
<form | ||
className="entryForm" | ||
onReset={[Function]} | ||
onSubmit={[Function]} | ||
> | ||
<div> | ||
<label | ||
htmlFor="couponCode" | ||
> | ||
Coupon Code | ||
</label> | ||
<span | ||
style={ | ||
Object { | ||
"--iconsAfter": 0, | ||
"--iconsBefore": 0, | ||
} | ||
} | ||
> | ||
<span> | ||
<input | ||
id="couponCode" | ||
name="couponCode" | ||
onBlur={[Function]} | ||
onChange={[Function]} | ||
placeholder="Enter code" | ||
value="" | ||
/> | ||
</span> | ||
<span /> | ||
<span /> | ||
</span> | ||
<p> | ||
</p> | ||
</div> | ||
<div> | ||
<label /> | ||
<button | ||
className="applybutton" | ||
disabled={true} | ||
type="submit" | ||
> | ||
<span> | ||
Apply | ||
</span> | ||
</button> | ||
</div> | ||
</form> | ||
`; | ||
|
||
exports[`renders CouponCode input and submit button 1`] = ` | ||
<form | ||
className="entryForm" | ||
onReset={[Function]} | ||
onSubmit={[Function]} | ||
> | ||
<div> | ||
<label | ||
htmlFor="couponCode" | ||
> | ||
Coupon Code | ||
</label> | ||
<span | ||
style={ | ||
Object { | ||
"--iconsAfter": 0, | ||
"--iconsBefore": 0, | ||
} | ||
} | ||
> | ||
<span> | ||
<input | ||
id="couponCode" | ||
name="couponCode" | ||
onBlur={[Function]} | ||
onChange={[Function]} | ||
placeholder="Enter code" | ||
value="" | ||
/> | ||
</span> | ||
<span /> | ||
<span /> | ||
</span> | ||
<p> | ||
</p> | ||
</div> | ||
<div> | ||
<label /> | ||
<button | ||
className="applybutton" | ||
disabled={false} | ||
type="submit" | ||
> | ||
<span> | ||
Apply | ||
</span> | ||
</button> | ||
</div> | ||
</form> | ||
`; | ||
|
||
exports[`renders an error message if an error occurs on code entry 1`] = ` | ||
<form | ||
className="entryForm" | ||
onReset={[Function]} | ||
onSubmit={[Function]} | ||
> | ||
<div> | ||
<label | ||
htmlFor="couponCode" | ||
> | ||
Coupon Code | ||
</label> | ||
<span | ||
style={ | ||
Object { | ||
"--iconsAfter": 0, | ||
"--iconsBefore": 0, | ||
} | ||
} | ||
> | ||
<span> | ||
<input | ||
id="couponCode" | ||
name="couponCode" | ||
onBlur={[Function]} | ||
onChange={[Function]} | ||
placeholder="Enter code" | ||
value="" | ||
/> | ||
</span> | ||
<span /> | ||
<span /> | ||
</span> | ||
<p> | ||
An error occurred. Try again. | ||
</p> | ||
</div> | ||
<div> | ||
<label /> | ||
<button | ||
className="applybutton" | ||
type="submit" | ||
> | ||
<span> | ||
Apply | ||
</span> | ||
</button> | ||
</div> | ||
</form> | ||
`; | ||
|
||
exports[`renders an error state if unable to fetch applied coupons 1`] = `"Something went wrong. Refresh and try again."`; | ||
|
||
exports[`renders nothing if no data is returned 1`] = `null`; | ||
|
||
exports[`renders the coupon code view if applied coupons has data 1`] = ` | ||
<div> | ||
<span> | ||
COUPON | ||
</span> | ||
<button | ||
className="removeButton" | ||
disabled={false} | ||
onClick={[Function]} | ||
> | ||
Remove | ||
</button> | ||
</div> | ||
`; |
Oops, something went wrong.