{"action":"created","comment":{"url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/comments/233876267","pull_request_review_id":175390639,"id":233876267,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzg3NjI2Nw==","diff_hunk":"@@ -0,0 +1,89 @@\n+import thunk from 'redux-thunk';\n+import fetchMock from 'fetch-mock';\n+import configureStore from 'redux-mock-store';\n+import {\n+    likeArticle,\n+    dislikeArticle\n+} from '../actions/ArticleAction';\n+import {\n+  ARTICLE_LIKED,\n+  ARTICLE_DISLIKED,\n+} from '../actions/ActionTypes';\n+ \n+ \n+const baseurl = 'https://ah-backend-stark-staging.herokuapp.com';\n+let store;\n+ \n+const mockStore = configureStore([thunk]);\n+ \n+describe('async like actions', () => {\n+  beforeEach(() => {\n+    store = mockStore({\n+      articles: [],\n+      article: [],\n+      like: [],\n+      errors: [],\n+    });\n+  });\n+ \n+  afterEach(() => {\n+    fetchMock.reset();\n+    fetchMock.restore();\n+  });\n+ \n+  it('creates ARTICLE_LIKED when a user likes an article', () => {\n+    const articleData = {\n+      like: {\n+        action: 1,\n+      },\n+    };\n+ \n+    const responseData = {\n+      status: 400,\n+      errors: ['cannot updatelike or dislike article'],\n+    };\n+    const successData = {\n+      status: {\n+        username: 'testuser', action: true, article: 'testarticle',\n+      },\n+    };\n+    fetchMock.put(`${baseurl}/api/articles/testarticle/like/`, responseData);\n+ \n+    const expectedActions = [{\n+      type: ARTICLE_LIKED,\n+      payload: successData,\n+    }];\n+    const slug = 'testarticle';\n+    store.dispatch(likeArticle(articleData, slug)).then(() => {\n+      expect(store.getActions()).toEqual(expectedActions);\n+    });\n+  });\n+ ","path":"src/tests/LikeAction.test.js","position":61,"original_position":61,"commit_id":"848eb52c8c8fa508c680191068483ebdd71d6b50","original_commit_id":"848eb52c8c8fa508c680191068483ebdd71d6b50","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Trailing spaces not allowed                    no-trailing-spaces","created_at":"2018-11-15T15:00:13Z","updated_at":"2018-11-15T15:00:13Z","html_url":"https://github.com/andela/ah-frontend-stark/pull/18#discussion_r233876267","pull_request_url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/comments/233876267"},"html":{"href":"https://github.com/andela/ah-frontend-stark/pull/18#discussion_r233876267"},"pull_request":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18","id":231224401,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMjI0NDAx","html_url":"https://github.com/andela/ah-frontend-stark/pull/18","diff_url":"https://github.com/andela/ah-frontend-stark/pull/18.diff","patch_url":"https://github.com/andela/ah-frontend-stark/pull/18.patch","issue_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues/18","number":18,"state":"open","locked":false,"title":"#160583967 - users should be able to like/dislike an article","user":{"login":"balaakagordon","id":40589388,"node_id":"MDQ6VXNlcjQwNTg5Mzg4","avatar_url":"https://avatars1.githubusercontent.com/u/40589388?v=4","gravatar_id":"","url":"https://api.github.com/users/balaakagordon","html_url":"https://github.com/balaakagordon","followers_url":"https://api.github.com/users/balaakagordon/followers","following_url":"https://api.github.com/users/balaakagordon/following{/other_user}","gists_url":"https://api.github.com/users/balaakagordon/gists{/gist_id}","starred_url":"https://api.github.com/users/balaakagordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balaakagordon/subscriptions","organizations_url":"https://api.github.com/users/balaakagordon/orgs","repos_url":"https://api.github.com/users/balaakagordon/repos","events_url":"https://api.github.com/users/balaakagordon/events{/privacy}","received_events_url":"https://api.github.com/users/balaakagordon/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nEnables users to react to an article\r\n#### Description of Task to be completed?\r\nHave like and dislike buttons working, and update the article data\r\n#### How should this be manually tested?\r\nAfter pulling the branch locally, run:\r\n- $`yarn install` to install any missing packages\r\nTest the app in the browser by running:\r\n- $`yarn start`\r\nLogin with the following credentials:\r\n    - email: balaakagordon@gmail.com\r\n    - password: Password1\r\nFollow the \"Create Article\" link and create an article\r\nClick on the \"thumbs-up\" or the \"thumbs-down\"\r\n#### What are the relevant pivotal tracker stories?\r\n[#160583967](https://www.pivotaltracker.com/story/show/160583967)\r\n#### Screenshots\r\n![image](https://user-images.githubusercontent.com/40589388/48561045-313aa980-e900-11e8-89f2-9ff87f328a42.png)\r\n![image](https://user-images.githubusercontent.com/40589388/48561051-34359a00-e900-11e8-9520-5dfdd351483d.png)\r\n","created_at":"2018-11-15T14:59:50Z","updated_at":"2018-11-15T15:00:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18/commits","review_comments_url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18/comments","review_comment_url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues/18/comments","statuses_url":"https://api.github.com/repos/andela/ah-frontend-stark/statuses/848eb52c8c8fa508c680191068483ebdd71d6b50","head":{"label":"andela:ft-like-articles-160583967","ref":"ft-like-articles-160583967","sha":"848eb52c8c8fa508c680191068483ebdd71d6b50","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":154833539,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ4MzM1Mzk=","name":"ah-frontend-stark","full_name":"andela/ah-frontend-stark","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-frontend-stark","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-frontend-stark","forks_url":"https://api.github.com/repos/andela/ah-frontend-stark/forks","keys_url":"https://api.github.com/repos/andela/ah-frontend-stark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-frontend-stark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-frontend-stark/teams","hooks_url":"https://api.github.com/repos/andela/ah-frontend-stark/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-frontend-stark/events","assignees_url":"https://api.github.com/repos/andela/ah-frontend-stark/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-frontend-stark/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-frontend-stark/tags","blobs_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-frontend-stark/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-frontend-stark/languages","stargazers_url":"https://api.github.com/repos/andela/ah-frontend-stark/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-frontend-stark/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-frontend-stark/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-frontend-stark/subscription","commits_url":"https://api.github.com/repos/andela/ah-frontend-stark/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-frontend-stark/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-frontend-stark/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-frontend-stark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-frontend-stark/merges","archive_url":"https://api.github.com/repos/andela/ah-frontend-stark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-frontend-stark/downloads","issues_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-frontend-stark/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-frontend-stark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-frontend-stark/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-frontend-stark/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-frontend-stark/deployments","created_at":"2018-10-26T12:46:29Z","updated_at":"2018-11-15T14:55:26Z","pushed_at":"2018-11-15T14:59:50Z","git_url":"git://github.com/andela/ah-frontend-stark.git","ssh_url":"git@github.com:andela/ah-frontend-stark.git","clone_url":"https://github.com/andela/ah-frontend-stark.git","svn_url":"https://github.com/andela/ah-frontend-stark","homepage":null,"size":1452,"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,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"fee0c2427bde415977b85a98c011afa813a0696d","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":154833539,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ4MzM1Mzk=","name":"ah-frontend-stark","full_name":"andela/ah-frontend-stark","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-frontend-stark","description":null,"fork":false,"url":"https://api.github.com/repos/andela/ah-frontend-stark","forks_url":"https://api.github.com/repos/andela/ah-frontend-stark/forks","keys_url":"https://api.github.com/repos/andela/ah-frontend-stark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/ah-frontend-stark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/ah-frontend-stark/teams","hooks_url":"https://api.github.com/repos/andela/ah-frontend-stark/hooks","issue_events_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues/events{/number}","events_url":"https://api.github.com/repos/andela/ah-frontend-stark/events","assignees_url":"https://api.github.com/repos/andela/ah-frontend-stark/assignees{/user}","branches_url":"https://api.github.com/repos/andela/ah-frontend-stark/branches{/branch}","tags_url":"https://api.github.com/repos/andela/ah-frontend-stark/tags","blobs_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/ah-frontend-stark/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/ah-frontend-stark/languages","stargazers_url":"https://api.github.com/repos/andela/ah-frontend-stark/stargazers","contributors_url":"https://api.github.com/repos/andela/ah-frontend-stark/contributors","subscribers_url":"https://api.github.com/repos/andela/ah-frontend-stark/subscribers","subscription_url":"https://api.github.com/repos/andela/ah-frontend-stark/subscription","commits_url":"https://api.github.com/repos/andela/ah-frontend-stark/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/ah-frontend-stark/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/ah-frontend-stark/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/ah-frontend-stark/contents/{+path}","compare_url":"https://api.github.com/repos/andela/ah-frontend-stark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/ah-frontend-stark/merges","archive_url":"https://api.github.com/repos/andela/ah-frontend-stark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/ah-frontend-stark/downloads","issues_url":"https://api.github.com/repos/andela/ah-frontend-stark/issues{/number}","pulls_url":"https://api.github.com/repos/andela/ah-frontend-stark/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/ah-frontend-stark/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/ah-frontend-stark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/ah-frontend-stark/labels{/name}","releases_url":"https://api.github.com/repos/andela/ah-frontend-stark/releases{/id}","deployments_url":"https://api.github.com/repos/andela/ah-frontend-stark/deployments","created_at":"2018-10-26T12:46:29Z","updated_at":"2018-11-15T14:55:26Z","pushed_at":"2018-11-15T14:59:50Z","git_url":"git://github.com/andela/ah-frontend-stark.git","ssh_url":"git@github.com:andela/ah-frontend-stark.git","clone_url":"https://github.com/andela/ah-frontend-stark.git","svn_url":"https://github.com/andela/ah-frontend-stark","homepage":null,"size":1452,"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,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18"},"html":{"href":"https://github.com/andela/ah-frontend-stark/pull/18"},"issue":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/issues/18"},"comments":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/andela/ah-frontend-stark/statuses/848eb52c8c8fa508c680191068483ebdd71d6b50"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}