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

test: begin implementing basic component tests #407

Merged
merged 15 commits into from
Oct 20, 2017
Merged

Conversation

andrewda
Copy link
Member

@andrewda andrewda commented Oct 2, 2017

Re-opening #148 as a branch of this main repo so it's easier for people to contribute to these tests while they're being developed.

Fixes #112.

package.json Outdated
"react-native-syntax-highlighter": "^1.2.1",
"react-native-table-component": "^1.0.5",
"react-native-table-component": "https://github.com/jaynakus/react-native-table-component/tarball/master",
Copy link
Member Author

Choose a reason for hiding this comment

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

Can be set to ^1.1.0 🎉

Copy link
Member

Choose a reason for hiding this comment

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

Why is this pointing to github instead of a regular version number?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the fork that works with React 16. Now 1.1.0 works, too

Copy link
Member

Choose a reason for hiding this comment

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

Oh, makes sense! Thanks for clarification @andrewda!

@andrewda andrewda mentioned this pull request Oct 8, 2017
Copy link
Member

@alejandronanez alejandronanez left a comment

Choose a reason for hiding this comment

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

Do you think we should merge this so everybody else can see how are we testing and start contributing if they like?
LGTM!

@andrewda
Copy link
Member Author

I think #493 just needs to me merged, then this will be GTG.

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.

LGTM, merge, merge, merge 🙌

@jouderianjr
Copy link
Member

I would love to help the implementation of the tests \o/ Once on master, how could we split the job? Divide and conquer 💃

@alejandronanez
Copy link
Member

We should do the same as we did for styled-components, create different issues so people can start contributing one component at a time. 😎

