Skip to content

Conversation

@alejandronanez
Copy link
Member

@alejandronanez alejandronanez commented Oct 20, 2017

  • Add tests for Repository Profile Component
  • Mock ‘react-native-safari-view’

Related to #518

- Add tests for Repository Profile Component
- Mock ‘react-native-safari-view’
{repository.fork && (
<Text style={[styles.subtitle, styles.subtitleFork]}>
<Text
nativeId="repository-fork-container"
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to add this prop so it was possible to target this specific component in its test file.
nativeId is used for e2e tests Docs About nativeId


jest.mock('react-native-code-push', () => ({}));

jest.mock('react-native-safari-view', () => ({}));
Copy link
Member Author

Choose a reason for hiding this comment

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

Mocking this so we don't get an error.

@andrewda andrewda mentioned this pull request Oct 20, 2017
63 tasks
@andrewda andrewda changed the title feat(test): Add RepositoryProfile tests tests: Add RepositoryProfile tests Oct 21, 2017
@andrewda andrewda changed the title tests: Add RepositoryProfile tests test: Add RepositoryProfile tests Oct 21, 2017
Copy link
Member

@machour machour left a comment

Choose a reason for hiding this comment

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

👍

@alejandronanez alejandronanez merged commit 93cb6c7 into master Oct 21, 2017
@alejandronanez alejandronanez deleted the repository-profile-tests branch October 21, 2017 13:44
const wrapper = shallow(
<RepositoryProfile {...defaultProps} loading={true} />
);
const theIcon = wrapper.find({ name: 'fiber-manual-record' });
Copy link
Member

Choose a reason for hiding this comment

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

It's a bit weird to use "the" in a variable name (unless you have a specific reason?) How about just const icon = wrapper.find({ name: 'fiber-manual-record' });

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that works too. Will update it on my next PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants