Skip to content

Feature/issue#18 events on click#22

Open
audjo wants to merge 12 commits intodevelopfrom
feature/issue#18-events-onClick
Open

Feature/issue#18 events on click#22
audjo wants to merge 12 commits intodevelopfrom
feature/issue#18-events-onClick

Conversation

@audjo
Copy link
Copy Markdown
Collaborator

@audjo audjo commented Apr 23, 2020

Copy link
Copy Markdown
Collaborator

@reginafernandezpinar reginafernandezpinar left a comment

Choose a reason for hiding this comment

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

I think it would be better to make a new component Button so you can add the other kind of test that it is requested

Aurora de Juan Ojeda added 2 commits April 23, 2020 14:52
@dailymp dailymp requested review from dailymp and mathewamg33 April 23, 2020 15:04
Copy link
Copy Markdown
Owner

@dailymp dailymp left a comment

Choose a reason for hiding this comment

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

Please review your pipeline is failing, and you have conflicts

Comment thread 03 Tests samples/src/components/MessagesSection/MessagesSection.test.tsx Outdated
@audjo
Copy link
Copy Markdown
Collaborator Author

audjo commented Apr 24, 2020

Done!

<h1>Messages management sample, deployed</h1>
<MessageForm messages={messages} />
<MessageList messages={messages} />
<div>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you don´t need this div element here, your button component is enough. Have you tried without it?

});
it('should handle the click event', () =>{
expect(
typeof component.find(Button).at(0).prop('onClickButton')).toBe('function');
Copy link
Copy Markdown
Collaborator

@reginafernandezpinar reginafernandezpinar Apr 27, 2020

Choose a reason for hiding this comment

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

Another very useful test here is the one in which you call the function handled in the prop:
component.find(Button).prop('handleOnClick')();
expect(props.handleOnClick).toHaveBeenCalledTimes(1);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done, I had forgotten to upload the changes!

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.

3 participants