{"action":"created","comment":{"url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/comments/197024806","pull_request_review_id":130681268,"id":197024806,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzAyNDgwNg==","diff_hunk":"@@ -68,4 +68,20 @@ describe('card api', () => {\n \n     cardApi.listCards();\n   });\n+\n+  it('should ensure that fetch pin is called correctly', done => {\n+    const cardId = 'abcd';\n+    const securityCode = 123;\n+\n+    mockHttp.get = jest.fn((url, params) => {\n+      expect(params.securityCode).toBe(securityCode);\n+      expect(url).toBe(`sample-api-url/v1/cards/${cardId}/pin`);\n+","path":"src/card/cardApi.spec.js","position":12,"original_position":12,"commit_id":"52c0a1cffe48edd47347a9133f92cc85f45f61ac","original_commit_id":"52c0a1cffe48edd47347a9133f92cc85f45f61ac","user":{"login":"ErkoRisthein","id":294801,"node_id":"MDQ6VXNlcjI5NDgwMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/294801?v=4","gravatar_id":"","url":"https://api.github.com/users/ErkoRisthein","html_url":"https://github.com/ErkoRisthein","followers_url":"https://api.github.com/users/ErkoRisthein/followers","following_url":"https://api.github.com/users/ErkoRisthein/following{/other_user}","gists_url":"https://api.github.com/users/ErkoRisthein/gists{/gist_id}","starred_url":"https://api.github.com/users/ErkoRisthein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErkoRisthein/subscriptions","organizations_url":"https://api.github.com/users/ErkoRisthein/orgs","repos_url":"https://api.github.com/users/ErkoRisthein/repos","events_url":"https://api.github.com/users/ErkoRisthein/events{/privacy}","received_events_url":"https://api.github.com/users/ErkoRisthein/received_events","type":"User","site_admin":false},"body":"Why is it good to have the assertions inside of the mock implementation?\r\nI usually try to follow the `given-when-then` pattern (or `arrange-act-assert`).\r\n```javascript\r\n// given\r\nconst cardId = 'abcd';\r\nconst securityCode = 123;\r\nconst pin = { pin: '1234' };\r\nmockHttp.get = jest.fn().mockImplementationOnce(() => Promise.resolve(pin));\r\n\r\nreturn cardApi.fetchPin(cardId, securityCode) // when\r\n.then(response => expect(response).toMatchObject(pin)); // then\r\n```","created_at":"2018-06-21T06:38:46Z","updated_at":"2018-06-21T06:53:15Z","html_url":"https://github.com/ChangeFinance/wallet-client/pull/204#discussion_r197024806","pull_request_url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/comments/197024806"},"html":{"href":"https://github.com/ChangeFinance/wallet-client/pull/204#discussion_r197024806"},"pull_request":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204"}}},"pull_request":{"url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204","id":196147651,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MTQ3NjUx","html_url":"https://github.com/ChangeFinance/wallet-client/pull/204","diff_url":"https://github.com/ChangeFinance/wallet-client/pull/204.diff","patch_url":"https://github.com/ChangeFinance/wallet-client/pull/204.patch","issue_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/204","number":204,"state":"open","locked":false,"title":"Show PIN screen","user":{"login":"jayrmotta","id":349948,"node_id":"MDQ6VXNlcjM0OTk0OA==","avatar_url":"https://avatars3.githubusercontent.com/u/349948?v=4","gravatar_id":"","url":"https://api.github.com/users/jayrmotta","html_url":"https://github.com/jayrmotta","followers_url":"https://api.github.com/users/jayrmotta/followers","following_url":"https://api.github.com/users/jayrmotta/following{/other_user}","gists_url":"https://api.github.com/users/jayrmotta/gists{/gist_id}","starred_url":"https://api.github.com/users/jayrmotta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayrmotta/subscriptions","organizations_url":"https://api.github.com/users/jayrmotta/orgs","repos_url":"https://api.github.com/users/jayrmotta/repos","events_url":"https://api.github.com/users/jayrmotta/events{/privacy}","received_events_url":"https://api.github.com/users/jayrmotta/received_events","type":"User","site_admin":false},"body":"This pull request introduces a flow to show users it's card PIN given the security code.\r\n","created_at":"2018-06-20T13:52:02Z","updated_at":"2018-06-21T06:53:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06178a993a4256b9c81bb10c9656564396eba39c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ttalviste","id":1064425,"node_id":"MDQ6VXNlcjEwNjQ0MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1064425?v=4","gravatar_id":"","url":"https://api.github.com/users/ttalviste","html_url":"https://github.com/ttalviste","followers_url":"https://api.github.com/users/ttalviste/followers","following_url":"https://api.github.com/users/ttalviste/following{/other_user}","gists_url":"https://api.github.com/users/ttalviste/gists{/gist_id}","starred_url":"https://api.github.com/users/ttalviste/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttalviste/subscriptions","organizations_url":"https://api.github.com/users/ttalviste/orgs","repos_url":"https://api.github.com/users/ttalviste/repos","events_url":"https://api.github.com/users/ttalviste/events{/privacy}","received_events_url":"https://api.github.com/users/ttalviste/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204/commits","review_comments_url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204/comments","review_comment_url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/204/comments","statuses_url":"https://api.github.com/repos/ChangeFinance/wallet-client/statuses/52c0a1cffe48edd47347a9133f92cc85f45f61ac","head":{"label":"ChangeFinance:feature/show-pin-screen","ref":"feature/show-pin-screen","sha":"52c0a1cffe48edd47347a9133f92cc85f45f61ac","user":{"login":"ChangeFinance","id":32612037,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjEyMDM3","avatar_url":"https://avatars2.githubusercontent.com/u/32612037?v=4","gravatar_id":"","url":"https://api.github.com/users/ChangeFinance","html_url":"https://github.com/ChangeFinance","followers_url":"https://api.github.com/users/ChangeFinance/followers","following_url":"https://api.github.com/users/ChangeFinance/following{/other_user}","gists_url":"https://api.github.com/users/ChangeFinance/gists{/gist_id}","starred_url":"https://api.github.com/users/ChangeFinance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChangeFinance/subscriptions","organizations_url":"https://api.github.com/users/ChangeFinance/orgs","repos_url":"https://api.github.com/users/ChangeFinance/repos","events_url":"https://api.github.com/users/ChangeFinance/events{/privacy}","received_events_url":"https://api.github.com/users/ChangeFinance/received_events","type":"Organization","site_admin":false},"repo":{"id":106168733,"node_id":"MDEwOlJlcG9zaXRvcnkxMDYxNjg3MzM=","name":"wallet-client","full_name":"ChangeFinance/wallet-client","owner":{"login":"ChangeFinance","id":32612037,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjEyMDM3","avatar_url":"https://avatars2.githubusercontent.com/u/32612037?v=4","gravatar_id":"","url":"https://api.github.com/users/ChangeFinance","html_url":"https://github.com/ChangeFinance","followers_url":"https://api.github.com/users/ChangeFinance/followers","following_url":"https://api.github.com/users/ChangeFinance/following{/other_user}","gists_url":"https://api.github.com/users/ChangeFinance/gists{/gist_id}","starred_url":"https://api.github.com/users/ChangeFinance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChangeFinance/subscriptions","organizations_url":"https://api.github.com/users/ChangeFinance/orgs","repos_url":"https://api.github.com/users/ChangeFinance/repos","events_url":"https://api.github.com/users/ChangeFinance/events{/privacy}","received_events_url":"https://api.github.com/users/ChangeFinance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ChangeFinance/wallet-client","description":null,"fork":false,"url":"https://api.github.com/repos/ChangeFinance/wallet-client","forks_url":"https://api.github.com/repos/ChangeFinance/wallet-client/forks","keys_url":"https://api.github.com/repos/ChangeFinance/wallet-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChangeFinance/wallet-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChangeFinance/wallet-client/teams","hooks_url":"https://api.github.com/repos/ChangeFinance/wallet-client/hooks","issue_events_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/events{/number}","events_url":"https://api.github.com/repos/ChangeFinance/wallet-client/events","assignees_url":"https://api.github.com/repos/ChangeFinance/wallet-client/assignees{/user}","branches_url":"https://api.github.com/repos/ChangeFinance/wallet-client/branches{/branch}","tags_url":"https://api.github.com/repos/ChangeFinance/wallet-client/tags","blobs_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChangeFinance/wallet-client/statuses/{sha}","languages_url":"https://api.github.com/repos/ChangeFinance/wallet-client/languages","stargazers_url":"https://api.github.com/repos/ChangeFinance/wallet-client/stargazers","contributors_url":"https://api.github.com/repos/ChangeFinance/wallet-client/contributors","subscribers_url":"https://api.github.com/repos/ChangeFinance/wallet-client/subscribers","subscription_url":"https://api.github.com/repos/ChangeFinance/wallet-client/subscription","commits_url":"https://api.github.com/repos/ChangeFinance/wallet-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChangeFinance/wallet-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChangeFinance/wallet-client/contents/{+path}","compare_url":"https://api.github.com/repos/ChangeFinance/wallet-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChangeFinance/wallet-client/merges","archive_url":"https://api.github.com/repos/ChangeFinance/wallet-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChangeFinance/wallet-client/downloads","issues_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues{/number}","pulls_url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls{/number}","milestones_url":"https://api.github.com/repos/ChangeFinance/wallet-client/milestones{/number}","notifications_url":"https://api.github.com/repos/ChangeFinance/wallet-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChangeFinance/wallet-client/labels{/name}","releases_url":"https://api.github.com/repos/ChangeFinance/wallet-client/releases{/id}","deployments_url":"https://api.github.com/repos/ChangeFinance/wallet-client/deployments","created_at":"2017-10-08T10:46:39Z","updated_at":"2018-06-21T06:17:32Z","pushed_at":"2018-06-21T06:17:29Z","git_url":"git://github.com/ChangeFinance/wallet-client.git","ssh_url":"git@github.com:ChangeFinance/wallet-client.git","clone_url":"https://github.com/ChangeFinance/wallet-client.git","svn_url":"https://github.com/ChangeFinance/wallet-client","homepage":"https://app.getchange.com","size":80799,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":4,"open_issues":6,"watchers":6,"default_branch":"master"}},"base":{"label":"ChangeFinance:master","ref":"master","sha":"dc3d6b451c6c6b233f61f843fe040a2e3e200a68","user":{"login":"ChangeFinance","id":32612037,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjEyMDM3","avatar_url":"https://avatars2.githubusercontent.com/u/32612037?v=4","gravatar_id":"","url":"https://api.github.com/users/ChangeFinance","html_url":"https://github.com/ChangeFinance","followers_url":"https://api.github.com/users/ChangeFinance/followers","following_url":"https://api.github.com/users/ChangeFinance/following{/other_user}","gists_url":"https://api.github.com/users/ChangeFinance/gists{/gist_id}","starred_url":"https://api.github.com/users/ChangeFinance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChangeFinance/subscriptions","organizations_url":"https://api.github.com/users/ChangeFinance/orgs","repos_url":"https://api.github.com/users/ChangeFinance/repos","events_url":"https://api.github.com/users/ChangeFinance/events{/privacy}","received_events_url":"https://api.github.com/users/ChangeFinance/received_events","type":"Organization","site_admin":false},"repo":{"id":106168733,"node_id":"MDEwOlJlcG9zaXRvcnkxMDYxNjg3MzM=","name":"wallet-client","full_name":"ChangeFinance/wallet-client","owner":{"login":"ChangeFinance","id":32612037,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyNjEyMDM3","avatar_url":"https://avatars2.githubusercontent.com/u/32612037?v=4","gravatar_id":"","url":"https://api.github.com/users/ChangeFinance","html_url":"https://github.com/ChangeFinance","followers_url":"https://api.github.com/users/ChangeFinance/followers","following_url":"https://api.github.com/users/ChangeFinance/following{/other_user}","gists_url":"https://api.github.com/users/ChangeFinance/gists{/gist_id}","starred_url":"https://api.github.com/users/ChangeFinance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChangeFinance/subscriptions","organizations_url":"https://api.github.com/users/ChangeFinance/orgs","repos_url":"https://api.github.com/users/ChangeFinance/repos","events_url":"https://api.github.com/users/ChangeFinance/events{/privacy}","received_events_url":"https://api.github.com/users/ChangeFinance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ChangeFinance/wallet-client","description":null,"fork":false,"url":"https://api.github.com/repos/ChangeFinance/wallet-client","forks_url":"https://api.github.com/repos/ChangeFinance/wallet-client/forks","keys_url":"https://api.github.com/repos/ChangeFinance/wallet-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChangeFinance/wallet-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChangeFinance/wallet-client/teams","hooks_url":"https://api.github.com/repos/ChangeFinance/wallet-client/hooks","issue_events_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/events{/number}","events_url":"https://api.github.com/repos/ChangeFinance/wallet-client/events","assignees_url":"https://api.github.com/repos/ChangeFinance/wallet-client/assignees{/user}","branches_url":"https://api.github.com/repos/ChangeFinance/wallet-client/branches{/branch}","tags_url":"https://api.github.com/repos/ChangeFinance/wallet-client/tags","blobs_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChangeFinance/wallet-client/statuses/{sha}","languages_url":"https://api.github.com/repos/ChangeFinance/wallet-client/languages","stargazers_url":"https://api.github.com/repos/ChangeFinance/wallet-client/stargazers","contributors_url":"https://api.github.com/repos/ChangeFinance/wallet-client/contributors","subscribers_url":"https://api.github.com/repos/ChangeFinance/wallet-client/subscribers","subscription_url":"https://api.github.com/repos/ChangeFinance/wallet-client/subscription","commits_url":"https://api.github.com/repos/ChangeFinance/wallet-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChangeFinance/wallet-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChangeFinance/wallet-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChangeFinance/wallet-client/contents/{+path}","compare_url":"https://api.github.com/repos/ChangeFinance/wallet-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChangeFinance/wallet-client/merges","archive_url":"https://api.github.com/repos/ChangeFinance/wallet-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChangeFinance/wallet-client/downloads","issues_url":"https://api.github.com/repos/ChangeFinance/wallet-client/issues{/number}","pulls_url":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls{/number}","milestones_url":"https://api.github.com/repos/ChangeFinance/wallet-client/milestones{/number}","notifications_url":"https://api.github.com/repos/ChangeFinance/wallet-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChangeFinance/wallet-client/labels{/name}","releases_url":"https://api.github.com/repos/ChangeFinance/wallet-client/releases{/id}","deployments_url":"https://api.github.com/repos/ChangeFinance/wallet-client/deployments","created_at":"2017-10-08T10:46:39Z","updated_at":"2018-06-21T06:17:32Z","pushed_at":"2018-06-21T06:17:29Z","git_url":"git://github.com/ChangeFinance/wallet-client.git","ssh_url":"git@github.com:ChangeFinance/wallet-client.git","clone_url":"https://github.com/ChangeFinance/wallet-client.git","svn_url":"https://github.com/ChangeFinance/wallet-client","homepage":"https://app.getchange.com","size":80799,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":4,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204"},"html":{"href":"https://github.com/ChangeFinance/wallet-client/pull/204"},"issue":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/204"},"comments":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/issues/204/comments"},"review_comments":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204/comments"},"review_comment":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/pulls/204/commits"},"statuses":{"href":"https://api.github.com/repos/ChangeFinance/wallet-client/statuses/52c0a1cffe48edd47347a9133f92cc85f45f61ac"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ErkoRisthein"}}