a reputation protocol for open collaboration
Go to file
William Chargin feac85ad2c
Use Enzyme to test ContributionList dynamics (#102)
Summary:
This is our first dynamic test of a React component! Enzyme looks pretty
easy to use to me, for both snapshot tests and interaction simulation.

In doing so, we catch a minor bug in the edge case where a contribution
is not owned by any plugin (`colSpan`, not `colspan`). This edge case
does not appear in the sample data, but it does appear in the test data,
even prior to this commit. The previous renderer, `react-test-renderer`,
appears not to surface this error. Furthermore, this bug did not cause
any user-visible errors except a `console.error`.

Test Plan:
Inspect the snapshot file to make sure that it is reasonable. (The
existing test case has its snapshot regenerated due to formatting
differences between the two renderers.)

To test that the browser error is fixed, render a contribution list on a
GitHub graph but with an empty adapter set. One way to do this is to comment out line 7 of
`standardAdapterSet.js`; alternately, you can use the React Dev Tools to
select the `ContributionList` node, then run
```js
$r.props.adapters.adapters = {};
$r.forceUpdate();
```
Note subsequently that there is no console error and that the `<td>`s in
question span three columns.

wchargin-branch: contributionlist-dynamic-test
2018-03-21 17:35:17 -07:00
config Make GitHub capitalization consistent within code (#100) 2018-03-20 18:32:05 -07:00
experiments Tweak commit_graph_dump & store sample data. (#12) 2018-02-15 22:16:37 -08:00
flow-typed/npm Move package json to root (#37) 2018-02-26 22:32:23 -08:00
scripts Configure Webpack for backend applications (#84) 2018-03-18 22:43:23 -07:00
src Use Enzyme to test ContributionList dynamics (#102) 2018-03-21 17:35:17 -07:00
.flowconfig Move package json to root (#37) 2018-02-26 22:32:23 -08:00
.gitignore Configure Webpack for backend applications (#84) 2018-03-18 22:43:23 -07:00
.prettierignore Don't run prettify on build (#92) 2018-03-20 11:46:30 -07:00
.prettierrc.json Move package json to root (#37) 2018-02-26 22:32:23 -08:00
.travis.yml Setup travis CI testing (#58) 2018-03-02 14:39:54 -08:00
LICENSE Add LICENSE 2018-02-03 17:58:49 -08:00
README.md Update README.md 2018-03-06 19:09:46 -08:00
package.json Use Enzyme to test ContributionList dynamics (#102) 2018-03-21 17:35:17 -07:00
yarn.lock Use Enzyme to test ContributionList dynamics (#102) 2018-03-21 17:35:17 -07:00

README.md

SourceCred

Build Status

The open-source community provides an enormous amount of value to the world. However, open-source contributors go largely unrewarded and unrecognized. SourceCred aims to help that situation, by building tools that enable quantitatively measuring the value that open-source contributors provide to individual projects, and to the community as a whole.

SourceCred will create a "Cred Graph", which is a graph that shows how the contributions that compose open-source projects are related to and derive value from each other. From this, we'll be able to assign "cred" to users based on how valuable their contributions are. Cred will be assigned based on a mixture of objective data (e.g. references between GitHub pull requests) and subjective feedback (e.g. projects' own judgments on how important different contributions were).

If you'd like to contribute, please follow along with our issues, as we are using issues to coordinate development and design decisions. We also have a slack.