{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/comments/58890267","id":58890267,"diff_hunk":"@@ -4,29 +4,107 @@\n \n const expect = require('chai').expect;\n const requestResponse = require('./lib/request-response');\n-const CurrentNav = require('../../../server/transforms/current-nav')();\n+const Subject = require('../../../server/transforms/current-nav')();\n+const fixture = require('../../fixtures/nav');\n \n describe('Current Nav transform', () => {\n \n-\tlet res;\n \tlet subject;\n+\tlet res;\n \n \tbeforeEach(() => {\n-\t\tsubject = new CurrentNav();\n+\t\tsubject = new Subject();\n+\t\tres = requestResponse()[1];\n+\n+\t\tres.locals.nav = fixture;\n \t});\n \n-\tdescribe('transforms the response', () => {\n+\tit('should just get the children of the top level', () => {\n+\t\tres.templateData.conceptId = 'Mjk=-U2VjdGlvbnM=';\n+\t\t\n+\t\tsubject.post(res);\n+\t\t\n+\t\texpect(res.templateData.currentNav).to.deep.equal({\n+\t\t\tchildren: [\n+\t\t\t\t{\n+\t\t\t\t\t\"name\": \"Energy\",\n+\t\t\t\t\t\"id\": \"MzA=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\"href\": \"/stream/sectionsId/MzA=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\"children\": [\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\"name\": \"Mining\",\n+\t\t\t\t\t\t\t\"id\": \"MzE=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\t\t\"href\": \"/stream/sectionsId/MzE=-U2VjdGlvbnM=\"\n+\t\t\t\t\t\t},\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\"name\": \"Oil & Gas\",\n+\t\t\t\t\t\t\t\"id\": \"MzI=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\t\t\"href\": \"/stream/sectionsId/MzI=-U2VjdGlvbnM=\"\n+\t\t\t\t\t\t},\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\"name\": \"Utilities\",\n+\t\t\t\t\t\t\t\"id\": \"MzM=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\t\t\"href\": \"/stream/sectionsId/MzM=-U2VjdGlvbnM=\"\n+\t\t\t\t\t\t}\n+\t\t\t\t\t]\n+\t\t\t\t}\n+\t\t\t]\n+\t\t});\n+\t});\n \n-\t\tbeforeEach(() => {\n-\t\t\tres = requestResponse()[1];\n-\t\t\tres.locals.nav = [];\n-\t\t\tsubject.post(res);\n+\tit('should get the children and parent of the second level', () => {\n+\t\tres.templateData.conceptId = 'MzA=-U2VjdGlvbnM=';\n+\t\t\n+\t\tsubject.post(res);\n+\t\t\n+\t\texpect(res.templateData.currentNav).to.deep.equal({\n+\t\t\tparent: {\n+\t\t\t\t\"name\": \"Companies\",\n+\t\t\t\t\"id\": \"Mjk=-U2VjdGlvbnM=\",\n+\t\t\t\t\"href\": \"/stream/sectionsId/Mjk=-U2VjdGlvbnM=\",\n+\t\t\t},\n+\t\t\tchildren: [\n+\t\t\t\t{\n+\t\t\t\t\t\"name\": \"Mining\",\n+\t\t\t\t\t\"id\": \"MzE=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\"href\": \"/stream/sectionsId/MzE=-U2VjdGlvbnM=\"\n+\t\t\t\t},\n+\t\t\t\t{\n+\t\t\t\t\t\"name\": \"Oil & Gas\",\n+\t\t\t\t\t\"id\": \"MzI=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\"href\": \"/stream/sectionsId/MzI=-U2VjdGlvbnM=\"\n+\t\t\t\t},\n+\t\t\t\t{\n+\t\t\t\t\t\"name\": \"Utilities\",\n+\t\t\t\t\t\"id\": \"MzM=-U2VjdGlvbnM=\",\n+\t\t\t\t\t\"href\": \"/stream/sectionsId/MzM=-U2VjdGlvbnM=\"\n+\t\t\t\t}\n+\t\t\t]\n \t\t});\n+\t});\n+\t\n+\t// TODO (Ben): Clarify regarding replacing this with the false result\n \n-\t\tit('adds a current nav component', () => {\n-\t\t\texpect(res.templateData.currentNav).to.exist;\n-\t\t})\n+\t// it('should just get the parent of the last level', () => {\n+\t// \tres.templateData.conceptId = 'MzM=-U2VjdGlvbnM=';\n+\t//\n+\t// \tsubject.post(res);\n+\t//\n+\t// \texpect(res.templateData.currentNav).to.deep.equal({\n+\t// \t\tparent: {\n+\t// \t\t\t\"name\": \"Energy\",\n+\t// \t\t\t\"id\": \"MzA=-U2VjdGlvbnM=\",\n+\t// \t\t\t\"href\": \"/stream/sectionsId/MzA=-U2VjdGlvbnM=\"\n+\t// \t\t}\n+\t// \t});\n+\t// });\n ","path":"test/server/transforms/current-nav.test.js","position":109,"original_position":109,"commit_id":"2ecd0b36e7d2a79b98754c681208b88eaf37ae14","original_commit_id":"2ecd0b36e7d2a79b98754c681208b88eaf37ae14","user":{"login":"bjfletcher","id":733849,"avatar_url":"https://avatars.githubusercontent.com/u/733849?v=3","gravatar_id":"","url":"https://api.github.com/users/bjfletcher","html_url":"https://github.com/bjfletcher","followers_url":"https://api.github.com/users/bjfletcher/followers","following_url":"https://api.github.com/users/bjfletcher/following{/other_user}","gists_url":"https://api.github.com/users/bjfletcher/gists{/gist_id}","starred_url":"https://api.github.com/users/bjfletcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjfletcher/subscriptions","organizations_url":"https://api.github.com/users/bjfletcher/orgs","repos_url":"https://api.github.com/users/bjfletcher/repos","events_url":"https://api.github.com/users/bjfletcher/events{/privacy}","received_events_url":"https://api.github.com/users/bjfletcher/received_events","type":"User","site_admin":false},"body":"@i-like-robots See the line over there -> https://github.com/Financial-Times/next-stream-page/pull/1006/files#diff-a6a5ae09b99ba92a0a7d6ada3fdfeb53L10 and the TODO above that. That means the test here (above) fails. What should we do about this? If the logic is right, then is it ok to remove the test above? Do you envision us needing the above test again in the future?","created_at":"2016-04-07T15:20:59Z","updated_at":"2016-04-07T15:20:59Z","html_url":"https://github.com/Financial-Times/next-stream-page/pull/1006#discussion_r58890267","pull_request_url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/comments/58890267"},"html":{"href":"https://github.com/Financial-Times/next-stream-page/pull/1006#discussion_r58890267"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006","id":65647501,"html_url":"https://github.com/Financial-Times/next-stream-page/pull/1006","diff_url":"https://github.com/Financial-Times/next-stream-page/pull/1006.diff","patch_url":"https://github.com/Financial-Times/next-stream-page/pull/1006.patch","issue_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/1006","number":1006,"state":"open","locked":false,"title":"Integrate modules into transforms and new tests","user":{"login":"bjfletcher","id":733849,"avatar_url":"https://avatars.githubusercontent.com/u/733849?v=3","gravatar_id":"","url":"https://api.github.com/users/bjfletcher","html_url":"https://github.com/bjfletcher","followers_url":"https://api.github.com/users/bjfletcher/followers","following_url":"https://api.github.com/users/bjfletcher/following{/other_user}","gists_url":"https://api.github.com/users/bjfletcher/gists{/gist_id}","starred_url":"https://api.github.com/users/bjfletcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjfletcher/subscriptions","organizations_url":"https://api.github.com/users/bjfletcher/orgs","repos_url":"https://api.github.com/users/bjfletcher/repos","events_url":"https://api.github.com/users/bjfletcher/events{/privacy}","received_events_url":"https://api.github.com/users/bjfletcher/received_events","type":"User","site_admin":false},"body":"See https://github.com/Financial-Times/next-stream-page/issues/1000 for all the glory details.","created_at":"2016-04-07T15:14:34Z","updated_at":"2016-04-07T15:20:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05097cbd8b1f5fe40094b13f8ecf0e4dfd8f132f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/1006/comments","statuses_url":"https://api.github.com/repos/Financial-Times/next-stream-page/statuses/2ecd0b36e7d2a79b98754c681208b88eaf37ae14","head":{"label":"Financial-Times:bjfletcher/module-to-transform","ref":"bjfletcher/module-to-transform","sha":"2ecd0b36e7d2a79b98754c681208b88eaf37ae14","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":24595604,"name":"next-stream-page","full_name":"Financial-Times/next-stream-page","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-stream-page","description":"Streams","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-stream-page","forks_url":"https://api.github.com/repos/Financial-Times/next-stream-page/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-stream-page/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-stream-page/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-stream-page/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-stream-page/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-stream-page/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-stream-page/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-stream-page/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-stream-page/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-stream-page/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-stream-page/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-stream-page/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-stream-page/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-stream-page/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-stream-page/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-stream-page/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-stream-page/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-stream-page/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-stream-page/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-stream-page/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-stream-page/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-stream-page/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-stream-page/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-stream-page/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-stream-page/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-stream-page/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-stream-page/deployments","created_at":"2014-09-29T13:09:59Z","updated_at":"2016-04-05T10:02:31Z","pushed_at":"2016-04-07T15:14:35Z","git_url":"git://github.com/Financial-Times/next-stream-page.git","ssh_url":"git@github.com:Financial-Times/next-stream-page.git","clone_url":"https://github.com/Financial-Times/next-stream-page.git","svn_url":"https://github.com/Financial-Times/next-stream-page","homepage":"","size":7019,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":14,"forks":2,"open_issues":14,"watchers":2,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"354ed838bae8ccfcc08195764fd8fe21a4492bb3","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":24595604,"name":"next-stream-page","full_name":"Financial-Times/next-stream-page","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-stream-page","description":"Streams","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-stream-page","forks_url":"https://api.github.com/repos/Financial-Times/next-stream-page/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-stream-page/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-stream-page/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-stream-page/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-stream-page/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-stream-page/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-stream-page/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-stream-page/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-stream-page/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-stream-page/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-stream-page/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-stream-page/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-stream-page/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-stream-page/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-stream-page/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-stream-page/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-stream-page/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-stream-page/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-stream-page/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-stream-page/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-stream-page/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-stream-page/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-stream-page/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-stream-page/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-stream-page/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-stream-page/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-stream-page/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-stream-page/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-stream-page/deployments","created_at":"2014-09-29T13:09:59Z","updated_at":"2016-04-05T10:02:31Z","pushed_at":"2016-04-07T15:14:35Z","git_url":"git://github.com/Financial-Times/next-stream-page.git","ssh_url":"git@github.com:Financial-Times/next-stream-page.git","clone_url":"https://github.com/Financial-Times/next-stream-page.git","svn_url":"https://github.com/Financial-Times/next-stream-page","homepage":"","size":7019,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":14,"forks":2,"open_issues":14,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006"},"html":{"href":"https://github.com/Financial-Times/next-stream-page/pull/1006"},"issue":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/1006"},"comments":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/issues/1006/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/pulls/1006/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/next-stream-page/statuses/2ecd0b36e7d2a79b98754c681208b88eaf37ae14"}}}}