Skip to content

test: Add RepositoryProfile tests #531

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

Merged
merged 1 commit into from
Oct 21, 2017
Merged

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’
@@ -164,13 +164,17 @@ export const RepositoryProfile = ({
</Text>

{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

@@ -29,3 +29,5 @@ jest.mock('react-native-i18n', () => {
jest.mock('react-native-cookies', () => ({}));

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.

3 participants