{"action":"created","comment":{"url":"https://api.github.com/repos/mitodl/lore/pulls/comments/38547486","id":38547486,"diff_hunk":"@@ -190,27 +190,217 @@ define(['QUnit', 'jquery', 'manage_taxonomies', 'react',\n   QUnit.test('Assert that TermComponent renders properly',\n     function(assert) {\n       assert.ok(TermComponent, \"class object not found\");\n+      var done = assert.async();\n       var term = {\n         \"id\": 9,\n         \"slug\": \"test\",\n         \"label\": \"test\",\n         \"weight\": 1\n       };\n-      var termComponentRendered = React.addons.TestUtils.\n+      var parentUpdateCount = 0;\n+      var updateTerm = function() {\n+        parentUpdateCount += 1;\n+      };\n+      TestUtils.initMockjax({\n+        url: \"/api/v1/repositories/repo/vocabularies/difficulty/terms/test\",\n+        responseText: term,\n+        type: \"PUT\"\n+      });\n+      var afterMount = function(component) {\n+        var labels = React.addons.TestUtils.\n+        scryRenderedDOMComponentsWithTag(\n+          component,\n+          'label'\n+        );\n+        //testing label value render\n+        var termLable = labels[0];\n+        var label = termLable.getDOMNode();\n+        assert.equal(label.innerHTML, term.label);\n+        assert.equal(component.state.formatActionState, 'edit');\n+        var formatButton = React.addons.TestUtils.\n+          findRenderedDOMComponentWithClass(\n+            component,\n+            'format-button'\n+        );\n+        var cancelButton = React.addons.TestUtils.\n+          findRenderedDOMComponentWithClass(\n+            component,\n+            'revert-button'\n+        );\n+        var editTermBox = React.addons.TestUtils.\n+        findRenderedDOMComponentWithTag(\n+          component,\n+          'input'\n+        );\n+        //open edit mode\n+        React.addons.TestUtils.Simulate.click(formatButton);\n+        component.forceUpdate(function() {\n+          assert.equal(component.state.formatActionState, 'save');\n+          //edit term\n+          React.addons.TestUtils.Simulate.change(\n+            editTermBox, {target: {value: \"TestB\"}}\n+          );\n+          component.forceUpdate(function() {\n+            //save term\n+            React.addons.TestUtils.Simulate.click(formatButton);\n+            component.forceUpdate(function() {\n+              //afer saved term using api\n+              waitForAjax(1, function() {\n+                //term state reset","path":"ui/jstests/test_manage_taxonomies.jsx","position":61,"original_position":61,"commit_id":"3dc2000ced539254a860f740162aba4c2ebe9964","original_commit_id":"3dc2000ced539254a860f740162aba4c2ebe9964","user":{"login":"noisecapella","id":863262,"avatar_url":"https://avatars.githubusercontent.com/u/863262?v=3","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"body":"Can you assert that the textbox value was reset?","created_at":"2015-09-02T15:39:06Z","updated_at":"2015-09-02T15:39:06Z","html_url":"https://github.com/mitodl/lore/pull/574#discussion_r38547486","pull_request_url":"https://api.github.com/repos/mitodl/lore/pulls/574","_links":{"self":{"href":"https://api.github.com/repos/mitodl/lore/pulls/comments/38547486"},"html":{"href":"https://github.com/mitodl/lore/pull/574#discussion_r38547486"},"pull_request":{"href":"https://api.github.com/repos/mitodl/lore/pulls/574"}}},"pull_request":{"url":"https://api.github.com/repos/mitodl/lore/pulls/574","id":43761357,"html_url":"https://github.com/mitodl/lore/pull/574","diff_url":"https://github.com/mitodl/lore/pull/574.diff","patch_url":"https://github.com/mitodl/lore/pull/574.patch","issue_url":"https://api.github.com/repos/mitodl/lore/issues/574","number":574,"state":"open","locked":false,"title":"Added inline editing feature for terms in taxonomy panel.","user":{"login":"amir-qayyum-khan","id":10431250,"avatar_url":"https://avatars.githubusercontent.com/u/10431250?v=3","gravatar_id":"","url":"https://api.github.com/users/amir-qayyum-khan","html_url":"https://github.com/amir-qayyum-khan","followers_url":"https://api.github.com/users/amir-qayyum-khan/followers","following_url":"https://api.github.com/users/amir-qayyum-khan/following{/other_user}","gists_url":"https://api.github.com/users/amir-qayyum-khan/gists{/gist_id}","starred_url":"https://api.github.com/users/amir-qayyum-khan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amir-qayyum-khan/subscriptions","organizations_url":"https://api.github.com/users/amir-qayyum-khan/orgs","repos_url":"https://api.github.com/users/amir-qayyum-khan/repos","events_url":"https://api.github.com/users/amir-qayyum-khan/events{/privacy}","received_events_url":"https://api.github.com/users/amir-qayyum-khan/received_events","type":"User","site_admin":false},"body":"Fixed https://github.com/mitodl/lore/issues/506\r\n\r\n@pdpinch @carsongee \r\n\r\n![screen shot 2015-08-31 at 5 53 12 pm](https://cloud.githubusercontent.com/assets/10431250/9579136/9541d1f8-5009-11e5-9a4e-8d1f22e31526.png)\r\n![screen shot 2015-08-31 at 5 53 27 pm](https://cloud.githubusercontent.com/assets/10431250/9579137/9542176c-5009-11e5-968b-2db1888fcc6a.png)\r\n![screen shot 2015-08-31 at 5 53 32 pm](https://cloud.githubusercontent.com/assets/10431250/9579138/9544c250-5009-11e5-8c6f-8753cfd23d16.png)\r\n![screen shot 2015-08-31 at 5 53 41 pm](https://cloud.githubusercontent.com/assets/10431250/9579139/95476dc0-5009-11e5-8a5a-b5530bc5a988.png)\r\n\r\n","created_at":"2015-08-31T12:56:44Z","updated_at":"2015-09-02T15:39:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfc7e478d694e6ba70a17f16be2724eac9e44580","assignee":{"login":"amir-qayyum-khan","id":10431250,"avatar_url":"https://avatars.githubusercontent.com/u/10431250?v=3","gravatar_id":"","url":"https://api.github.com/users/amir-qayyum-khan","html_url":"https://github.com/amir-qayyum-khan","followers_url":"https://api.github.com/users/amir-qayyum-khan/followers","following_url":"https://api.github.com/users/amir-qayyum-khan/following{/other_user}","gists_url":"https://api.github.com/users/amir-qayyum-khan/gists{/gist_id}","starred_url":"https://api.github.com/users/amir-qayyum-khan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amir-qayyum-khan/subscriptions","organizations_url":"https://api.github.com/users/amir-qayyum-khan/orgs","repos_url":"https://api.github.com/users/amir-qayyum-khan/repos","events_url":"https://api.github.com/users/amir-qayyum-khan/events{/privacy}","received_events_url":"https://api.github.com/users/amir-qayyum-khan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mitodl/lore/pulls/574/commits","review_comments_url":"https://api.github.com/repos/mitodl/lore/pulls/574/comments","review_comment_url":"https://api.github.com/repos/mitodl/lore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitodl/lore/issues/574/comments","statuses_url":"https://api.github.com/repos/mitodl/lore/statuses/3dc2000ced539254a860f740162aba4c2ebe9964","head":{"label":"mitodl:feature/aq/edit_term","ref":"feature/aq/edit_term","sha":"3dc2000ced539254a860f740162aba4c2ebe9964","user":{"login":"mitodl","id":7918516,"avatar_url":"https://avatars.githubusercontent.com/u/7918516?v=3","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"repo":{"id":34909549,"name":"lore","full_name":"mitodl/lore","owner":{"login":"mitodl","id":7918516,"avatar_url":"https://avatars.githubusercontent.com/u/7918516?v=3","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mitodl/lore","description":"Learning Object Repository for Education","fork":false,"url":"https://api.github.com/repos/mitodl/lore","forks_url":"https://api.github.com/repos/mitodl/lore/forks","keys_url":"https://api.github.com/repos/mitodl/lore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitodl/lore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitodl/lore/teams","hooks_url":"https://api.github.com/repos/mitodl/lore/hooks","issue_events_url":"https://api.github.com/repos/mitodl/lore/issues/events{/number}","events_url":"https://api.github.com/repos/mitodl/lore/events","assignees_url":"https://api.github.com/repos/mitodl/lore/assignees{/user}","branches_url":"https://api.github.com/repos/mitodl/lore/branches{/branch}","tags_url":"https://api.github.com/repos/mitodl/lore/tags","blobs_url":"https://api.github.com/repos/mitodl/lore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitodl/lore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitodl/lore/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitodl/lore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitodl/lore/statuses/{sha}","languages_url":"https://api.github.com/repos/mitodl/lore/languages","stargazers_url":"https://api.github.com/repos/mitodl/lore/stargazers","contributors_url":"https://api.github.com/repos/mitodl/lore/contributors","subscribers_url":"https://api.github.com/repos/mitodl/lore/subscribers","subscription_url":"https://api.github.com/repos/mitodl/lore/subscription","commits_url":"https://api.github.com/repos/mitodl/lore/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitodl/lore/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitodl/lore/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitodl/lore/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitodl/lore/contents/{+path}","compare_url":"https://api.github.com/repos/mitodl/lore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitodl/lore/merges","archive_url":"https://api.github.com/repos/mitodl/lore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitodl/lore/downloads","issues_url":"https://api.github.com/repos/mitodl/lore/issues{/number}","pulls_url":"https://api.github.com/repos/mitodl/lore/pulls{/number}","milestones_url":"https://api.github.com/repos/mitodl/lore/milestones{/number}","notifications_url":"https://api.github.com/repos/mitodl/lore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitodl/lore/labels{/name}","releases_url":"https://api.github.com/repos/mitodl/lore/releases{/id}","created_at":"2015-05-01T15:34:34Z","updated_at":"2015-08-11T17:06:05Z","pushed_at":"2015-09-02T15:34:17Z","git_url":"git://github.com/mitodl/lore.git","ssh_url":"git@github.com:mitodl/lore.git","clone_url":"https://github.com/mitodl/lore.git","svn_url":"https://github.com/mitodl/lore","homepage":"https://goo.gl/nDVx4D","size":10222,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":108,"forks":3,"open_issues":108,"watchers":7,"default_branch":"master"}},"base":{"label":"mitodl:master","ref":"master","sha":"2ab9ad3717d1576e55c52cfe160cb5db3a128f5f","user":{"login":"mitodl","id":7918516,"avatar_url":"https://avatars.githubusercontent.com/u/7918516?v=3","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"repo":{"id":34909549,"name":"lore","full_name":"mitodl/lore","owner":{"login":"mitodl","id":7918516,"avatar_url":"https://avatars.githubusercontent.com/u/7918516?v=3","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mitodl/lore","description":"Learning Object Repository for Education","fork":false,"url":"https://api.github.com/repos/mitodl/lore","forks_url":"https://api.github.com/repos/mitodl/lore/forks","keys_url":"https://api.github.com/repos/mitodl/lore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitodl/lore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitodl/lore/teams","hooks_url":"https://api.github.com/repos/mitodl/lore/hooks","issue_events_url":"https://api.github.com/repos/mitodl/lore/issues/events{/number}","events_url":"https://api.github.com/repos/mitodl/lore/events","assignees_url":"https://api.github.com/repos/mitodl/lore/assignees{/user}","branches_url":"https://api.github.com/repos/mitodl/lore/branches{/branch}","tags_url":"https://api.github.com/repos/mitodl/lore/tags","blobs_url":"https://api.github.com/repos/mitodl/lore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitodl/lore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitodl/lore/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitodl/lore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitodl/lore/statuses/{sha}","languages_url":"https://api.github.com/repos/mitodl/lore/languages","stargazers_url":"https://api.github.com/repos/mitodl/lore/stargazers","contributors_url":"https://api.github.com/repos/mitodl/lore/contributors","subscribers_url":"https://api.github.com/repos/mitodl/lore/subscribers","subscription_url":"https://api.github.com/repos/mitodl/lore/subscription","commits_url":"https://api.github.com/repos/mitodl/lore/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitodl/lore/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitodl/lore/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitodl/lore/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitodl/lore/contents/{+path}","compare_url":"https://api.github.com/repos/mitodl/lore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitodl/lore/merges","archive_url":"https://api.github.com/repos/mitodl/lore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitodl/lore/downloads","issues_url":"https://api.github.com/repos/mitodl/lore/issues{/number}","pulls_url":"https://api.github.com/repos/mitodl/lore/pulls{/number}","milestones_url":"https://api.github.com/repos/mitodl/lore/milestones{/number}","notifications_url":"https://api.github.com/repos/mitodl/lore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitodl/lore/labels{/name}","releases_url":"https://api.github.com/repos/mitodl/lore/releases{/id}","created_at":"2015-05-01T15:34:34Z","updated_at":"2015-08-11T17:06:05Z","pushed_at":"2015-09-02T15:34:17Z","git_url":"git://github.com/mitodl/lore.git","ssh_url":"git@github.com:mitodl/lore.git","clone_url":"https://github.com/mitodl/lore.git","svn_url":"https://github.com/mitodl/lore","homepage":"https://goo.gl/nDVx4D","size":10222,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":108,"forks":3,"open_issues":108,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitodl/lore/pulls/574"},"html":{"href":"https://github.com/mitodl/lore/pull/574"},"issue":{"href":"https://api.github.com/repos/mitodl/lore/issues/574"},"comments":{"href":"https://api.github.com/repos/mitodl/lore/issues/574/comments"},"review_comments":{"href":"https://api.github.com/repos/mitodl/lore/pulls/574/comments"},"review_comment":{"href":"https://api.github.com/repos/mitodl/lore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitodl/lore/pulls/574/commits"},"statuses":{"href":"https://api.github.com/repos/mitodl/lore/statuses/3dc2000ced539254a860f740162aba4c2ebe9964"}}}}