{"action":"created","comment":{"url":"https://api.github.com/repos/atom/atom/pulls/comments/27991041","id":27991041,"diff_hunk":"@@ -0,0 +1,132 @@\n+CustomGutterComponent = require '../src/custom-gutter-component'\n+Gutter = require '../src/gutter'\n+\n+describe \"CustomGutterComponent\", ->\n+  [customGutterComponent, gutter] = []\n+\n+  beforeEach ->\n+    mockGutterContainer = {}\n+    gutter = new Gutter(mockGutterContainer, {name: 'test-gutter'})\n+    customGutterComponent = new CustomGutterComponent({gutter})\n+\n+  it \"creates a gutter DOM node with only an empty 'custom-decorations' child node when it is initialized\", ->\n+    expect(customGutterComponent.getDomNode().classList.contains('gutter')).toBe true\n+    expect(customGutterComponent.getDomNode().getAttribute('gutter-name')).toBe 'test-gutter'\n+    expect(customGutterComponent.getDomNode().children.length).toBe 1\n+    decorationsWrapperNode = customGutterComponent.getDomNode().children.item(0)\n+    expect(decorationsWrapperNode.classList.contains('custom-decorations')).toBe true\n+\n+  it \"makes its view accessible from the view registry\", ->\n+    expect(customGutterComponent.getDomNode()).toBe atom.views.getView(gutter)\n+\n+  it \"hides its DOM node when ::hideNode is called, and shows its DOM node when ::showNode is called\", ->","path":"spec/custom-gutter-component-spec.coffee","position":22,"original_position":22,"commit_id":"e68735bfa49e369b7721358363b9e2bb99918496","original_commit_id":"e68735bfa49e369b7721358363b9e2bb99918496","user":{"login":"nathansobo","id":1789,"avatar_url":"https://avatars.githubusercontent.com/u/1789?v=3","gravatar_id":"","url":"https://api.github.com/users/nathansobo","html_url":"https://github.com/nathansobo","followers_url":"https://api.github.com/users/nathansobo/followers","following_url":"https://api.github.com/users/nathansobo/following{/other_user}","gists_url":"https://api.github.com/users/nathansobo/gists{/gist_id}","starred_url":"https://api.github.com/users/nathansobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathansobo/subscriptions","organizations_url":"https://api.github.com/users/nathansobo/orgs","repos_url":"https://api.github.com/users/nathansobo/repos","events_url":"https://api.github.com/users/nathansobo/events{/privacy}","received_events_url":"https://api.github.com/users/nathansobo/received_events","type":"User","site_admin":true},"body":"Since the component isn't part of the public API, I think you should test this via calling `hide` and `show` on the model.","created_at":"2015-04-08T17:13:52Z","updated_at":"2015-04-08T17:13:52Z","html_url":"https://github.com/atom/atom/pull/5217#discussion_r27991041","pull_request_url":"https://api.github.com/repos/atom/atom/pulls/5217","_links":{"self":{"href":"https://api.github.com/repos/atom/atom/pulls/comments/27991041"},"html":{"href":"https://github.com/atom/atom/pull/5217#discussion_r27991041"},"pull_request":{"href":"https://api.github.com/repos/atom/atom/pulls/5217"}}},"pull_request":{"url":"https://api.github.com/repos/atom/atom/pulls/5217","id":27863543,"html_url":"https://github.com/atom/atom/pull/5217","diff_url":"https://github.com/atom/atom/pull/5217.diff","patch_url":"https://github.com/atom/atom/pull/5217.patch","issue_url":"https://api.github.com/repos/atom/atom/issues/5217","number":5217,"state":"open","locked":false,"title":"[Gutter] Implement API for Creating Custom Gutters","user":{"login":"jssln","id":1017111,"avatar_url":"https://avatars.githubusercontent.com/u/1017111?v=3","gravatar_id":"","url":"https://api.github.com/users/jssln","html_url":"https://github.com/jssln","followers_url":"https://api.github.com/users/jssln/followers","following_url":"https://api.github.com/users/jssln/following{/other_user}","gists_url":"https://api.github.com/users/jssln/gists{/gist_id}","starred_url":"https://api.github.com/users/jssln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jssln/subscriptions","organizations_url":"https://api.github.com/users/jssln/orgs","repos_url":"https://api.github.com/users/jssln/repos","events_url":"https://api.github.com/users/jssln/events{/privacy}","received_events_url":"https://api.github.com/users/jssln/received_events","type":"User","site_admin":false},"body":"Summary: This implements the gutter API described in https://github.com/atom/atom/issues/5038.\r\n\r\nTest Plan: Added unit tests. Tested manually as well -- if you rebase before the commit \"Remove test-only CSS\", there is some default CSS that makes gutters and decorations obviously visible when you add them via commands in the console. Example test commands, on top of this default CSS:\r\n\r\n```javascript\r\nvar e = atom.workspace.getActiveEditor()\r\nvar g = e.addGutter({name: 'test'})\r\n\r\nvar m = e.markBufferRange([[1, 0], [10, 0]])\r\nvar d = e.decorateMarker(m, {type: 'gutter', gutterName: 'test', class: 'test-class'})\r\n\r\nvar item = document.createElement('div')\r\nitem.className = 'test-item'\r\nitem.style['background-color'] = 'green'\r\nvar m2 = e.markBufferRange([[12, 0], [20, 0]])\r\nvar di = e.decorateMarker(m2, {type: 'gutter', gutterName: 'test', class: 'test-class', item: item})\r\n```\r\nUpdating:\r\n\r\n```javascript\r\nvar item2 = document.createElement('div')\r\nitem2.className = 'test-item2'\r\nitem2.style['background-color'] = 'red'\r\ndi.setProperties({type: 'gutter', gutterName: 'test', class: 'test-class2', item: item2})\r\n\r\ng.hide()\r\ng.show()\r\ng.destroy()\r\ng = e.addGutter({name: 'test'})\r\n```","created_at":"2015-01-22T18:00:40Z","updated_at":"2015-04-08T17:13:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"951713f0e24f28f3a208a6df05a4c97e7dc10fb6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/atom/atom/pulls/5217/commits","review_comments_url":"https://api.github.com/repos/atom/atom/pulls/5217/comments","review_comment_url":"https://api.github.com/repos/atom/atom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atom/atom/issues/5217/comments","statuses_url":"https://api.github.com/repos/atom/atom/statuses/e68735bfa49e369b7721358363b9e2bb99918496","head":{"label":"jssln:gutter","ref":"gutter","sha":"e68735bfa49e369b7721358363b9e2bb99918496","user":{"login":"jssln","id":1017111,"avatar_url":"https://avatars.githubusercontent.com/u/1017111?v=3","gravatar_id":"","url":"https://api.github.com/users/jssln","html_url":"https://github.com/jssln","followers_url":"https://api.github.com/users/jssln/followers","following_url":"https://api.github.com/users/jssln/following{/other_user}","gists_url":"https://api.github.com/users/jssln/gists{/gist_id}","starred_url":"https://api.github.com/users/jssln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jssln/subscriptions","organizations_url":"https://api.github.com/users/jssln/orgs","repos_url":"https://api.github.com/users/jssln/repos","events_url":"https://api.github.com/users/jssln/events{/privacy}","received_events_url":"https://api.github.com/users/jssln/received_events","type":"User","site_admin":false},"repo":{"id":29616370,"name":"atom","full_name":"jssln/atom","owner":{"login":"jssln","id":1017111,"avatar_url":"https://avatars.githubusercontent.com/u/1017111?v=3","gravatar_id":"","url":"https://api.github.com/users/jssln","html_url":"https://github.com/jssln","followers_url":"https://api.github.com/users/jssln/followers","following_url":"https://api.github.com/users/jssln/following{/other_user}","gists_url":"https://api.github.com/users/jssln/gists{/gist_id}","starred_url":"https://api.github.com/users/jssln/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jssln/subscriptions","organizations_url":"https://api.github.com/users/jssln/orgs","repos_url":"https://api.github.com/users/jssln/repos","events_url":"https://api.github.com/users/jssln/events{/privacy}","received_events_url":"https://api.github.com/users/jssln/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jssln/atom","description":"The hackable editor","fork":true,"url":"https://api.github.com/repos/jssln/atom","forks_url":"https://api.github.com/repos/jssln/atom/forks","keys_url":"https://api.github.com/repos/jssln/atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jssln/atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jssln/atom/teams","hooks_url":"https://api.github.com/repos/jssln/atom/hooks","issue_events_url":"https://api.github.com/repos/jssln/atom/issues/events{/number}","events_url":"https://api.github.com/repos/jssln/atom/events","assignees_url":"https://api.github.com/repos/jssln/atom/assignees{/user}","branches_url":"https://api.github.com/repos/jssln/atom/branches{/branch}","tags_url":"https://api.github.com/repos/jssln/atom/tags","blobs_url":"https://api.github.com/repos/jssln/atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jssln/atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jssln/atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/jssln/atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jssln/atom/statuses/{sha}","languages_url":"https://api.github.com/repos/jssln/atom/languages","stargazers_url":"https://api.github.com/repos/jssln/atom/stargazers","contributors_url":"https://api.github.com/repos/jssln/atom/contributors","subscribers_url":"https://api.github.com/repos/jssln/atom/subscribers","subscription_url":"https://api.github.com/repos/jssln/atom/subscription","commits_url":"https://api.github.com/repos/jssln/atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/jssln/atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/jssln/atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/jssln/atom/issues/comments{/number}","contents_url":"https://api.github.com/repos/jssln/atom/contents/{+path}","compare_url":"https://api.github.com/repos/jssln/atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jssln/atom/merges","archive_url":"https://api.github.com/repos/jssln/atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jssln/atom/downloads","issues_url":"https://api.github.com/repos/jssln/atom/issues{/number}","pulls_url":"https://api.github.com/repos/jssln/atom/pulls{/number}","milestones_url":"https://api.github.com/repos/jssln/atom/milestones{/number}","notifications_url":"https://api.github.com/repos/jssln/atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jssln/atom/labels{/name}","releases_url":"https://api.github.com/repos/jssln/atom/releases{/id}","created_at":"2015-01-21T21:26:02Z","updated_at":"2015-04-08T16:01:45Z","pushed_at":"2015-04-08T16:11:05Z","git_url":"git://github.com/jssln/atom.git","ssh_url":"git@github.com:jssln/atom.git","clone_url":"https://github.com/jssln/atom.git","svn_url":"https://github.com/jssln/atom","homepage":"https://atom.io/","size":264500,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"atom:master","ref":"master","sha":"937fc27f6e3deb4827c87e748b2828be86902059","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":3228505,"name":"atom","full_name":"atom/atom","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/atom","description":"The hackable editor","fork":false,"url":"https://api.github.com/repos/atom/atom","forks_url":"https://api.github.com/repos/atom/atom/forks","keys_url":"https://api.github.com/repos/atom/atom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/atom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/atom/teams","hooks_url":"https://api.github.com/repos/atom/atom/hooks","issue_events_url":"https://api.github.com/repos/atom/atom/issues/events{/number}","events_url":"https://api.github.com/repos/atom/atom/events","assignees_url":"https://api.github.com/repos/atom/atom/assignees{/user}","branches_url":"https://api.github.com/repos/atom/atom/branches{/branch}","tags_url":"https://api.github.com/repos/atom/atom/tags","blobs_url":"https://api.github.com/repos/atom/atom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/atom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/atom/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/atom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/atom/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/atom/languages","stargazers_url":"https://api.github.com/repos/atom/atom/stargazers","contributors_url":"https://api.github.com/repos/atom/atom/contributors","subscribers_url":"https://api.github.com/repos/atom/atom/subscribers","subscription_url":"https://api.github.com/repos/atom/atom/subscription","commits_url":"https://api.github.com/repos/atom/atom/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/atom/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/atom/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/atom/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/atom/contents/{+path}","compare_url":"https://api.github.com/repos/atom/atom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/atom/merges","archive_url":"https://api.github.com/repos/atom/atom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/atom/downloads","issues_url":"https://api.github.com/repos/atom/atom/issues{/number}","pulls_url":"https://api.github.com/repos/atom/atom/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/atom/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/atom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/atom/labels{/name}","releases_url":"https://api.github.com/repos/atom/atom/releases{/id}","created_at":"2012-01-20T18:18:21Z","updated_at":"2015-04-08T16:12:48Z","pushed_at":"2015-04-08T16:40:28Z","git_url":"git://github.com/atom/atom.git","ssh_url":"git@github.com:atom/atom.git","clone_url":"https://github.com/atom/atom.git","svn_url":"https://github.com/atom/atom","homepage":"https://atom.io","size":351459,"stargazers_count":14001,"watchers_count":14001,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2423,"mirror_url":null,"open_issues_count":1044,"forks":2423,"open_issues":1044,"watchers":14001,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom/atom/pulls/5217"},"html":{"href":"https://github.com/atom/atom/pull/5217"},"issue":{"href":"https://api.github.com/repos/atom/atom/issues/5217"},"comments":{"href":"https://api.github.com/repos/atom/atom/issues/5217/comments"},"review_comments":{"href":"https://api.github.com/repos/atom/atom/pulls/5217/comments"},"review_comment":{"href":"https://api.github.com/repos/atom/atom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atom/atom/pulls/5217/commits"},"statuses":{"href":"https://api.github.com/repos/atom/atom/statuses/e68735bfa49e369b7721358363b9e2bb99918496"}}}}