it('correctly renders with default touchable view', () => {
const wrapper = render(
<ToggleView>
<Text>I'm hidden</Text>
Copy link
Member Author

Choose a reason for hiding this comment

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

GitHub doesn't like these quotation marks for some reason (though I believe they'll compile fine). Maybe just replace with "I am hidden"?

it('correctly renders with a custom touchable view', () => {
const wrapper = render(
<ToggleView TouchableView={<Text>CUSTOM</Text>}>
<Text>I'm hidden</Text>
Copy link
Member Author

Choose a reason for hiding this comment

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

^

it('starts with the hidden element collapsed', () => {
const wrapper = shallow(
<ToggleView TouchableView={<Text>CUSTOM</Text>}>
<Text>I'm hidden</Text>
Copy link
Member Author

Choose a reason for hiding this comment

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

^

const onPress = sinon.spy();
const wrapper = shallow(
<ToggleView>
<Text>I'm hidden</Text>
Copy link
Member Author

Choose a reason for hiding this comment

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

^

const onPress = sinon.spy();
const wrapper = shallow(
<ToggleView>
<Text>I'm hidden</Text>
Copy link
Member Author

Choose a reason for hiding this comment

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

^

@andrewda
Copy link
Member Author

I'll fix the comment I left above quickly, then I'd just like to get a few more confirmations that this works on Android, because this is making the significant leap to React v16.

Copy link
Member

@housseindjirdeh housseindjirdeh left a comment

Choose a reason for hiding this comment

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

Ooh boy thank you so much @andrewda, we finally have some tests in!

@alejandronanez @jouderianjr I think that's a great idea 😍 Adding small easy-to-take issues to add tests for different components/files will be amazing.

Beyond excited to have tests part of process and then eventually making sure all new components/logic files that come in having decent test coverage.

Thanks a million again @andrewda

@housseindjirdeh housseindjirdeh merged commit f9f5b04 into master Oct 20, 2017
@andrewda andrewda mentioned this pull request Oct 20, 2017
63 tasks
@andrewda
Copy link
Member Author

@jouderianjr @alejandronanez Check out #518 for dividing up the work!

@andrewda andrewda deleted the tests branch October 20, 2017 01:51
dyesseyumba pushed a commit to dyesseyumba/git-point that referenced this pull request Oct 20, 2017
* test: begin implementing tests

* test: add more tests

* test: add Buton and Badge tests

* test: add StateBadge test

* test: only import used enzyme wrappers

* chore(deps): update table component to 1.1.0

* test: Add tests for ToggleView

* Update ToggleView.js
chinesedfan pushed a commit that referenced this pull request Jan 6, 2018
* refactor(fonts): Remove useless fonts in android (#485)

* refactor(fonts): Remove MaterialIcons from used fonts in android (#485)

BREAKING CHANGE: Update link script in Package.json

* Revert "refactor(fonts): Remove MaterialIcons from used fonts in android (#485)"

This reverts commit 282f475.

* fix: Update stateRandom and reset cookies after a successful login (#494)

* feat(markdown): Add support for quoted emails (#501)

* feat(markdown): Add support for quoted emails

* fix: use paddingHorizontal instead of Left and Right

* refactor: Drop rn-app-intro in favor of react-native-swiper (#493)

* refactor: Drop rn-app-intro in favor of react-native-swiper

* fix: Don't embed swiper in a View, so that it works on Android

* chore: Hide the commitlint folder (#488)

* feature(translation): add Spanish translation (#442)

* Spanish file (first translation)

* Languague related files

* Fix

* Replaced double quotes

* Improved spanish translation

* Minor improvements (spanish translation)

* Some improvements (spanish translation)

The GIT reserved words are kept without translate.

* Removed english phrase

* Updated analytics title

* Updated spanish translation

* Added missing fields (spanish translation)

* Replaced tabs (spanish translation)

* Changed some words to downcase (spanish translation)

* feat: Issue Events (#438)

* feat(issue_events): Show events on issues

* style(issue_events): Added styles to "added label" event

* style(issue_events): Add icon & improve styling of added labels

* style(issue_events): Improve <ReviewRequested /> styles

* feat(issue_events): Remove mentioned/subscribed events from UI

* feat(issue_events): Define <Closed /> events

* refactor(issue_events): Extract <EventIcon /> and <Date />

* feat(issue_events): Add `unlabled` prop to <Labeled />

* feat(issue_events): Define <Merged /> event

* feat(issue_events): Filter out `closed` events preceded by `merged`

* feat(issue_events): Define <HeadRef /> events

* feat(issue_events): Define <Assigned /> events

* feat(issue_events): Define <Reopened /> & <Renamed /> events

* refactor(issue_events): Render <Text /> from <ActorLink />

* style(issue_events): Trim issue names to ensure spacing

* feat(issue_events): Define <Locked />  event

* feat(issue_events): Define <Milestoned />  event

* refactor(issue_events): Clean up authUser from LabeledComponent

* feat(issue_events): Define <MarkedAsDuplicate /> event

* refactor(issue_events): Define generic <Event /> component

* docs(readme): Add @brandly as a contributor

* feat(issue_events): Define <LabelGroup /> for list of label changes

* refactor(issue_events): Use spread operator for textChildren

* style(issue_events): Add blank line after external imports

* feat(issue_events): <InlineLabel /> has rounded corners

* refactor(issue_events): Move <InlineLabel /> into own file

* feat(issue_events): Press username in events to view profile

* refactor(events): Inline most <Event />s into <IssueEventListItem />

* refactor(events): Eliminate <Date /> since its only used once

* refactor(events): Extract formatEventsToRender into event-helpers

* fix(ux): Add back button for AuthProfileScreen (#507)

Adds back button when AuthProfileScreen is not the root of a StackNavigator.

Ps. AuthProfileScreen is StackNavigator root when the routeName is MyProfile.

* style(issueeventlistitem, commentlistitem): Slightly shrink issue event badges + change user click o (#516)

* fix: Remove undefined var & fix typo (#517)

* chore: fix `yarn run link` (#513)

* chore(fonts): Not link all fonts from react-native-vector-icons

* fix(fonts): Add the missing Menlo

* fix(cli): Fix for RN 0.48

* chore(cli): Run `yarn run link` again

* chore(*): convert notification icon styles to styled-component (#510)

Convert notification-icon.component.js to use styled-components as part of #503

* chore(*): convert label-list-item component styles to styled component (#509)

Converted the label-list-item component styles to styled-components

* chore(*): style view-container.component.js (#508)

Converted view-container.component.js to use styled components

BREAKING CHANGE: none

none

* refactor(auth): get user data after login (#502)

* test: begin implementing basic component tests (#407)

* test: begin implementing tests

* test: add more tests

* test: add Buton and Badge tests

* test: add StateBadge test

* test: only import used enzyme wrappers

* chore(deps): update table component to 1.1.0

* test: Add tests for ToggleView

* Update ToggleView.js

* refactor(fonts): Remove useless fonts in android (#485)

* refactor(fonts): Remove MaterialIcons from used fonts in android (#485)

BREAKING CHANGE: Update link script in Package.json

* Revert "refactor(fonts): Remove MaterialIcons from used fonts in android (#485)"

This reverts commit 282f475.

* test: Add tests for CommentInput (#518)

* refactor: Beautify the code of CommentInput unit test.

* refactor: use jest mocks instead of sinon spies.

* refactor: Apply @chinesedfan recommendations

* refactor: Improve test descriptions.

* test: Add two cases of test and integrate styled-components in tests.

Add two more cases for userHasPushPermission and issueLocked. Update test to use migrated components
to styled-components.

* refactor: Remove console.log statement.

* test: Improve test descriptions and remove useless console.log

* test: Fix conflicts between descriptions and implementations.

* refactor: Runned prettier on CommentInput.js
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.

5 participants