-
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
ht2 #36
base: master
Are you sure you want to change the base?
ht2 #36
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, а на то, что у нас кол-во не уходит в минус
id: PropTypes.string.isRequired, | ||
name: PropTypes.string, | ||
menu: PropTypes.array.isRequired, | ||
reviews: PropTypes.array.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.
тут reviews нужно глубже описать, т.к. нам нужен rating для расчета averageRating
id: PropTypes.string.isRequired, | ||
name: PropTypes.string.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.
тут shape и arrayOf тоже должны быть isRequired
PropTypes.shape({ | ||
id: PropTypes.string.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.
тут shape и arrayOf тоже должны быть isRequired
|
||
it('should render all reviews', () => { | ||
const wrapper = mount(<Reviews reviews={reviews} />); | ||
expect(wrapper.find('[data-id="review"]').length).toBe(reviews.length); |
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.
тут лучше проверять не наличие элементов, а сами имя юзера и прочее.
}) | ||
), | ||
activeId: PropTypes.string.isRequired, | ||
onChange: PropTypes.func, |
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.
onChange должен быть тоже isRequired
No description provided.