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

Misnik ht 2 #38

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

Misnik ht 2 #38

wants to merge 1 commit into from

Conversation

Laidar
Copy link

@Laidar Laidar commented Dec 6, 2021

No description provided.

@Laidar Laidar changed the title Домашнее задание №2. Мисник Александр. Misnik ht 2 Dec 6, 2021
@@ -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}/>);
Copy link
Owner

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

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

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

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 = {
Copy link
Owner

Choose a reason for hiding this comment

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

activeId, onChange пропущены

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