{"action":"created","comment":{"url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/comments/179571634","pull_request_review_id":109841380,"id":179571634,"diff_hunk":"@@ -96,4 +97,17 @@ describe('StopwatchContainer', () => {\n       expect(wrapper.state().counter).not.toBe(0);\n     });\n   });\n+\n+  describe('when unmounted', () => {\n+    it('sets localStorage to 0', () => {\n+      // Arrange\n+      wrapper.setState({ counter: 0 });\n+\n+      // Act\n+      wrapper.instance().componentWillUnmount();\n+\n+      // Assert\n+      expect(wrapper.state().counter).toEqual(0);","path":"src/components/Stopwatch/__tests__/StopwatchContainer.test.js","position":45,"original_position":22,"commit_id":"8ef339483cdc3361db4edaeb4601de19e653fef5","original_commit_id":"8398ba52a32fc5dd1b86f963984a69e70d7140c1","user":{"login":"kaxcode","id":19161242,"avatar_url":"https://avatars3.githubusercontent.com/u/19161242?v=4","gravatar_id":"","url":"https://api.github.com/users/kaxcode","html_url":"https://github.com/kaxcode","followers_url":"https://api.github.com/users/kaxcode/followers","following_url":"https://api.github.com/users/kaxcode/following{/other_user}","gists_url":"https://api.github.com/users/kaxcode/gists{/gist_id}","starred_url":"https://api.github.com/users/kaxcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaxcode/subscriptions","organizations_url":"https://api.github.com/users/kaxcode/orgs","repos_url":"https://api.github.com/users/kaxcode/repos","events_url":"https://api.github.com/users/kaxcode/events{/privacy}","received_events_url":"https://api.github.com/users/kaxcode/received_events","type":"User","site_admin":false},"body":"@dlindahl I don't think I'm explaining this well. I can only use `jest-localstorage-mock` to see that calls to localStorage where made, but I can't configure or setup .`setItem` and `.getItem`.","created_at":"2018-04-05T19:11:50Z","updated_at":"2018-04-05T19:11:50Z","html_url":"https://github.com/kaxcode/cloudwatch/pull/114#discussion_r179571634","pull_request_url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/comments/179571634"},"html":{"href":"https://github.com/kaxcode/cloudwatch/pull/114#discussion_r179571634"},"pull_request":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114"}},"in_reply_to_id":179536922},"pull_request":{"url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114","id":179695825,"html_url":"https://github.com/kaxcode/cloudwatch/pull/114","diff_url":"https://github.com/kaxcode/cloudwatch/pull/114.diff","patch_url":"https://github.com/kaxcode/cloudwatch/pull/114.patch","issue_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues/114","number":114,"state":"open","locked":false,"title":"Close #70. Add localStorage for state retention in Timer and Stopwatch","user":{"login":"kaxcode","id":19161242,"avatar_url":"https://avatars3.githubusercontent.com/u/19161242?v=4","gravatar_id":"","url":"https://api.github.com/users/kaxcode","html_url":"https://github.com/kaxcode","followers_url":"https://api.github.com/users/kaxcode/followers","following_url":"https://api.github.com/users/kaxcode/following{/other_user}","gists_url":"https://api.github.com/users/kaxcode/gists{/gist_id}","starred_url":"https://api.github.com/users/kaxcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaxcode/subscriptions","organizations_url":"https://api.github.com/users/kaxcode/orgs","repos_url":"https://api.github.com/users/kaxcode/repos","events_url":"https://api.github.com/users/kaxcode/events{/privacy}","received_events_url":"https://api.github.com/users/kaxcode/received_events","type":"User","site_admin":false},"body":"- Add logic for state to be set with localStorage when there is a refresh/update.\r\n- Add logic for localStorage to be set to 0 when unmounted.\r\n- Add jest-localstorage-mock package for testing\r\n- Remove afterEach function in TimerCotainer.test.js file because it was affecting the localStorage mock.\r\n- Add jest.resetAllMocks() to 3 individual tests that need the afterEach function to run mocks reset.","created_at":"2018-04-05T14:34:04Z","updated_at":"2018-04-05T19:11:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f198d59e621cf2183e4c7e419b2324c22d47dbd5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114/commits","review_comments_url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114/comments","review_comment_url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues/114/comments","statuses_url":"https://api.github.com/repos/kaxcode/cloudwatch/statuses/8ef339483cdc3361db4edaeb4601de19e653fef5","head":{"label":"kaxcode:issue-70-localStorage-state-retention","ref":"issue-70-localStorage-state-retention","sha":"8ef339483cdc3361db4edaeb4601de19e653fef5","user":{"login":"kaxcode","id":19161242,"avatar_url":"https://avatars3.githubusercontent.com/u/19161242?v=4","gravatar_id":"","url":"https://api.github.com/users/kaxcode","html_url":"https://github.com/kaxcode","followers_url":"https://api.github.com/users/kaxcode/followers","following_url":"https://api.github.com/users/kaxcode/following{/other_user}","gists_url":"https://api.github.com/users/kaxcode/gists{/gist_id}","starred_url":"https://api.github.com/users/kaxcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaxcode/subscriptions","organizations_url":"https://api.github.com/users/kaxcode/orgs","repos_url":"https://api.github.com/users/kaxcode/repos","events_url":"https://api.github.com/users/kaxcode/events{/privacy}","received_events_url":"https://api.github.com/users/kaxcode/received_events","type":"User","site_admin":false},"repo":{"id":121549114,"name":"cloudwatch","full_name":"kaxcode/cloudwatch","owner":{"login":"kaxcode","id":19161242,"avatar_url":"https://avatars3.githubusercontent.com/u/19161242?v=4","gravatar_id":"","url":"https://api.github.com/users/kaxcode","html_url":"https://github.com/kaxcode","followers_url":"https://api.github.com/users/kaxcode/followers","following_url":"https://api.github.com/users/kaxcode/following{/other_user}","gists_url":"https://api.github.com/users/kaxcode/gists{/gist_id}","starred_url":"https://api.github.com/users/kaxcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaxcode/subscriptions","organizations_url":"https://api.github.com/users/kaxcode/orgs","repos_url":"https://api.github.com/users/kaxcode/repos","events_url":"https://api.github.com/users/kaxcode/events{/privacy}","received_events_url":"https://api.github.com/users/kaxcode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kaxcode/cloudwatch","description":"WarGames Project","fork":false,"url":"https://api.github.com/repos/kaxcode/cloudwatch","forks_url":"https://api.github.com/repos/kaxcode/cloudwatch/forks","keys_url":"https://api.github.com/repos/kaxcode/cloudwatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaxcode/cloudwatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaxcode/cloudwatch/teams","hooks_url":"https://api.github.com/repos/kaxcode/cloudwatch/hooks","issue_events_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues/events{/number}","events_url":"https://api.github.com/repos/kaxcode/cloudwatch/events","assignees_url":"https://api.github.com/repos/kaxcode/cloudwatch/assignees{/user}","branches_url":"https://api.github.com/repos/kaxcode/cloudwatch/branches{/branch}","tags_url":"https://api.github.com/repos/kaxcode/cloudwatch/tags","blobs_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaxcode/cloudwatch/statuses/{sha}","languages_url":"https://api.github.com/repos/kaxcode/cloudwatch/languages","stargazers_url":"https://api.github.com/repos/kaxcode/cloudwatch/stargazers","contributors_url":"https://api.github.com/repos/kaxcode/cloudwatch/contributors","subscribers_url":"https://api.github.com/repos/kaxcode/cloudwatch/subscribers","subscription_url":"https://api.github.com/repos/kaxcode/cloudwatch/subscription","commits_url":"https://api.github.com/repos/kaxcode/cloudwatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaxcode/cloudwatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaxcode/cloudwatch/contents/{+path}","compare_url":"https://api.github.com/repos/kaxcode/cloudwatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaxcode/cloudwatch/merges","archive_url":"https://api.github.com/repos/kaxcode/cloudwatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaxcode/cloudwatch/downloads","issues_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues{/number}","pulls_url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls{/number}","milestones_url":"https://api.github.com/repos/kaxcode/cloudwatch/milestones{/number}","notifications_url":"https://api.github.com/repos/kaxcode/cloudwatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaxcode/cloudwatch/labels{/name}","releases_url":"https://api.github.com/repos/kaxcode/cloudwatch/releases{/id}","deployments_url":"https://api.github.com/repos/kaxcode/cloudwatch/deployments","created_at":"2018-02-14T19:00:37Z","updated_at":"2018-04-04T15:21:26Z","pushed_at":"2018-04-05T19:11:15Z","git_url":"git://github.com/kaxcode/cloudwatch.git","ssh_url":"git@github.com:kaxcode/cloudwatch.git","clone_url":"https://github.com/kaxcode/cloudwatch.git","svn_url":"https://github.com/kaxcode/cloudwatch","homepage":"http://cloudwatch100.s3-website-us-east-1.amazonaws.com/","size":465,"stargazers_count":1,"watchers_count":1,"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":11,"license":null,"forks":0,"open_issues":11,"watchers":1,"default_branch":"master"}},"base":{"label":"kaxcode:master","ref":"master","sha":"784729b85a066e3bf49dc8b5aa656aea37ae371f","user":{"login":"kaxcode","id":19161242,"avatar_url":"https://avatars3.githubusercontent.com/u/19161242?v=4","gravatar_id":"","url":"https://api.github.com/users/kaxcode","html_url":"https://github.com/kaxcode","followers_url":"https://api.github.com/users/kaxcode/followers","following_url":"https://api.github.com/users/kaxcode/following{/other_user}","gists_url":"https://api.github.com/users/kaxcode/gists{/gist_id}","starred_url":"https://api.github.com/users/kaxcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaxcode/subscriptions","organizations_url":"https://api.github.com/users/kaxcode/orgs","repos_url":"https://api.github.com/users/kaxcode/repos","events_url":"https://api.github.com/users/kaxcode/events{/privacy}","received_events_url":"https://api.github.com/users/kaxcode/received_events","type":"User","site_admin":false},"repo":{"id":121549114,"name":"cloudwatch","full_name":"kaxcode/cloudwatch","owner":{"login":"kaxcode","id":19161242,"avatar_url":"https://avatars3.githubusercontent.com/u/19161242?v=4","gravatar_id":"","url":"https://api.github.com/users/kaxcode","html_url":"https://github.com/kaxcode","followers_url":"https://api.github.com/users/kaxcode/followers","following_url":"https://api.github.com/users/kaxcode/following{/other_user}","gists_url":"https://api.github.com/users/kaxcode/gists{/gist_id}","starred_url":"https://api.github.com/users/kaxcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaxcode/subscriptions","organizations_url":"https://api.github.com/users/kaxcode/orgs","repos_url":"https://api.github.com/users/kaxcode/repos","events_url":"https://api.github.com/users/kaxcode/events{/privacy}","received_events_url":"https://api.github.com/users/kaxcode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kaxcode/cloudwatch","description":"WarGames Project","fork":false,"url":"https://api.github.com/repos/kaxcode/cloudwatch","forks_url":"https://api.github.com/repos/kaxcode/cloudwatch/forks","keys_url":"https://api.github.com/repos/kaxcode/cloudwatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaxcode/cloudwatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaxcode/cloudwatch/teams","hooks_url":"https://api.github.com/repos/kaxcode/cloudwatch/hooks","issue_events_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues/events{/number}","events_url":"https://api.github.com/repos/kaxcode/cloudwatch/events","assignees_url":"https://api.github.com/repos/kaxcode/cloudwatch/assignees{/user}","branches_url":"https://api.github.com/repos/kaxcode/cloudwatch/branches{/branch}","tags_url":"https://api.github.com/repos/kaxcode/cloudwatch/tags","blobs_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaxcode/cloudwatch/statuses/{sha}","languages_url":"https://api.github.com/repos/kaxcode/cloudwatch/languages","stargazers_url":"https://api.github.com/repos/kaxcode/cloudwatch/stargazers","contributors_url":"https://api.github.com/repos/kaxcode/cloudwatch/contributors","subscribers_url":"https://api.github.com/repos/kaxcode/cloudwatch/subscribers","subscription_url":"https://api.github.com/repos/kaxcode/cloudwatch/subscription","commits_url":"https://api.github.com/repos/kaxcode/cloudwatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaxcode/cloudwatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaxcode/cloudwatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaxcode/cloudwatch/contents/{+path}","compare_url":"https://api.github.com/repos/kaxcode/cloudwatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaxcode/cloudwatch/merges","archive_url":"https://api.github.com/repos/kaxcode/cloudwatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaxcode/cloudwatch/downloads","issues_url":"https://api.github.com/repos/kaxcode/cloudwatch/issues{/number}","pulls_url":"https://api.github.com/repos/kaxcode/cloudwatch/pulls{/number}","milestones_url":"https://api.github.com/repos/kaxcode/cloudwatch/milestones{/number}","notifications_url":"https://api.github.com/repos/kaxcode/cloudwatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaxcode/cloudwatch/labels{/name}","releases_url":"https://api.github.com/repos/kaxcode/cloudwatch/releases{/id}","deployments_url":"https://api.github.com/repos/kaxcode/cloudwatch/deployments","created_at":"2018-02-14T19:00:37Z","updated_at":"2018-04-04T15:21:26Z","pushed_at":"2018-04-05T19:11:15Z","git_url":"git://github.com/kaxcode/cloudwatch.git","ssh_url":"git@github.com:kaxcode/cloudwatch.git","clone_url":"https://github.com/kaxcode/cloudwatch.git","svn_url":"https://github.com/kaxcode/cloudwatch","homepage":"http://cloudwatch100.s3-website-us-east-1.amazonaws.com/","size":465,"stargazers_count":1,"watchers_count":1,"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":11,"license":null,"forks":0,"open_issues":11,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114"},"html":{"href":"https://github.com/kaxcode/cloudwatch/pull/114"},"issue":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/issues/114"},"comments":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/issues/114/comments"},"review_comments":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114/comments"},"review_comment":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/pulls/114/commits"},"statuses":{"href":"https://api.github.com/repos/kaxcode/cloudwatch/statuses/8ef339483cdc3361db4edaeb4601de19e653fef5"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kaxcode"}}