-
Notifications
You must be signed in to change notification settings - Fork 26
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
prop types, tests #37
base: master
Are you sure you want to change the base?
Conversation
it('should decrement amount', () => { | ||
const wrapper = mount(<Product product={product} />); | ||
wrapper.find('button[data-id="product-decrement"]').simulate('click'); | ||
expect(wrapper.find('[data-id="product-amount"]').text()).toBe('0'); |
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.
это тест не на decrement, а на то, что у нас кол-во не уходит в минус
PropTypes.shape({ | ||
id: PropTypes.string.isRequired, | ||
name: PropTypes.string.isRequired, | ||
menu: PropTypes.arrayOf( |
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.
слишком глубоко описаны propTypes, нем тут не нужна детализация по menu и reviews
PropTypes.shape({ | ||
id: PropTypes.string.isRequired, | ||
})).isRequired | ||
}; |
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.
тут arrayOf тоже должен быть isRequired
|
||
it('allows us to set props', () => { | ||
const wrapper = mount(<Reviews reviews={reviews} />); | ||
expect(wrapper.props().reviews[0].rating).toEqual(5); |
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.
не нужно проверять props, тем более те, которых не должно быть
No description provided.