{"action":"created","comment":{"url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/comments/73453334","id":73453334,"diff_hunk":"@@ -0,0 +1,94 @@\n+/* eslint-env mocha */\n+\n+'use strict';\n+\n+let chai = require('chai');\n+let expect = chai.expect;\n+let dirtyChai = require('dirty-chai');\n+let chaiPromise = require('chai-as-promised');\n+let express = require('express');\n+let request = require('supertest');\n+let app = express();\n+let router = express.Router();\n+let ejs = require('ejs');\n+let read = require('fs').readFileSync;\n+let join = require('path').join;\n+let path = join(__dirname, '../../views/hierarchy.ejs');\n+\n+chai.use(dirtyChai);\n+chai.use(chaiPromise);\n+chai.use(chaiPromise);\n+\n+function initializeRoute (object) {\n+  router.get('/hierarchy', function (req, res) {\n+   // let rendHtml = ejs.compile(read(path, 'utf8'), {filename: path})(object);\n+    res.status(200).send(ejs.compile(read(path, 'utf8'), {filename: path})(object));\n+  });\n+}\n+\n+let hierarchyTestCases = [\n+  {title: 'Empty item hierarchy tree (no root items)',\n+    itemHierarchy: []},\n+\n+  {title: 'Single root item with no children',\n+    itemHierarchy: [{name: 'Root Item', children: []}]},\n+\n+  {title: 'Single root item with one child',\n+    itemHierarchy: [{name: 'Root Item', children: [{name: 'single child', children: []}]}]},\n+\n+  {title: 'Single root item with mulitple children',\n+    itemHierarchy: [{name: 'Root Item', children:\n+    [{name: 'child one', children: []}, {name: 'child two', children: []}]}]},\n+\n+  {title: 'Single root item with one nested child',\n+    itemHierarchy: [{name: 'Root Item', children:\n+    [{name: 'single child',\n+      children: [{name: 'nested child', children: []}]}]}]},\n+\n+  {title: 'Mulitple root items with no children',\n+    itemHierarchy: [{name: 'Root Item 1', children: []}, {name: 'Root item 2', children: []}]},\n+\n+  {title: 'Multiple items with children',\n+    itemHierarchy: [{name: 'Root Item 1', children: [{name: 'Sub root item 1', children: []}]},\n+      {name: 'Root Item 2', children: [{name: 'Sub root item 2', children: []}]}]},\n+\n+  {title: 'Multiple root items with multiple children',\n+    itemHierarchy:\n+      [{name: 'Root item 1',\n+        children: [{name: 'Root 1 Child 1', children: []}, {name: 'Root 1 Child 1', children: []}]},\n+      {name: 'Root item 2',\n+        children: [{name: 'Root 2 Child 1', children: []}, {name: 'Root 2 Child 2', children: []}]}]},\n+\n+  {title: 'Multiple root items with one nested child',\n+    itemHierarchy:\n+      [{name: 'Root item 1',\n+        children: [{name: 'Root 1 Child 1', children: []}, {name: 'Root 1 Child 1',\n+          children: [{name: 'Nested child of root 1', children: []}]}]},\n+      {name: 'Root item 2',\n+        children: [{name: 'Root 2 Child 1', children: []}, {name: 'Root 2 Child 2',\n+          children: [{name: 'Nested child of root 2', children: []}]}]}]}\n+];\n+\n+describe('hierarchy', function () {\n+  describe('GET /hierarchy', function () {\n+    it('Should render item hierarchy view according to item hierarchy test case', function (done) {\n+      hierarchyTestCases.forEach(function (item) {","path":"test/routes/hierarchy.js","position":75,"original_position":75,"commit_id":"70ac57533e7e71e92848aa6c16d88b369878e249","original_commit_id":"70ac57533e7e71e92848aa6c16d88b369878e249","user":{"login":"chances","id":635049,"avatar_url":"https://avatars.githubusercontent.com/u/635049?v=3","gravatar_id":"","url":"https://api.github.com/users/chances","html_url":"https://github.com/chances","followers_url":"https://api.github.com/users/chances/followers","following_url":"https://api.github.com/users/chances/following{/other_user}","gists_url":"https://api.github.com/users/chances/gists{/gist_id}","starred_url":"https://api.github.com/users/chances/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chances/subscriptions","organizations_url":"https://api.github.com/users/chances/orgs","repos_url":"https://api.github.com/users/chances/repos","events_url":"https://api.github.com/users/chances/events{/privacy}","received_events_url":"https://api.github.com/users/chances/received_events","type":"User","site_admin":false},"body":"Should each test case be it's own `it`, like the auth tests?","created_at":"2016-08-04T02:14:47Z","updated_at":"2016-08-04T02:14:47Z","html_url":"https://github.com/RickyV33/JamaTrace/pull/107#discussion_r73453334","pull_request_url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107","_links":{"self":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/comments/73453334"},"html":{"href":"https://github.com/RickyV33/JamaTrace/pull/107#discussion_r73453334"},"pull_request":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107","id":78550201,"html_url":"https://github.com/RickyV33/JamaTrace/pull/107","diff_url":"https://github.com/RickyV33/JamaTrace/pull/107.diff","patch_url":"https://github.com/RickyV33/JamaTrace/pull/107.patch","issue_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues/107","number":107,"state":"open","locked":false,"title":"Hierarchy endpoint","user":{"login":"ibilal","id":6621380,"avatar_url":"https://avatars.githubusercontent.com/u/6621380?v=3","gravatar_id":"","url":"https://api.github.com/users/ibilal","html_url":"https://github.com/ibilal","followers_url":"https://api.github.com/users/ibilal/followers","following_url":"https://api.github.com/users/ibilal/following{/other_user}","gists_url":"https://api.github.com/users/ibilal/gists{/gist_id}","starred_url":"https://api.github.com/users/ibilal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibilal/subscriptions","organizations_url":"https://api.github.com/users/ibilal/orgs","repos_url":"https://api.github.com/users/ibilal/repos","events_url":"https://api.github.com/users/ibilal/events{/privacy}","received_events_url":"https://api.github.com/users/ibilal/received_events","type":"User","site_admin":false},"body":"hierarchy endpoint with tests validating GET was successful, and renders hierarchy view successfully with appropriate elements. ","created_at":"2016-07-22T22:42:32Z","updated_at":"2016-08-04T02:14:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d1efa2717eb0fc0495b5194d8d647b61ec33941","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107/commits","review_comments_url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107/comments","review_comment_url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues/107/comments","statuses_url":"https://api.github.com/repos/RickyV33/JamaTrace/statuses/70ac57533e7e71e92848aa6c16d88b369878e249","head":{"label":"RickyV33:hierarchy-endpoint","ref":"hierarchy-endpoint","sha":"70ac57533e7e71e92848aa6c16d88b369878e249","user":{"login":"RickyV33","id":5842804,"avatar_url":"https://avatars.githubusercontent.com/u/5842804?v=3","gravatar_id":"","url":"https://api.github.com/users/RickyV33","html_url":"https://github.com/RickyV33","followers_url":"https://api.github.com/users/RickyV33/followers","following_url":"https://api.github.com/users/RickyV33/following{/other_user}","gists_url":"https://api.github.com/users/RickyV33/gists{/gist_id}","starred_url":"https://api.github.com/users/RickyV33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RickyV33/subscriptions","organizations_url":"https://api.github.com/users/RickyV33/orgs","repos_url":"https://api.github.com/users/RickyV33/repos","events_url":"https://api.github.com/users/RickyV33/events{/privacy}","received_events_url":"https://api.github.com/users/RickyV33/received_events","type":"User","site_admin":false},"repo":{"id":57909862,"name":"JamaTrace","full_name":"RickyV33/JamaTrace","owner":{"login":"RickyV33","id":5842804,"avatar_url":"https://avatars.githubusercontent.com/u/5842804?v=3","gravatar_id":"","url":"https://api.github.com/users/RickyV33","html_url":"https://github.com/RickyV33","followers_url":"https://api.github.com/users/RickyV33/followers","following_url":"https://api.github.com/users/RickyV33/following{/other_user}","gists_url":"https://api.github.com/users/RickyV33/gists{/gist_id}","starred_url":"https://api.github.com/users/RickyV33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RickyV33/subscriptions","organizations_url":"https://api.github.com/users/RickyV33/orgs","repos_url":"https://api.github.com/users/RickyV33/repos","events_url":"https://api.github.com/users/RickyV33/events{/privacy}","received_events_url":"https://api.github.com/users/RickyV33/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RickyV33/JamaTrace","description":"Capstone project for Jama Software that provides a graphical representation of customer requirement relationships.","fork":false,"url":"https://api.github.com/repos/RickyV33/JamaTrace","forks_url":"https://api.github.com/repos/RickyV33/JamaTrace/forks","keys_url":"https://api.github.com/repos/RickyV33/JamaTrace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RickyV33/JamaTrace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RickyV33/JamaTrace/teams","hooks_url":"https://api.github.com/repos/RickyV33/JamaTrace/hooks","issue_events_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues/events{/number}","events_url":"https://api.github.com/repos/RickyV33/JamaTrace/events","assignees_url":"https://api.github.com/repos/RickyV33/JamaTrace/assignees{/user}","branches_url":"https://api.github.com/repos/RickyV33/JamaTrace/branches{/branch}","tags_url":"https://api.github.com/repos/RickyV33/JamaTrace/tags","blobs_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/refs{/sha}","trees_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RickyV33/JamaTrace/statuses/{sha}","languages_url":"https://api.github.com/repos/RickyV33/JamaTrace/languages","stargazers_url":"https://api.github.com/repos/RickyV33/JamaTrace/stargazers","contributors_url":"https://api.github.com/repos/RickyV33/JamaTrace/contributors","subscribers_url":"https://api.github.com/repos/RickyV33/JamaTrace/subscribers","subscription_url":"https://api.github.com/repos/RickyV33/JamaTrace/subscription","commits_url":"https://api.github.com/repos/RickyV33/JamaTrace/commits{/sha}","git_commits_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/commits{/sha}","comments_url":"https://api.github.com/repos/RickyV33/JamaTrace/comments{/number}","issue_comment_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues/comments{/number}","contents_url":"https://api.github.com/repos/RickyV33/JamaTrace/contents/{+path}","compare_url":"https://api.github.com/repos/RickyV33/JamaTrace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RickyV33/JamaTrace/merges","archive_url":"https://api.github.com/repos/RickyV33/JamaTrace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RickyV33/JamaTrace/downloads","issues_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues{/number}","pulls_url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls{/number}","milestones_url":"https://api.github.com/repos/RickyV33/JamaTrace/milestones{/number}","notifications_url":"https://api.github.com/repos/RickyV33/JamaTrace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RickyV33/JamaTrace/labels{/name}","releases_url":"https://api.github.com/repos/RickyV33/JamaTrace/releases{/id}","deployments_url":"https://api.github.com/repos/RickyV33/JamaTrace/deployments","created_at":"2016-05-02T18:04:14Z","updated_at":"2016-07-23T01:33:12Z","pushed_at":"2016-08-04T02:02:27Z","git_url":"git://github.com/RickyV33/JamaTrace.git","ssh_url":"git@github.com:RickyV33/JamaTrace.git","clone_url":"https://github.com/RickyV33/JamaTrace.git","svn_url":"https://github.com/RickyV33/JamaTrace","homepage":"","size":791,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":27,"forks":2,"open_issues":27,"watchers":0,"default_branch":"master"}},"base":{"label":"RickyV33:development","ref":"development","sha":"2a2ebc721279373b0ed58cb632863634597cb500","user":{"login":"RickyV33","id":5842804,"avatar_url":"https://avatars.githubusercontent.com/u/5842804?v=3","gravatar_id":"","url":"https://api.github.com/users/RickyV33","html_url":"https://github.com/RickyV33","followers_url":"https://api.github.com/users/RickyV33/followers","following_url":"https://api.github.com/users/RickyV33/following{/other_user}","gists_url":"https://api.github.com/users/RickyV33/gists{/gist_id}","starred_url":"https://api.github.com/users/RickyV33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RickyV33/subscriptions","organizations_url":"https://api.github.com/users/RickyV33/orgs","repos_url":"https://api.github.com/users/RickyV33/repos","events_url":"https://api.github.com/users/RickyV33/events{/privacy}","received_events_url":"https://api.github.com/users/RickyV33/received_events","type":"User","site_admin":false},"repo":{"id":57909862,"name":"JamaTrace","full_name":"RickyV33/JamaTrace","owner":{"login":"RickyV33","id":5842804,"avatar_url":"https://avatars.githubusercontent.com/u/5842804?v=3","gravatar_id":"","url":"https://api.github.com/users/RickyV33","html_url":"https://github.com/RickyV33","followers_url":"https://api.github.com/users/RickyV33/followers","following_url":"https://api.github.com/users/RickyV33/following{/other_user}","gists_url":"https://api.github.com/users/RickyV33/gists{/gist_id}","starred_url":"https://api.github.com/users/RickyV33/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RickyV33/subscriptions","organizations_url":"https://api.github.com/users/RickyV33/orgs","repos_url":"https://api.github.com/users/RickyV33/repos","events_url":"https://api.github.com/users/RickyV33/events{/privacy}","received_events_url":"https://api.github.com/users/RickyV33/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RickyV33/JamaTrace","description":"Capstone project for Jama Software that provides a graphical representation of customer requirement relationships.","fork":false,"url":"https://api.github.com/repos/RickyV33/JamaTrace","forks_url":"https://api.github.com/repos/RickyV33/JamaTrace/forks","keys_url":"https://api.github.com/repos/RickyV33/JamaTrace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RickyV33/JamaTrace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RickyV33/JamaTrace/teams","hooks_url":"https://api.github.com/repos/RickyV33/JamaTrace/hooks","issue_events_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues/events{/number}","events_url":"https://api.github.com/repos/RickyV33/JamaTrace/events","assignees_url":"https://api.github.com/repos/RickyV33/JamaTrace/assignees{/user}","branches_url":"https://api.github.com/repos/RickyV33/JamaTrace/branches{/branch}","tags_url":"https://api.github.com/repos/RickyV33/JamaTrace/tags","blobs_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/refs{/sha}","trees_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RickyV33/JamaTrace/statuses/{sha}","languages_url":"https://api.github.com/repos/RickyV33/JamaTrace/languages","stargazers_url":"https://api.github.com/repos/RickyV33/JamaTrace/stargazers","contributors_url":"https://api.github.com/repos/RickyV33/JamaTrace/contributors","subscribers_url":"https://api.github.com/repos/RickyV33/JamaTrace/subscribers","subscription_url":"https://api.github.com/repos/RickyV33/JamaTrace/subscription","commits_url":"https://api.github.com/repos/RickyV33/JamaTrace/commits{/sha}","git_commits_url":"https://api.github.com/repos/RickyV33/JamaTrace/git/commits{/sha}","comments_url":"https://api.github.com/repos/RickyV33/JamaTrace/comments{/number}","issue_comment_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues/comments{/number}","contents_url":"https://api.github.com/repos/RickyV33/JamaTrace/contents/{+path}","compare_url":"https://api.github.com/repos/RickyV33/JamaTrace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RickyV33/JamaTrace/merges","archive_url":"https://api.github.com/repos/RickyV33/JamaTrace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RickyV33/JamaTrace/downloads","issues_url":"https://api.github.com/repos/RickyV33/JamaTrace/issues{/number}","pulls_url":"https://api.github.com/repos/RickyV33/JamaTrace/pulls{/number}","milestones_url":"https://api.github.com/repos/RickyV33/JamaTrace/milestones{/number}","notifications_url":"https://api.github.com/repos/RickyV33/JamaTrace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RickyV33/JamaTrace/labels{/name}","releases_url":"https://api.github.com/repos/RickyV33/JamaTrace/releases{/id}","deployments_url":"https://api.github.com/repos/RickyV33/JamaTrace/deployments","created_at":"2016-05-02T18:04:14Z","updated_at":"2016-07-23T01:33:12Z","pushed_at":"2016-08-04T02:02:27Z","git_url":"git://github.com/RickyV33/JamaTrace.git","ssh_url":"git@github.com:RickyV33/JamaTrace.git","clone_url":"https://github.com/RickyV33/JamaTrace.git","svn_url":"https://github.com/RickyV33/JamaTrace","homepage":"","size":791,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":27,"forks":2,"open_issues":27,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107"},"html":{"href":"https://github.com/RickyV33/JamaTrace/pull/107"},"issue":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/issues/107"},"comments":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/RickyV33/JamaTrace/statuses/70ac57533e7e71e92848aa6c16d88b369878e249"}}}}
{"actor":{"display_login":"chances"}}