-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product Out of Stock Message #1229
Merged
dpatil-magento
merged 11 commits into
magento:develop
from
sudeep-cedcoss:sudeep-pr-1159-again
Jun 6, 2019
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f46431d
Fixed #1159
sudeep-cedcoss 79f6a97
Merge branch 'develop' into sudeep-pr-1159-again
sudeep-cedcoss 7b33e58
Merge branch 'develop' into sudeep-pr-1159-again
supernova-at a268cec
Merge branch 'develop' into sudeep-pr-1159-again
supernova-at 12b3db8
Merge branch 'develop' into sudeep-pr-1159-again
supernova-at 06eb117
Merge branch 'develop' into sudeep-pr-1159-again
supernova-at e317c03
Updates Product to show out of stock message when appropriate
supernova-at 992cbaf
Adds Unit Tests to ErrorView
supernova-at 4e19d10
Merge branch 'develop' into sudeep-pr-1159-again
tjwiebell 74f3ef9
Merge branch 'develop' into sudeep-pr-1159-again
supernova-at 29936e3
Merge branch 'develop' into sudeep-pr-1159-again
dpatil-magento File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
...ges/venia-concept/src/components/ErrorView/__tests__/__snapshots__/errorView.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,29 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`it renders the correct tree when loading 1`] = ` | ||
<h1> | ||
<Classify(LoadingIndicator)> | ||
<span> | ||
Fetching Data... | ||
</span> | ||
</Classify(LoadingIndicator)> | ||
</h1> | ||
`; | ||
|
||
exports[`it renders the correct tree when out of stock 1`] = ` | ||
<h1> | ||
This Product is currently out of stock. Please try again later. | ||
</h1> | ||
`; | ||
|
||
exports[`it renders the correct tree when page not found 1`] = ` | ||
<h1> | ||
That page could not be found. Please try again. | ||
</h1> | ||
`; | ||
|
||
exports[`it renders the internal error tree otherwise 1`] = ` | ||
<h1> | ||
Something went wrong. Please try again. | ||
</h1> | ||
`; |
30 changes: 30 additions & 0 deletions
30
packages/venia-concept/src/components/ErrorView/__tests__/errorView.spec.js
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,30 @@ | ||
import React from 'react'; | ||
import ShallowRenderer from 'react-test-renderer/shallow'; | ||
|
||
import ErrorView from '../errorView'; | ||
|
||
const renderer = new ShallowRenderer(); | ||
|
||
test('it renders the correct tree when loading', () => { | ||
const tree = renderer.render(<ErrorView loading={true} />); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
test('it renders the correct tree when page not found', () => { | ||
const tree = renderer.render(<ErrorView notFound={true} />); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
test('it renders the correct tree when out of stock', () => { | ||
const tree = renderer.render(<ErrorView outOfStock={true} />); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
test('it renders the internal error tree otherwise', () => { | ||
const tree = renderer.render(<ErrorView />); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to allow an error string rather than using this prop. This will allow us to separate the error messages and types from the
ErrorView
implementation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah the
ErrorView
certainly could use a refactor. I already felt like addingoutOfStock
was a little scope creep here and I felt like refactoring all ofErrorView
would be solidly out of scope for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can create a follow up ticket to refactor
ErrorView
for sureThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cool -- though the component is super small and I feel like the effort to refactor now is less than the effort to create, groom and work on it later. But w/e you want to do is cool, you're the one doing this work now :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fair point, lol.
I created #1308 just to keep things moving though.