-
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
Misnik ht 2 #38
base: master
Are you sure you want to change the base?
Misnik ht 2 #38
Conversation
@@ -29,4 +29,10 @@ describe('Product', () => { | |||
mount(<Product product={product} fetchData={fn} />); | |||
expect(fn).toBeCalledWith(product.id); | |||
}); | |||
|
|||
it('should decrement amount', () => { | |||
const wrapper = mount(<Product product={product} amount={1}/>); |
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.
все верно, но если сломается amount={1} и decrement, то тест все равно пройдет
rating: PropTypes.number.isRequired | ||
}).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.
тут shape тоже должен быть isRequired
PropTypes.shape({ | ||
id: PropTypes.string.isRequired, | ||
name: PropTypes.string, | ||
}) |
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 тоже должен быть isRequired
|
||
it('should review user not Anonymous', () => { | ||
const wrapper = mount(<Reviews reviews={reviews} />); | ||
expect(wrapper.find('[data-id="reviews"] h4').text()).not.toBe('Anonymous'); |
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.
тут лучше поиск делать по дата атрибутам, т.к. если мы поменяем в разметке на h5, то тест упадет
@@ -17,3 +18,12 @@ export default function Tabs({ tabs, activeId, onChange }) { | |||
</div> | |||
); | |||
} | |||
|
|||
Tabs.propTypes = { |
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, onChange пропущены
No description provided.