{"action":"created","comment":{"url":"https://api.github.com/repos/mitodl/lore/pulls/comments/34674169","id":34674169,"diff_hunk":"@@ -91,4 +346,191 @@ define(['QUnit', 'jquery', 'setup_manage_taxonomies', 'reactaddons',\n         );\n     }\n   );\n+  QUnit.test('Assert that AddTermsComponent work properly',\n+    function(assert) {\n+      assert.ok(AddTermsComponent, \"class object not found\");\n+      var addTermsComponentRendered = React.addons.TestUtils.\n+        renderIntoDocument(\n+          <AddTermsComponent\n+            vocabularies={vocabularies}\n+            repoSlug=\"repo\"\n+          />\n+        );\n+      assert.equal(\n+        addTermsComponentRendered.state.errorText,\n+        ''\n+      );\n+      addTermsComponentRenderTest(assert, addTermsComponentRendered);\n+      //test error message\n+      addTermsComponentRendered.reportError(\n+        \"Error occurred while adding new term.\"\n+      );\n+      assert.equal(\n+        addTermsComponentRendered.state.errorText,\n+        'Error occurred while adding new term.'\n+      );\n+    }\n+  );\n+  QUnit.test('Assert that AddVocabulary work properly',\n+    function(assert) {\n+      assert.ok(AddVocabulary, \"class object not found\");\n+      var done = assert.async();\n+      var updateParent = function(data) {\n+        saveVocabularyResponse = data;\n+      };\n+      var afterMount = function(component) {\n+        assert.equal(\n+          component.state.name,\n+          ''\n+        );\n+        assert.equal(\n+          component.state.description,\n+          ''\n+        );\n+        assert.equal(\n+          component.state.vocabularyType,\n+          'm'\n+        );\n+        assert.equal(\n+          component.state.learningResourceTypes.length,\n+          0\n+        );\n+        addVocabularyRenderTest(assert, component);\n+        waitForAjax(2, function() {\n+          assert.equal(\n+            saveVocabularyResponse.id,\n+            vocabulary.id\n+          );\n+          done();\n+        });\n+      };\n+      React.addons.TestUtils.\n+        renderIntoDocument(\n+          <AddVocabulary\n+            vocabularies={vocabularies}\n+            repoSlug=\"repo\"\n+            updateParent={updateParent}\n+            ref={afterMount}\n+          />\n+        );\n+    }\n+  );\n+  QUnit.test('Assert that ajax fail in AddVocabulary',\n+    function(assert) {\n+      assert.ok(AddVocabulary, \"class object not found\");\n+      var done = assert.async();\n+      var updateParent = function(data) {\n+        saveVocabularyResponse = data;\n+      };\n+      var afterMount = function(component) {\n+        var formNode = React.addons.TestUtils.\n+          findRenderedDOMComponentWithClass(\n+            component,\n+            'form-horizontal'\n+          );\n+        assert.ok(formNode);\n+        //test form submission\n+        var inputNodes = React.addons.TestUtils.\n+          scryRenderedDOMComponentsWithTag(\n+            formNode,\n+            'input'\n+          );\n+        assert.equal(inputNodes.length, 4);\n+        inputNodes[0].value = \"TestA\";\n+        inputNodes[1].value = \"TestA\";\n+        inputNodes[2].checked = true;\n+        inputNodes[3].checked = false;\n+        React.addons.TestUtils.Simulate.submit(formNode);\n+        waitForAjax(1, function() {\n+          assert.ok(\n+            component.state.errorMessage","path":"ui/jstests/test_manage_taxonomies.jsx","position":425,"original_position":425,"commit_id":"6e5e6f7bc63ccc350d7323fa6a471e1ff023c6c8","original_commit_id":"6e5e6f7bc63ccc350d7323fa6a471e1ff023c6c8","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":"Done","created_at":"2015-07-15T12:52:40Z","updated_at":"2015-07-15T12:52:40Z","html_url":"https://github.com/mitodl/lore/pull/328#discussion_r34674169","pull_request_url":"https://api.github.com/repos/mitodl/lore/pulls/328","_links":{"self":{"href":"https://api.github.com/repos/mitodl/lore/pulls/comments/34674169"},"html":{"href":"https://github.com/mitodl/lore/pull/328#discussion_r34674169"},"pull_request":{"href":"https://api.github.com/repos/mitodl/lore/pulls/328"}}},"pull_request":{"url":"https://api.github.com/repos/mitodl/lore/pulls/328","id":39681181,"html_url":"https://github.com/mitodl/lore/pull/328","diff_url":"https://github.com/mitodl/lore/pull/328.diff","patch_url":"https://github.com/mitodl/lore/pull/328.patch","issue_url":"https://api.github.com/repos/mitodl/lore/issues/328","number":328,"state":"open","locked":false,"title":"Extended tests for manage_taxonomies.jsx file","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":"Hi\r\n\r\nIn this PR I wrote test cases for all reactjs classes i.e VocabularyComponent, TermComponent, AddTermsComponent, AddVocabulary, TaxonomyComponent\r\n\r\nhttps://github.com/mitodl/lore/issues/322\r\n\r\n@pdpinch @pwilkins @carsongee @noisecapella \r\n\r\n","created_at":"2015-07-10T12:53:33Z","updated_at":"2015-07-15T12:52:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66bd207e6c932b5c2c2342584fb369bca5238432","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/328/commits","review_comments_url":"https://api.github.com/repos/mitodl/lore/pulls/328/comments","review_comment_url":"https://api.github.com/repos/mitodl/lore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitodl/lore/issues/328/comments","statuses_url":"https://api.github.com/repos/mitodl/lore/statuses/6e5e6f7bc63ccc350d7323fa6a471e1ff023c6c8","head":{"label":"mitodl:test/aq/unit_tests_manage_taxonomies","ref":"test/aq/unit_tests_manage_taxonomies","sha":"6e5e6f7bc63ccc350d7323fa6a471e1ff023c6c8","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-06-17T02:41:03Z","pushed_at":"2015-07-15T08:33:21Z","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":6522,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":83,"forks":2,"open_issues":83,"watchers":6,"default_branch":"master"}},"base":{"label":"mitodl:master","ref":"master","sha":"9ae728f2d330cbb9637c94df7e815a9f0fb0f970","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-06-17T02:41:03Z","pushed_at":"2015-07-15T08:33:21Z","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":6522,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":83,"forks":2,"open_issues":83,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitodl/lore/pulls/328"},"html":{"href":"https://github.com/mitodl/lore/pull/328"},"issue":{"href":"https://api.github.com/repos/mitodl/lore/issues/328"},"comments":{"href":"https://api.github.com/repos/mitodl/lore/issues/328/comments"},"review_comments":{"href":"https://api.github.com/repos/mitodl/lore/pulls/328/comments"},"review_comment":{"href":"https://api.github.com/repos/mitodl/lore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitodl/lore/pulls/328/commits"},"statuses":{"href":"https://api.github.com/repos/mitodl/lore/statuses/6e5e6f7bc63ccc350d7323fa6a471e1ff023c6c8"}}}}