{"action":"created","comment":{"url":"https://api.github.com/repos/hypothesis/h/pulls/comments/24171564","id":24171564,"diff_hunk":"@@ -0,0 +1,205 @@\n+assert = chai.assert\n+\n+class FakeHighlight\n+\n+  constructor: (@segment, @anchor, @page) ->\n+\n+  @createFrom: (segment, anchor, page) ->\n+    new FakeHighlight segment, anchor, page\n+\n+# Since the system for registering highlight types have been obliterated,\n+# for now, we will do a hard override of the TextHighlight class\n+Annotator.TextHighlight = FakeHighlight\n+\n+class FakeAnchor extends Annotator.Anchor\n+\n+  _getSegment: -> \"html segment for \" + @id\n+\n+  constructor: (manager, annotation, target) ->\n+    super manager, annotation, target, 0, 0,\n+      \"fake quote for\" + target.id\n+\n+    @id = \"fake anchor for \" + target.id\n+\n+describe 'Annotator.Plugin.EnhancedAnchoring', ->\n+  am = null\n+  annotator = null\n+  data = null\n+  ann1 = null\n+  ann2 = null\n+  ann3 = null\n+  target11 = null\n+  target12 = null\n+  target2 = null\n+  target3 = null\n+  anchor11 = null\n+  anchor12 = null\n+  anchor2 = null\n+  anchor3 = null\n+  hl11 = null\n+  hl12 = null\n+  hl2 = null\n+  hl3 = null\n+\n+  initAnchoring = ->\n+    annotator =\n+      publish: (event) ->\n+\n+    am = new Annotator.Plugin.EnhancedAnchoring()\n+    am.annotator = annotator\n+    am.pluginInit()\n+\n+    am._chooseAccessPolicy()\n+\n+    am.strategies.push\n+      name: \"dummy anchoring strategy\"\n+      code: (annotation, target) ->\n+        new FakeAnchor am,annotation, target\n+\n+    am\n+\n+  addDummyData = ->\n+    target11 =\n+      id: \"target 1.1\"\n+    target12 =\n+      id: \"target 1.2\"\n+    target2 =\n+      id: \"target 2\"\n+    target3 =\n+      id: \"target 3\"\n+    ann1 =\n+      id: \"annotation 1\"\n+      anchors: []\n+    ann2 =\n+      id: \"annotation 2\"\n+      anchors: []\n+    ann3 =\n+      id: \"annotation 3\"\n+      anchors: []\n+\n+    ann1.target = [target11, target12]\n+    ann2.target = [target2]\n+    ann3.target = [target3]\n+\n+    anchor11 = am.createAnchor(ann1, target11).result\n+    anchor12 = am.createAnchor(ann1, target12).result\n+    anchor2 = am.createAnchor(ann2, target2).result\n+    anchor3 = am.createAnchor(ann3, target3).result\n+\n+    hl11 = anchor11.highlight[0]\n+    hl12 = anchor12.highlight[0]\n+    hl2 = anchor2.highlight[0]\n+    hl3 = anchor3.highlight[0]\n+\n+  describe \"Basics\", ->\n+\n+    beforeEach ->\n+      initAnchoring()\n+      addDummyData()\n+\n+    it 'can be initialized', ->\n+      assert.ok(am)","path":"tests/js/plugin/enhancedanchoring-test.coffee","position":null,"original_position":101,"commit_id":"88039a4b16dc0db1b33c49c19e3212cf5c0df3e0","original_commit_id":"3bb45100e4f33f634d2c4570c14f8a319cd77515","user":{"login":"csillag","id":2093792,"avatar_url":"https://avatars.githubusercontent.com/u/2093792?v=3","gravatar_id":"","url":"https://api.github.com/users/csillag","html_url":"https://github.com/csillag","followers_url":"https://api.github.com/users/csillag/followers","following_url":"https://api.github.com/users/csillag/following{/other_user}","gists_url":"https://api.github.com/users/csillag/gists{/gist_id}","starred_url":"https://api.github.com/users/csillag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csillag/subscriptions","organizations_url":"https://api.github.com/users/csillag/orgs","repos_url":"https://api.github.com/users/csillag/repos","events_url":"https://api.github.com/users/csillag/events{/privacy}","received_events_url":"https://api.github.com/users/csillag/received_events","type":"User","site_admin":false},"body":"On 2015-02-05 16:29, Aron Carroll wrote:\n> No need to test this, the whole suite is going to blow up if this\n> object isn't available. \n\nRemoved.\n\n\n","created_at":"2015-02-05T15:44:04Z","updated_at":"2015-02-05T15:44:04Z","html_url":"https://github.com/hypothesis/h/pull/1911#discussion_r24171564","pull_request_url":"https://api.github.com/repos/hypothesis/h/pulls/1911","_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments/24171564"},"html":{"href":"https://github.com/hypothesis/h/pull/1911#discussion_r24171564"},"pull_request":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1911"}}},"pull_request":{"url":"https://api.github.com/repos/hypothesis/h/pulls/1911","id":28730380,"html_url":"https://github.com/hypothesis/h/pull/1911","diff_url":"https://github.com/hypothesis/h/pull/1911.diff","patch_url":"https://github.com/hypothesis/h/pull/1911.patch","issue_url":"https://api.github.com/repos/hypothesis/h/issues/1911","number":1911,"state":"open","locked":false,"title":"Add a few test cases for Enhanced Anchoring","user":{"login":"csillag","id":2093792,"avatar_url":"https://avatars.githubusercontent.com/u/2093792?v=3","gravatar_id":"","url":"https://api.github.com/users/csillag","html_url":"https://github.com/csillag","followers_url":"https://api.github.com/users/csillag/followers","following_url":"https://api.github.com/users/csillag/following{/other_user}","gists_url":"https://api.github.com/users/csillag/gists{/gist_id}","starred_url":"https://api.github.com/users/csillag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csillag/subscriptions","organizations_url":"https://api.github.com/users/csillag/orgs","repos_url":"https://api.github.com/users/csillag/repos","events_url":"https://api.github.com/users/csillag/events{/privacy}","received_events_url":"https://api.github.com/users/csillag/received_events","type":"User","site_admin":false},"body":"\r\n... and do some minimal refactoring that was required for testing.","created_at":"2015-02-05T14:54:58Z","updated_at":"2015-02-05T15:44:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f9b9679ab171aa743fe0fdd7254fe6784d0e559","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hypothesis/h/pulls/1911/commits","review_comments_url":"https://api.github.com/repos/hypothesis/h/pulls/1911/comments","review_comment_url":"https://api.github.com/repos/hypothesis/h/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hypothesis/h/issues/1911/comments","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/88039a4b16dc0db1b33c49c19e3212cf5c0df3e0","head":{"label":"hypothesis:anchoring-testing","ref":"anchoring-testing","sha":"88039a4b16dc0db1b33c49c19e3212cf5c0df3e0","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"The Internet, peer reviewed.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments/{number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","created_at":"2012-04-02T19:56:59Z","updated_at":"2015-02-05T11:47:37Z","pushed_at":"2015-02-05T15:43:39Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":40601,"stargazers_count":375,"watchers_count":375,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":147,"forks":94,"open_issues":147,"watchers":375,"default_branch":"master"}},"base":{"label":"hypothesis:master","ref":"master","sha":"1dda4a4d01fbc06988a4449cdcaf4c8712c82107","user":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"repo":{"id":3910945,"name":"h","full_name":"hypothesis/h","owner":{"login":"hypothesis","id":1243215,"avatar_url":"https://avatars.githubusercontent.com/u/1243215?v=3","gravatar_id":"","url":"https://api.github.com/users/hypothesis","html_url":"https://github.com/hypothesis","followers_url":"https://api.github.com/users/hypothesis/followers","following_url":"https://api.github.com/users/hypothesis/following{/other_user}","gists_url":"https://api.github.com/users/hypothesis/gists{/gist_id}","starred_url":"https://api.github.com/users/hypothesis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypothesis/subscriptions","organizations_url":"https://api.github.com/users/hypothesis/orgs","repos_url":"https://api.github.com/users/hypothesis/repos","events_url":"https://api.github.com/users/hypothesis/events{/privacy}","received_events_url":"https://api.github.com/users/hypothesis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hypothesis/h","description":"The Internet, peer reviewed.","fork":false,"url":"https://api.github.com/repos/hypothesis/h","forks_url":"https://api.github.com/repos/hypothesis/h/forks","keys_url":"https://api.github.com/repos/hypothesis/h/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypothesis/h/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypothesis/h/teams","hooks_url":"https://api.github.com/repos/hypothesis/h/hooks","issue_events_url":"https://api.github.com/repos/hypothesis/h/issues/events{/number}","events_url":"https://api.github.com/repos/hypothesis/h/events","assignees_url":"https://api.github.com/repos/hypothesis/h/assignees{/user}","branches_url":"https://api.github.com/repos/hypothesis/h/branches{/branch}","tags_url":"https://api.github.com/repos/hypothesis/h/tags","blobs_url":"https://api.github.com/repos/hypothesis/h/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypothesis/h/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypothesis/h/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypothesis/h/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypothesis/h/statuses/{sha}","languages_url":"https://api.github.com/repos/hypothesis/h/languages","stargazers_url":"https://api.github.com/repos/hypothesis/h/stargazers","contributors_url":"https://api.github.com/repos/hypothesis/h/contributors","subscribers_url":"https://api.github.com/repos/hypothesis/h/subscribers","subscription_url":"https://api.github.com/repos/hypothesis/h/subscription","commits_url":"https://api.github.com/repos/hypothesis/h/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypothesis/h/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypothesis/h/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypothesis/h/issues/comments/{number}","contents_url":"https://api.github.com/repos/hypothesis/h/contents/{+path}","compare_url":"https://api.github.com/repos/hypothesis/h/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypothesis/h/merges","archive_url":"https://api.github.com/repos/hypothesis/h/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypothesis/h/downloads","issues_url":"https://api.github.com/repos/hypothesis/h/issues{/number}","pulls_url":"https://api.github.com/repos/hypothesis/h/pulls{/number}","milestones_url":"https://api.github.com/repos/hypothesis/h/milestones{/number}","notifications_url":"https://api.github.com/repos/hypothesis/h/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypothesis/h/labels{/name}","releases_url":"https://api.github.com/repos/hypothesis/h/releases{/id}","created_at":"2012-04-02T19:56:59Z","updated_at":"2015-02-05T11:47:37Z","pushed_at":"2015-02-05T15:43:39Z","git_url":"git://github.com/hypothesis/h.git","ssh_url":"git@github.com:hypothesis/h.git","clone_url":"https://github.com/hypothesis/h.git","svn_url":"https://github.com/hypothesis/h","homepage":"https://hypothes.is/","size":40601,"stargazers_count":375,"watchers_count":375,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":147,"forks":94,"open_issues":147,"watchers":375,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1911"},"html":{"href":"https://github.com/hypothesis/h/pull/1911"},"issue":{"href":"https://api.github.com/repos/hypothesis/h/issues/1911"},"comments":{"href":"https://api.github.com/repos/hypothesis/h/issues/1911/comments"},"review_comments":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1911/comments"},"review_comment":{"href":"https://api.github.com/repos/hypothesis/h/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hypothesis/h/pulls/1911/commits"},"statuses":{"href":"https://api.github.com/repos/hypothesis/h/statuses/88039a4b16dc0db1b33c49c19e3212cf5c0df3e0"}}}}