{"action":"created","comment":{"url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/comments/306940442","pull_request_review_id":266183723,"id":306940442,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMwNjk0MDQ0Mg==","diff_hunk":"@@ -0,0 +1,116 @@\n+import React from \"react\";\n+import { mount } from \"enzyme\";\n+import FollowUnfollow from \"../FollowUnfollowContainer\";\n+import axios from \"axios\";\n+\n+const setUp = props => mount(<FollowUnfollow {...props}></FollowUnfollow>);\n+\n+describe(\"<FollowUnfollow /> renders\", () => {\n+  const handleOnChange = jest.fn();\n+  const props = { handleOnChange: handleOnChange };\n+  jest.spyOn(axios, \"delete\");\n+  jest.spyOn(axios, \"get\");\n+  jest.spyOn(axios, \"post\");\n+  axios.delete.mockImplementation(() => Promise.resolve({}));\n+  const labelCheck = (wrapper, labeltext) => {\n+    expect(wrapper.state(\"label\")).toEqual(labeltext);\n+  };\n+  test(\"Should render without fail\", () => {\n+    const props = {\n+      username: \"testuser\"\n+    };\n+    const response = {\n+      status: 200,\n+      data: {\n+        profile: {\n+          image: \"https://i.imgur.com/My1cRVT.png\",\n+          bio: \"Your Demo lead for the sprint\",\n+          id: 12,\n+          username: \"testUser\",\n+          firstname: \"name\",\n+          following: true,\n+          lastname: \"last\",\n+          email_notifications: true,\n+          in_app_notifications: true,\n+          fullname: \"Martin Mutuma\"\n+        }\n+      }\n+    };\n+    const wrapper = setUp(props);\n+    axios.get.mockImplementation(() => Promise.resolve(response));\n+    expect(wrapper).toBeTruthy();\n+    wrapper\n+      .instance()\n+      .componentDidMount()\n+      .then(() => {\n+        expect(axios.get).toHaveBeenCalled();\n+      });\n+  });\n+  test(\"Should render without fail for following false\", () => {\n+    const props = {\n+      username: \"testuser2\"\n+    };\n+    const axiosRes = {\n+      status: 200,\n+      data: {\n+        profile: {\n+          image: \"https://i.imgur.com/My1cRVT.png\",\n+          bio: \"Test 3 \",\n+          username: \"testUser2\",\n+          firstname: \"namee\",\n+          following: false,\n+          lastname: \"last\"\n+        }\n+      }\n+    };\n+    const wrapper = setUp(props);\n+    axios.get.mockImplementation(() => Promise.resolve(axiosRes));\n+\n+    expect(wrapper).toBeTruthy();\n+    wrapper.instance().componentDidMount();\n+\n+    expect(axios.get).toBeCalled();\n+    axios.post.mockImplementation(() => Promise.resolve({}));\n+    wrapper.instance().handleClick();\n+    expect(axios.post).toBeCalled();\n+    axios.post.mockImplementation(() => Promise.reject({}));\n+    wrapper\n+      .instance()\n+      .handleClick()\n+      .then(() => {\n+        labelCheck(wrapper, \"follow\");\n+      });\n+  });\n+  test(\"Should render without fail for following false\", () => {\n+    const wrapper = setUp(props);\n+\n+    handleOnChange.mockImplementation(username => false);\n+    wrapper.setState({ label: \"following\" });\n+    wrapper","path":"src/containers/FollowUnfollow/__tests__/FollowUnfollowContainer.spec.js","position":89,"original_position":89,"commit_id":"bc1e641936c36d5c066f601cd03a367ff26901d9","original_commit_id":"bc1e641936c36d5c066f601cd03a367ff26901d9","user":{"login":"codeclimate[bot]","id":36754821,"node_id":"MDM6Qm90MzY3NTQ4MjE=","avatar_url":"https://avatars0.githubusercontent.com/in/9403?v=4","gravatar_id":"","url":"https://api.github.com/users/codeclimate%5Bbot%5D","html_url":"https://github.com/apps/codeclimate","followers_url":"https://api.github.com/users/codeclimate%5Bbot%5D/followers","following_url":"https://api.github.com/users/codeclimate%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codeclimate%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codeclimate%5Bbot%5D/repos","events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Similar blocks of code found in 2 locations. Consider refactoring.","created_at":"2019-07-24T17:49:34Z","updated_at":"2019-07-24T17:49:35Z","html_url":"https://github.com/andela/ah-fortem-frontend/pull/31#discussion_r306940442","pull_request_url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/comments/306940442"},"html":{"href":"https://github.com/andela/ah-fortem-frontend/pull/31#discussion_r306940442"},"pull_request":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31","id":300815214,"node_id":"MDExOlB1bGxSZXF1ZXN0MzAwODE1MjE0","html_url":"https://github.com/andela/ah-fortem-frontend/pull/31","diff_url":"https://github.com/andela/ah-fortem-frontend/pull/31.diff","patch_url":"https://github.com/andela/ah-fortem-frontend/pull/31.patch","issue_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/31","number":31,"state":"open","locked":false,"title":"166980315-Users( follow unfollow )-Add follow unfollow functionality","user":{"login":"martinMutuma","id":12586916,"node_id":"MDQ6VXNlcjEyNTg2OTE2","avatar_url":"https://avatars3.githubusercontent.com/u/12586916?v=4","gravatar_id":"","url":"https://api.github.com/users/martinMutuma","html_url":"https://github.com/martinMutuma","followers_url":"https://api.github.com/users/martinMutuma/followers","following_url":"https://api.github.com/users/martinMutuma/following{/other_user}","gists_url":"https://api.github.com/users/martinMutuma/gists{/gist_id}","starred_url":"https://api.github.com/users/martinMutuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinMutuma/subscriptions","organizations_url":"https://api.github.com/users/martinMutuma/orgs","repos_url":"https://api.github.com/users/martinMutuma/repos","events_url":"https://api.github.com/users/martinMutuma/events{/privacy}","received_events_url":"https://api.github.com/users/martinMutuma/received_events","type":"User","site_admin":false},"body":"- Add follow unfollow functionality\r\n- Add Listing for followers and Following\r\n\r\n[starts #166980315]\r\n\r\n#### Title\r\n<!-- A short description of what needs to be done. -->\r\n\r\n#### Description\r\n<!-- Why is it needed? Does it help the team go faster or is it a dependency that could cause problems in the codebase if it’s not done? -->\r\n\r\n<!-- Note: Every story title should include the word ‘should’ as opposed to ‘can’. e.g. It’s unclear whether the story “User can delete comment” is a feature or a bug. “User should be able to delete comment” or “User should not be able to delete comment” are much clearer: the former is a feature, the latter a bug. -->\r\n\r\n\r\n#### Type of change\r\n\r\n- [ ] Bug fix (non-breaking change which fixes an issue) \r\n\r\n- [ ] New feature (non-breaking change which adds functionality) \r\n\r\n\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) \r\n\r\n\r\n- [ ] This change requires a documentation update\r\n\r\n\r\n#### How Has This Been Tested?\r\n\r\n#### Acceptance Criteria: \r\n<!-- THis section is applicable to tasks -->\r\n<!-- These should include conditions that must be met for the chore to be accepted. -->\r\n\r\n#### Checklist:\r\n\r\n\r\n#### PT stories\r\n[#storyid](https://www.pivotaltracker.com/story/show/<pt:storyid>)","created_at":"2019-07-24T17:05:50Z","updated_at":"2019-07-24T17:49:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b2cd7e60604b1f1c71db57cd3a4beb367a8b174c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1432186419,"node_id":"MDU6TGFiZWwxNDMyMTg2NDE5","url":"https://api.github.com/repos/andela/ah-fortem-frontend/labels/%F0%9F%9A%A7%20Work%20In%20Progress","name":"🚧 Work In Progress","color":"f7ec20","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31/commits","review_comments_url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31/comments","review_comment_url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/31/comments","statuses_url":"https://api.github.com/repos/andela/ah-fortem-frontend/statuses/bc1e641936c36d5c066f601cd03a367ff26901d9","head":{"label":"andela:story/166980315-users-follow-unfollow","ref":"story/166980315-users-follow-unfollow","sha":"bc1e641936c36d5c066f601cd03a367ff26901d9","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":194281296,"node_id":"MDEwOlJlcG9zaXRvcnkxOTQyODEyOTY=","name":"ah-fortem-frontend","full_name":"andela/ah-fortem-frontend","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/ah-fortem-frontend","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-fortem-frontend","forks_url":"https://api.github.com/repos/andela/ah-fortem-frontend/forks","keys_url":"https://api.github.com/repos/andela/ah-fortem-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-fortem-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-fortem-frontend/teams","hooks_url":"https://api.github.com/repos/andela/ah-fortem-frontend/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-fortem-frontend/events","assignees_url":"https://api.github.com/repos/andela/ah-fortem-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-fortem-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-fortem-frontend/tags","blobs_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-fortem-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-fortem-frontend/languages","stargazers_url":"https://api.github.com/repos/andela/ah-fortem-frontend/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-fortem-frontend/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-fortem-frontend/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-fortem-frontend/subscription","commits_url":"https://api.github.com/repos/andela/ah-fortem-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-fortem-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-fortem-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-fortem-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-fortem-frontend/merges","archive_url":"https://api.github.com/repos/andela/ah-fortem-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-fortem-frontend/downloads","issues_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-fortem-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-fortem-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-fortem-frontend/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-fortem-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-fortem-frontend/deployments","created_at":"2019-06-28T13:49:08Z","updated_at":"2019-07-19T07:20:35Z","pushed_at":"2019-07-24T17:49:03Z","git_url":"git://github.com/andela/ah-fortem-frontend.git","ssh_url":"git@github.com:andela/ah-fortem-frontend.git","clone_url":"https://github.com/andela/ah-fortem-frontend.git","svn_url":"https://github.com/andela/ah-fortem-frontend","homepage":null,"size":644,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"1bccdd24b5a4e796e3681ee3314105f85b604276","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":194281296,"node_id":"MDEwOlJlcG9zaXRvcnkxOTQyODEyOTY=","name":"ah-fortem-frontend","full_name":"andela/ah-fortem-frontend","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/ah-fortem-frontend","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-fortem-frontend","forks_url":"https://api.github.com/repos/andela/ah-fortem-frontend/forks","keys_url":"https://api.github.com/repos/andela/ah-fortem-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-fortem-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-fortem-frontend/teams","hooks_url":"https://api.github.com/repos/andela/ah-fortem-frontend/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-fortem-frontend/events","assignees_url":"https://api.github.com/repos/andela/ah-fortem-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-fortem-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-fortem-frontend/tags","blobs_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-fortem-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-fortem-frontend/languages","stargazers_url":"https://api.github.com/repos/andela/ah-fortem-frontend/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-fortem-frontend/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-fortem-frontend/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-fortem-frontend/subscription","commits_url":"https://api.github.com/repos/andela/ah-fortem-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-fortem-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-fortem-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-fortem-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-fortem-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-fortem-frontend/merges","archive_url":"https://api.github.com/repos/andela/ah-fortem-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-fortem-frontend/downloads","issues_url":"https://api.github.com/repos/andela/ah-fortem-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-fortem-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-fortem-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-fortem-frontend/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-fortem-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-fortem-frontend/deployments","created_at":"2019-06-28T13:49:08Z","updated_at":"2019-07-19T07:20:35Z","pushed_at":"2019-07-24T17:49:03Z","git_url":"git://github.com/andela/ah-fortem-frontend.git","ssh_url":"git@github.com:andela/ah-fortem-frontend.git","clone_url":"https://github.com/andela/ah-fortem-frontend.git","svn_url":"https://github.com/andela/ah-fortem-frontend","homepage":null,"size":644,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31"},"html":{"href":"https://github.com/andela/ah-fortem-frontend/pull/31"},"issue":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/31"},"comments":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/andela/ah-fortem-frontend/statuses/bc1e641936c36d5c066f601cd03a367ff26901d9"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"codeclimate"}}