{"action":"created","comment":{"url":"https://api.github.com/repos/virtool/virtool/pulls/comments/210127645","pull_request_review_id":146280452,"id":210127645,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDEyNzY0NQ==","diff_hunk":"@@ -0,0 +1,96 @@\n+import TaskField from \"./TaskField\";\n+import { InputError } from \"../../../base\";\n+\n+describe(\"<TaskField />\", () => {\n+    let props;\n+    let wrapper;\n+    let spy;\n+    const mockEvent = { preventDefault: jest.fn() };\n+\n+    it(\"renders correctly\", () => {\n+        props = {\n+            name: \"test\",\n+            value: 3,\n+            readOnly: false,\n+            lowerLimit: 1,\n+            upperLimit: 10,\n+            onInvalid: jest.fn(),\n+            onChange: jest.fn(),\n+            clear: jest.fn()\n+        };\n+        wrapper = shallow(<TaskField {...props} />);\n+        expect(wrapper).toMatchSnapshot();\n+\n+        wrapper = shallow(<TaskField />);\n+        expect(wrapper).toMatchSnapshot();\n+    });\n+\n+    it(\"componentDidUpdate: change in props.value updates state\", () => {\n+        spy = sinon.spy(TaskField.prototype, \"componentDidUpdate\");\n+        expect(spy.called).toBe(false);\n+\n+        wrapper = shallow(<TaskField value={1} />);\n+        expect(wrapper.state()).toEqual({ value: 1, pending: false });\n+\n+        wrapper.setProps({ value: 6 });\n+        expect(spy.calledOnce).toBe(true);\n+        expect(wrapper.state()).toEqual({ value: 6, pending: false });\n+\n+        spy.restore();\n+    });\n+\n+    it(\"handleBlur: if pending state is false, reset value; otherwise call props.clear callback\", () => {\n+        const spy = sinon.spy();\n+        expect(spy.called).toBe(false);\n+\n+        wrapper = mount(<TaskField value={7} clear={spy} />);\n+        wrapper.find(InputError).prop(\"onBlur\")();\n+\n+        expect(spy.calledOnce).toBe(true);\n+        expect(wrapper.state()).toEqual({ value: 7, pending: false });\n+\n+        wrapper.setState({ value: 0, pending: true });\n+        wrapper.find(InputError).prop(\"onBlur\")();\n+\n+        expect(spy.calledTwice).toBe(true);\n+        expect(wrapper.state()).toEqual({ value: 0, pending: true });\n+    });\n+\n+    it(\"handleChange: input changes sets state.value to event value\", () => {\n+        wrapper = mount(<TaskField value={7} />);\n+        expect(wrapper.state(\"value\")).toEqual(7);\n+\n+        wrapper.find(InputError).prop(\"onChange\")({ target: { value: 3 } });\n+        expect(wrapper.state(\"value\")).toEqual(3);\n+    });\n+\n+    it(\"handleInvalid: input invalidation calls props.onInvalid callback\", () => {\n+        spy = sinon.spy();\n+        expect(spy.called).toBe(false);\n+\n+        wrapper = mount(<TaskField onInvalid={spy} />);\n+        wrapper.find(InputError).prop(\"onInvalid\")(mockEvent);\n+\n+        expect(spy.calledWith(mockEvent)).toBe(true);\n+    });\n+\n+    it(`handleSubmit: form submission calls props.onChange callback when state.value is set,\n+    otherwise calls props.onInvalid callback`, () => {\n+        props = {\n+            onInvalid: jest.fn(),\n+            onChange: sinon.spy(),\n+            name: \"test\"\n+        };\n+        wrapper = mount(<TaskField {...props} />);","path":"client/src/js/administration/components/Jobs/TaskField.test.js","position":84,"original_position":84,"commit_id":"3e87b302a0b6f741f088817274af39201b8ad964","original_commit_id":"3e87b302a0b6f741f088817274af39201b8ad964","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Expected indentation of 12 spaces but found 8. (indent)](https://app.codacy.com/app/virtool/virtool/pullRequest?prid=2045388)","created_at":"2018-08-14T22:46:22Z","updated_at":"2018-08-14T22:46:22Z","html_url":"https://github.com/virtool/virtool/pull/1094#discussion_r210127645","pull_request_url":"https://api.github.com/repos/virtool/virtool/pulls/1094","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/virtool/virtool/pulls/comments/210127645"},"html":{"href":"https://github.com/virtool/virtool/pull/1094#discussion_r210127645"},"pull_request":{"href":"https://api.github.com/repos/virtool/virtool/pulls/1094"}}},"pull_request":{"url":"https://api.github.com/repos/virtool/virtool/pulls/1094","id":208430434,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NDMwNDM0","html_url":"https://github.com/virtool/virtool/pull/1094","diff_url":"https://github.com/virtool/virtool/pull/1094.diff","patch_url":"https://github.com/virtool/virtool/pull/1094.patch","issue_url":"https://api.github.com/repos/virtool/virtool/issues/1094","number":1094,"state":"open","locked":false,"title":"Testing update","user":{"login":"Miminko","id":29030929,"node_id":"MDQ6VXNlcjI5MDMwOTI5","avatar_url":"https://avatars2.githubusercontent.com/u/29030929?v=4","gravatar_id":"","url":"https://api.github.com/users/Miminko","html_url":"https://github.com/Miminko","followers_url":"https://api.github.com/users/Miminko/followers","following_url":"https://api.github.com/users/Miminko/following{/other_user}","gists_url":"https://api.github.com/users/Miminko/gists{/gist_id}","starred_url":"https://api.github.com/users/Miminko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Miminko/subscriptions","organizations_url":"https://api.github.com/users/Miminko/orgs","repos_url":"https://api.github.com/users/Miminko/repos","events_url":"https://api.github.com/users/Miminko/events{/privacy}","received_events_url":"https://api.github.com/users/Miminko/received_events","type":"User","site_admin":false},"body":"- add/update more unit tests","created_at":"2018-08-14T22:41:59Z","updated_at":"2018-08-14T22:46:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16dc17e43382d5154560dff7385a205df1598d1e","assignee":{"login":"Miminko","id":29030929,"node_id":"MDQ6VXNlcjI5MDMwOTI5","avatar_url":"https://avatars2.githubusercontent.com/u/29030929?v=4","gravatar_id":"","url":"https://api.github.com/users/Miminko","html_url":"https://github.com/Miminko","followers_url":"https://api.github.com/users/Miminko/followers","following_url":"https://api.github.com/users/Miminko/following{/other_user}","gists_url":"https://api.github.com/users/Miminko/gists{/gist_id}","starred_url":"https://api.github.com/users/Miminko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Miminko/subscriptions","organizations_url":"https://api.github.com/users/Miminko/orgs","repos_url":"https://api.github.com/users/Miminko/repos","events_url":"https://api.github.com/users/Miminko/events{/privacy}","received_events_url":"https://api.github.com/users/Miminko/received_events","type":"User","site_admin":false},"assignees":[{"login":"Miminko","id":29030929,"node_id":"MDQ6VXNlcjI5MDMwOTI5","avatar_url":"https://avatars2.githubusercontent.com/u/29030929?v=4","gravatar_id":"","url":"https://api.github.com/users/Miminko","html_url":"https://github.com/Miminko","followers_url":"https://api.github.com/users/Miminko/followers","following_url":"https://api.github.com/users/Miminko/following{/other_user}","gists_url":"https://api.github.com/users/Miminko/gists{/gist_id}","starred_url":"https://api.github.com/users/Miminko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Miminko/subscriptions","organizations_url":"https://api.github.com/users/Miminko/orgs","repos_url":"https://api.github.com/users/Miminko/repos","events_url":"https://api.github.com/users/Miminko/events{/privacy}","received_events_url":"https://api.github.com/users/Miminko/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":718292473,"node_id":"MDU6TGFiZWw3MTgyOTI0NzM=","url":"https://api.github.com/repos/virtool/virtool/labels/in%20progress","name":"in progress","color":"5461b7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/virtool/virtool/pulls/1094/commits","review_comments_url":"https://api.github.com/repos/virtool/virtool/pulls/1094/comments","review_comment_url":"https://api.github.com/repos/virtool/virtool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/virtool/virtool/issues/1094/comments","statuses_url":"https://api.github.com/repos/virtool/virtool/statuses/3e87b302a0b6f741f088817274af39201b8ad964","head":{"label":"Miminko:testing-update","ref":"testing-update","sha":"3e87b302a0b6f741f088817274af39201b8ad964","user":{"login":"Miminko","id":29030929,"node_id":"MDQ6VXNlcjI5MDMwOTI5","avatar_url":"https://avatars2.githubusercontent.com/u/29030929?v=4","gravatar_id":"","url":"https://api.github.com/users/Miminko","html_url":"https://github.com/Miminko","followers_url":"https://api.github.com/users/Miminko/followers","following_url":"https://api.github.com/users/Miminko/following{/other_user}","gists_url":"https://api.github.com/users/Miminko/gists{/gist_id}","starred_url":"https://api.github.com/users/Miminko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Miminko/subscriptions","organizations_url":"https://api.github.com/users/Miminko/orgs","repos_url":"https://api.github.com/users/Miminko/repos","events_url":"https://api.github.com/users/Miminko/events{/privacy}","received_events_url":"https://api.github.com/users/Miminko/received_events","type":"User","site_admin":false},"repo":{"id":119582323,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk1ODIzMjM=","name":"virtool","full_name":"Miminko/virtool","owner":{"login":"Miminko","id":29030929,"node_id":"MDQ6VXNlcjI5MDMwOTI5","avatar_url":"https://avatars2.githubusercontent.com/u/29030929?v=4","gravatar_id":"","url":"https://api.github.com/users/Miminko","html_url":"https://github.com/Miminko","followers_url":"https://api.github.com/users/Miminko/followers","following_url":"https://api.github.com/users/Miminko/following{/other_user}","gists_url":"https://api.github.com/users/Miminko/gists{/gist_id}","starred_url":"https://api.github.com/users/Miminko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Miminko/subscriptions","organizations_url":"https://api.github.com/users/Miminko/orgs","repos_url":"https://api.github.com/users/Miminko/repos","events_url":"https://api.github.com/users/Miminko/events{/privacy}","received_events_url":"https://api.github.com/users/Miminko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Miminko/virtool","description":"Viral infection diagnostics using next-generation sequencing","fork":true,"url":"https://api.github.com/repos/Miminko/virtool","forks_url":"https://api.github.com/repos/Miminko/virtool/forks","keys_url":"https://api.github.com/repos/Miminko/virtool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Miminko/virtool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Miminko/virtool/teams","hooks_url":"https://api.github.com/repos/Miminko/virtool/hooks","issue_events_url":"https://api.github.com/repos/Miminko/virtool/issues/events{/number}","events_url":"https://api.github.com/repos/Miminko/virtool/events","assignees_url":"https://api.github.com/repos/Miminko/virtool/assignees{/user}","branches_url":"https://api.github.com/repos/Miminko/virtool/branches{/branch}","tags_url":"https://api.github.com/repos/Miminko/virtool/tags","blobs_url":"https://api.github.com/repos/Miminko/virtool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Miminko/virtool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Miminko/virtool/git/refs{/sha}","trees_url":"https://api.github.com/repos/Miminko/virtool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Miminko/virtool/statuses/{sha}","languages_url":"https://api.github.com/repos/Miminko/virtool/languages","stargazers_url":"https://api.github.com/repos/Miminko/virtool/stargazers","contributors_url":"https://api.github.com/repos/Miminko/virtool/contributors","subscribers_url":"https://api.github.com/repos/Miminko/virtool/subscribers","subscription_url":"https://api.github.com/repos/Miminko/virtool/subscription","commits_url":"https://api.github.com/repos/Miminko/virtool/commits{/sha}","git_commits_url":"https://api.github.com/repos/Miminko/virtool/git/commits{/sha}","comments_url":"https://api.github.com/repos/Miminko/virtool/comments{/number}","issue_comment_url":"https://api.github.com/repos/Miminko/virtool/issues/comments{/number}","contents_url":"https://api.github.com/repos/Miminko/virtool/contents/{+path}","compare_url":"https://api.github.com/repos/Miminko/virtool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Miminko/virtool/merges","archive_url":"https://api.github.com/repos/Miminko/virtool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Miminko/virtool/downloads","issues_url":"https://api.github.com/repos/Miminko/virtool/issues{/number}","pulls_url":"https://api.github.com/repos/Miminko/virtool/pulls{/number}","milestones_url":"https://api.github.com/repos/Miminko/virtool/milestones{/number}","notifications_url":"https://api.github.com/repos/Miminko/virtool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Miminko/virtool/labels{/name}","releases_url":"https://api.github.com/repos/Miminko/virtool/releases{/id}","deployments_url":"https://api.github.com/repos/Miminko/virtool/deployments","created_at":"2018-01-30T19:15:32Z","updated_at":"2018-08-01T15:28:47Z","pushed_at":"2018-08-14T22:41:30Z","git_url":"git://github.com/Miminko/virtool.git","ssh_url":"git@github.com:Miminko/virtool.git","clone_url":"https://github.com/Miminko/virtool.git","svn_url":"https://github.com/Miminko/virtool","homepage":"https://www.virtool.ca","size":82862,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"virtool:beta.1","ref":"beta.1","sha":"1c1be4e443ed25de5c7fc1388f956a8ed3060e84","user":{"login":"virtool","id":19957602,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5OTU3NjAy","avatar_url":"https://avatars0.githubusercontent.com/u/19957602?v=4","gravatar_id":"","url":"https://api.github.com/users/virtool","html_url":"https://github.com/virtool","followers_url":"https://api.github.com/users/virtool/followers","following_url":"https://api.github.com/users/virtool/following{/other_user}","gists_url":"https://api.github.com/users/virtool/gists{/gist_id}","starred_url":"https://api.github.com/users/virtool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virtool/subscriptions","organizations_url":"https://api.github.com/users/virtool/orgs","repos_url":"https://api.github.com/users/virtool/repos","events_url":"https://api.github.com/users/virtool/events{/privacy}","received_events_url":"https://api.github.com/users/virtool/received_events","type":"Organization","site_admin":false},"repo":{"id":63437589,"node_id":"MDEwOlJlcG9zaXRvcnk2MzQzNzU4OQ==","name":"virtool","full_name":"virtool/virtool","owner":{"login":"virtool","id":19957602,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5OTU3NjAy","avatar_url":"https://avatars0.githubusercontent.com/u/19957602?v=4","gravatar_id":"","url":"https://api.github.com/users/virtool","html_url":"https://github.com/virtool","followers_url":"https://api.github.com/users/virtool/followers","following_url":"https://api.github.com/users/virtool/following{/other_user}","gists_url":"https://api.github.com/users/virtool/gists{/gist_id}","starred_url":"https://api.github.com/users/virtool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virtool/subscriptions","organizations_url":"https://api.github.com/users/virtool/orgs","repos_url":"https://api.github.com/users/virtool/repos","events_url":"https://api.github.com/users/virtool/events{/privacy}","received_events_url":"https://api.github.com/users/virtool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/virtool/virtool","description":"Viral infection diagnostics using next-generation sequencing","fork":false,"url":"https://api.github.com/repos/virtool/virtool","forks_url":"https://api.github.com/repos/virtool/virtool/forks","keys_url":"https://api.github.com/repos/virtool/virtool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/virtool/virtool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/virtool/virtool/teams","hooks_url":"https://api.github.com/repos/virtool/virtool/hooks","issue_events_url":"https://api.github.com/repos/virtool/virtool/issues/events{/number}","events_url":"https://api.github.com/repos/virtool/virtool/events","assignees_url":"https://api.github.com/repos/virtool/virtool/assignees{/user}","branches_url":"https://api.github.com/repos/virtool/virtool/branches{/branch}","tags_url":"https://api.github.com/repos/virtool/virtool/tags","blobs_url":"https://api.github.com/repos/virtool/virtool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/virtool/virtool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/virtool/virtool/git/refs{/sha}","trees_url":"https://api.github.com/repos/virtool/virtool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/virtool/virtool/statuses/{sha}","languages_url":"https://api.github.com/repos/virtool/virtool/languages","stargazers_url":"https://api.github.com/repos/virtool/virtool/stargazers","contributors_url":"https://api.github.com/repos/virtool/virtool/contributors","subscribers_url":"https://api.github.com/repos/virtool/virtool/subscribers","subscription_url":"https://api.github.com/repos/virtool/virtool/subscription","commits_url":"https://api.github.com/repos/virtool/virtool/commits{/sha}","git_commits_url":"https://api.github.com/repos/virtool/virtool/git/commits{/sha}","comments_url":"https://api.github.com/repos/virtool/virtool/comments{/number}","issue_comment_url":"https://api.github.com/repos/virtool/virtool/issues/comments{/number}","contents_url":"https://api.github.com/repos/virtool/virtool/contents/{+path}","compare_url":"https://api.github.com/repos/virtool/virtool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/virtool/virtool/merges","archive_url":"https://api.github.com/repos/virtool/virtool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/virtool/virtool/downloads","issues_url":"https://api.github.com/repos/virtool/virtool/issues{/number}","pulls_url":"https://api.github.com/repos/virtool/virtool/pulls{/number}","milestones_url":"https://api.github.com/repos/virtool/virtool/milestones{/number}","notifications_url":"https://api.github.com/repos/virtool/virtool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/virtool/virtool/labels{/name}","releases_url":"https://api.github.com/repos/virtool/virtool/releases{/id}","deployments_url":"https://api.github.com/repos/virtool/virtool/deployments","created_at":"2016-07-15T16:56:56Z","updated_at":"2018-07-31T20:56:35Z","pushed_at":"2018-08-14T22:42:00Z","git_url":"git://github.com/virtool/virtool.git","ssh_url":"git@github.com:virtool/virtool.git","clone_url":"https://github.com/virtool/virtool.git","svn_url":"https://github.com/virtool/virtool","homepage":"https://www.virtool.ca","size":83063,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":50,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":50,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/virtool/virtool/pulls/1094"},"html":{"href":"https://github.com/virtool/virtool/pull/1094"},"issue":{"href":"https://api.github.com/repos/virtool/virtool/issues/1094"},"comments":{"href":"https://api.github.com/repos/virtool/virtool/issues/1094/comments"},"review_comments":{"href":"https://api.github.com/repos/virtool/virtool/pulls/1094/comments"},"review_comment":{"href":"https://api.github.com/repos/virtool/virtool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/virtool/virtool/pulls/1094/commits"},"statuses":{"href":"https://api.github.com/repos/virtool/virtool/statuses/3e87b302a0b6f741f088817274af39201b8ad964"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}