{"action":"created","comment":{"url":"https://api.github.com/repos/commercetools/ui-kit/pulls/comments/242835579","pull_request_review_id":186439388,"id":242835579,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MjgzNTU3OQ==","diff_hunk":"@@ -18,7 +18,119 @@ These are general and loose rules components in UI Kit should strive to fulfill.\n - Documentation of prop-types and usage patterns\n - Sensible defaults for props which are not a hard requirement\n \n-### How to add a component to UI Kit.\n+## Development\n+\n+### Testing\n+\n+We split our testing in three parts: functionality, visual and the final bundle. We use separate tools for these, and we try to avoid overlap.\n+\n+#### Functionality testing\n+\n+- write tests from a user perspective, not from a dev perspective\n+- we test using `react-testing-library`\n+  - we have `test-utils` as a thin wrapper which sets up the context of tested components\n+  - we avoid `beforeEach` as it leads to test coupling\n+  - an `it` can describe the flow of a user\n+  - it is okay to have many `expect` statements in an `it`\n+  - code comments can help explain the `expect`s better\n+- avoid testing for visuals (classnames or the DOM structure)\n+  - the user does not care about the DOM structure or the classnames themselves\n+  - use visual testing instead (see below)\n+- if mocking is required, try to do it at the level the user interacts with the component\n+  - Examples\n+    - good: mocking network responses\n+    - bad: mocking a fetching component","path":"CONTRIBUTING.md","position":38,"original_position":38,"commit_id":"77570bca34dbcf1f79415c33b4bf9c77629432ed","original_commit_id":"77570bca34dbcf1f79415c33b4bf9c77629432ed","user":{"login":"montezume","id":2425013,"node_id":"MDQ6VXNlcjI0MjUwMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/2425013?v=4","gravatar_id":"","url":"https://api.github.com/users/montezume","html_url":"https://github.com/montezume","followers_url":"https://api.github.com/users/montezume/followers","following_url":"https://api.github.com/users/montezume/following{/other_user}","gists_url":"https://api.github.com/users/montezume/gists{/gist_id}","starred_url":"https://api.github.com/users/montezume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/montezume/subscriptions","organizations_url":"https://api.github.com/users/montezume/orgs","repos_url":"https://api.github.com/users/montezume/repos","events_url":"https://api.github.com/users/montezume/events{/privacy}","received_events_url":"https://api.github.com/users/montezume/received_events","type":"User","site_admin":false},"body":"maybe we can give a more relevant example to UI Kit, since it's unlikely we will ever have network requests in the lib itself 🤔  ","created_at":"2018-12-19T09:00:35Z","updated_at":"2018-12-19T09:03:28Z","html_url":"https://github.com/commercetools/ui-kit/pull/350#discussion_r242835579","pull_request_url":"https://api.github.com/repos/commercetools/ui-kit/pulls/350","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/commercetools/ui-kit/pulls/comments/242835579"},"html":{"href":"https://github.com/commercetools/ui-kit/pull/350#discussion_r242835579"},"pull_request":{"href":"https://api.github.com/repos/commercetools/ui-kit/pulls/350"}}},"pull_request":{"url":"https://api.github.com/repos/commercetools/ui-kit/pulls/350","id":239669964,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NjY5OTY0","html_url":"https://github.com/commercetools/ui-kit/pull/350","diff_url":"https://github.com/commercetools/ui-kit/pull/350.diff","patch_url":"https://github.com/commercetools/ui-kit/pull/350.patch","issue_url":"https://api.github.com/repos/commercetools/ui-kit/issues/350","number":350,"state":"open","locked":false,"title":"Reorganize README & CONTRIBUTING and add testing docs","user":{"login":"dferber90","id":1765075,"node_id":"MDQ6VXNlcjE3NjUwNzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1765075?v=4","gravatar_id":"","url":"https://api.github.com/users/dferber90","html_url":"https://github.com/dferber90","followers_url":"https://api.github.com/users/dferber90/followers","following_url":"https://api.github.com/users/dferber90/following{/other_user}","gists_url":"https://api.github.com/users/dferber90/gists{/gist_id}","starred_url":"https://api.github.com/users/dferber90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dferber90/subscriptions","organizations_url":"https://api.github.com/users/dferber90/orgs","repos_url":"https://api.github.com/users/dferber90/repos","events_url":"https://api.github.com/users/dferber90/events{/privacy}","received_events_url":"https://api.github.com/users/dferber90/received_events","type":"User","site_admin":false},"body":"This PR reorganises the README by moving less relevant sections out to CONTRIBUTING or collapsing them behind a `details` component. \r\n\r\nThis PR also adds a new [*Testing*  section](https://github.com/commercetools/ui-kit/blob/f247c2ddf48608f04388dd3bbd1e1a3cbb070ed2/CONTRIBUTING.md#testing) which explains the differences between our testing approaches and the decisions made there.\r\n\r\n*I've had this PR sitting for a while but wanted to wait until we've got Visual Regression Testing up and running.*","created_at":"2018-12-18T23:52:14Z","updated_at":"2018-12-19T09:03:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51ec038dbf4278736ed4036d136b95d9e19cf0c9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1045019938,"node_id":"MDU6TGFiZWwxMDQ1MDE5OTM4","url":"https://api.github.com/repos/commercetools/ui-kit/labels/%E2%9C%8D%EF%B8%8F%20Type:%20Documentation","name":"✍️ Type: Documentation","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/commercetools/ui-kit/pulls/350/commits","review_comments_url":"https://api.github.com/repos/commercetools/ui-kit/pulls/350/comments","review_comment_url":"https://api.github.com/repos/commercetools/ui-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercetools/ui-kit/issues/350/comments","statuses_url":"https://api.github.com/repos/commercetools/ui-kit/statuses/77570bca34dbcf1f79415c33b4bf9c77629432ed","head":{"label":"commercetools:df-add-testing-docs","ref":"df-add-testing-docs","sha":"77570bca34dbcf1f79415c33b4bf9c77629432ed","user":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":146916092,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY5MTYwOTI=","name":"ui-kit","full_name":"commercetools/ui-kit","private":false,"owner":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/commercetools/ui-kit","description":"Component library 💅","fork":false,"url":"https://api.github.com/repos/commercetools/ui-kit","forks_url":"https://api.github.com/repos/commercetools/ui-kit/forks","keys_url":"https://api.github.com/repos/commercetools/ui-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/ui-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/ui-kit/teams","hooks_url":"https://api.github.com/repos/commercetools/ui-kit/hooks","issue_events_url":"https://api.github.com/repos/commercetools/ui-kit/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/ui-kit/events","assignees_url":"https://api.github.com/repos/commercetools/ui-kit/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/ui-kit/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/ui-kit/tags","blobs_url":"https://api.github.com/repos/commercetools/ui-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/ui-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/ui-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/ui-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/ui-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/ui-kit/languages","stargazers_url":"https://api.github.com/repos/commercetools/ui-kit/stargazers","contributors_url":"https://api.github.com/repos/commercetools/ui-kit/contributors","subscribers_url":"https://api.github.com/repos/commercetools/ui-kit/subscribers","subscription_url":"https://api.github.com/repos/commercetools/ui-kit/subscription","commits_url":"https://api.github.com/repos/commercetools/ui-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/ui-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/ui-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/ui-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/ui-kit/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/ui-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/ui-kit/merges","archive_url":"https://api.github.com/repos/commercetools/ui-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/ui-kit/downloads","issues_url":"https://api.github.com/repos/commercetools/ui-kit/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/ui-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/ui-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/ui-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/ui-kit/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/ui-kit/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/ui-kit/deployments","created_at":"2018-08-31T16:20:21Z","updated_at":"2018-12-19T00:02:14Z","pushed_at":"2018-12-19T08:24:57Z","git_url":"git://github.com/commercetools/ui-kit.git","ssh_url":"git@github.com:commercetools/ui-kit.git","clone_url":"https://github.com/commercetools/ui-kit.git","svn_url":"https://github.com/commercetools/ui-kit","homepage":"https://uikit.commercetools.com","size":3924,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":23,"watchers":7,"default_branch":"master"}},"base":{"label":"commercetools:master","ref":"master","sha":"95fe46dd68530821097b8e30e5b2f826f208de6c","user":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":146916092,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY5MTYwOTI=","name":"ui-kit","full_name":"commercetools/ui-kit","private":false,"owner":{"login":"commercetools","id":1084585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwODQ1ODU=","avatar_url":"https://avatars3.githubusercontent.com/u/1084585?v=4","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/commercetools/ui-kit","description":"Component library 💅","fork":false,"url":"https://api.github.com/repos/commercetools/ui-kit","forks_url":"https://api.github.com/repos/commercetools/ui-kit/forks","keys_url":"https://api.github.com/repos/commercetools/ui-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/ui-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/ui-kit/teams","hooks_url":"https://api.github.com/repos/commercetools/ui-kit/hooks","issue_events_url":"https://api.github.com/repos/commercetools/ui-kit/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/ui-kit/events","assignees_url":"https://api.github.com/repos/commercetools/ui-kit/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/ui-kit/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/ui-kit/tags","blobs_url":"https://api.github.com/repos/commercetools/ui-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/ui-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/ui-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/ui-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/ui-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/ui-kit/languages","stargazers_url":"https://api.github.com/repos/commercetools/ui-kit/stargazers","contributors_url":"https://api.github.com/repos/commercetools/ui-kit/contributors","subscribers_url":"https://api.github.com/repos/commercetools/ui-kit/subscribers","subscription_url":"https://api.github.com/repos/commercetools/ui-kit/subscription","commits_url":"https://api.github.com/repos/commercetools/ui-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/ui-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/ui-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/ui-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/ui-kit/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/ui-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/ui-kit/merges","archive_url":"https://api.github.com/repos/commercetools/ui-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/ui-kit/downloads","issues_url":"https://api.github.com/repos/commercetools/ui-kit/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/ui-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/ui-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/ui-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/ui-kit/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/ui-kit/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/ui-kit/deployments","created_at":"2018-08-31T16:20:21Z","updated_at":"2018-12-19T00:02:14Z","pushed_at":"2018-12-19T08:24:57Z","git_url":"git://github.com/commercetools/ui-kit.git","ssh_url":"git@github.com:commercetools/ui-kit.git","clone_url":"https://github.com/commercetools/ui-kit.git","svn_url":"https://github.com/commercetools/ui-kit","homepage":"https://uikit.commercetools.com","size":3924,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":23,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercetools/ui-kit/pulls/350"},"html":{"href":"https://github.com/commercetools/ui-kit/pull/350"},"issue":{"href":"https://api.github.com/repos/commercetools/ui-kit/issues/350"},"comments":{"href":"https://api.github.com/repos/commercetools/ui-kit/issues/350/comments"},"review_comments":{"href":"https://api.github.com/repos/commercetools/ui-kit/pulls/350/comments"},"review_comment":{"href":"https://api.github.com/repos/commercetools/ui-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercetools/ui-kit/pulls/350/commits"},"statuses":{"href":"https://api.github.com/repos/commercetools/ui-kit/statuses/77570bca34dbcf1f79415c33b4bf9c77629432ed"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"montezume"}}