Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ht2 #36

wants to merge 1 commit into from

Conversation

uxpat
Copy link

@uxpat uxpat commented Dec 6, 2021

No description provided.

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');
Copy link
Owner

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,
Copy link
Owner

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,
})
),
Copy link
Owner

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,
})
),
Copy link
Owner

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);
Copy link
Owner

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,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onChange должен быть тоже isRequired

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants