{"action":"created","comment":{"url":"https://api.github.com/repos/palantir/plottable/pulls/comments/37901816","id":37901816,"diff_hunk":"@@ -1,193 +1,244 @@\n ///<reference path=\"../testReference.ts\" />\n \n-describe(\"SelectionBoxLayer\", () => {\n-  it(\"boxVisible()\", () => {\n-    let svg = TestMethods.generateSVG();\n-    let sbl = new Plottable.Components.SelectionBoxLayer();\n-    sbl.renderTo(svg);\n+describe(\"Interactive Components\", () => {\n+  describe(\"SelectionBoxLayer\", () => {\n+\n+    describe(\"Basic Usage\", () => {\n+      let svgWidth = 500;\n+      let svgHeight = 500;\n+\n+      let svg: d3.Selection<void>;\n+      let sbl: Plottable.Components.SelectionBoxLayer;\n+\n+      beforeEach(() => {\n+        svg = TestMethods.generateSVG(svgWidth, svgHeight);\n+        sbl = new Plottable.Components.SelectionBoxLayer();\n+      });\n+\n+      it(\"can get and set the boxVisible() property\", () => {\n+        assert.strictEqual(sbl.boxVisible(), false, \"The box is not visible by default\");\n+\n+        sbl.renderTo(svg);\n+        assert.strictEqual(sbl.boxVisible(), false, \"The box is not visible by default after rendering to svg\");\n+\n+        assert.strictEqual(sbl.boxVisible(true), sbl, \"Setting the boxVisible attribute returns the selection box layer\");\n+        assert.strictEqual(sbl.boxVisible(), true, \"Setting the boxVisible to true attribute works\");\n+        sbl.boxVisible(false);\n+        assert.strictEqual(sbl.boxVisible(), false, \"Setting the boxVisible attribute to false works\");\n+\n+        svg.remove();\n+      });\n+\n+      it(\"renders the box in accordance to boxVisible() property\", () => {\n+        sbl.renderTo(svg);\n+\n+        let selectionBox = svg.select(\".selection-box\");\n+        assert.isTrue(selectionBox.empty(), \"initilizes without box in DOM\");\n+\n+        sbl.boxVisible(true);\n+        selectionBox = svg.select(\".selection-box\");\n+        assert.isFalse(selectionBox.empty(), \"box is inserted in DOM when showing\");\n+\n+        sbl.boxVisible(false);\n+        selectionBox = svg.select(\".selection-box\");\n+        assert.isTrue(selectionBox.empty(), \"box is removed from DOM when not showing\");\n+\n+        svg.remove();\n+      });\n+\n+      it(\"does not error on destroy() when scales are not inputted\", () => {\n+        sbl.renderTo(svg);\n+        assert.doesNotThrow(() => sbl.destroy(), Error, \"can destroy even with no scales\");\n+\n+        svg.remove();\n+      });\n+\n+      it(\"can get and set the bounds() property\", () => {","path":"test/components/selectionBoxLayerTests.ts","position":61,"original_position":61,"commit_id":"fd9c6edc5b60a4eb326c7cdfc90144c308cba404","original_commit_id":"fd9c6edc5b60a4eb326c7cdfc90144c308cba404","user":{"login":"aicioara","id":3248682,"avatar_url":"https://avatars.githubusercontent.com/u/3248682?v=3","gravatar_id":"","url":"https://api.github.com/users/aicioara","html_url":"https://github.com/aicioara","followers_url":"https://api.github.com/users/aicioara/followers","following_url":"https://api.github.com/users/aicioara/following{/other_user}","gists_url":"https://api.github.com/users/aicioara/gists{/gist_id}","starred_url":"https://api.github.com/users/aicioara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aicioara/subscriptions","organizations_url":"https://api.github.com/users/aicioara/orgs","repos_url":"https://api.github.com/users/aicioara/repos","events_url":"https://api.github.com/users/aicioara/events{/privacy}","received_events_url":"https://api.github.com/users/aicioara/received_events","type":"User","site_admin":false},"body":"?","created_at":"2015-08-25T18:33:39Z","updated_at":"2015-08-25T18:33:39Z","html_url":"https://github.com/palantir/plottable/pull/2667#discussion_r37901816","pull_request_url":"https://api.github.com/repos/palantir/plottable/pulls/2667","_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments/37901816"},"html":{"href":"https://github.com/palantir/plottable/pull/2667#discussion_r37901816"},"pull_request":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2667"}}},"pull_request":{"url":"https://api.github.com/repos/palantir/plottable/pulls/2667","id":43214926,"html_url":"https://github.com/palantir/plottable/pull/2667","diff_url":"https://github.com/palantir/plottable/pull/2667.diff","patch_url":"https://github.com/palantir/plottable/pull/2667.patch","issue_url":"https://api.github.com/repos/palantir/plottable/issues/2667","number":2667,"state":"open","locked":false,"title":"Refactor selection box layer - Pass 1","user":{"login":"aicioara","id":3248682,"avatar_url":"https://avatars.githubusercontent.com/u/3248682?v=3","gravatar_id":"","url":"https://api.github.com/users/aicioara","html_url":"https://github.com/aicioara","followers_url":"https://api.github.com/users/aicioara/followers","following_url":"https://api.github.com/users/aicioara/following{/other_user}","gists_url":"https://api.github.com/users/aicioara/gists{/gist_id}","starred_url":"https://api.github.com/users/aicioara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aicioara/subscriptions","organizations_url":"https://api.github.com/users/aicioara/orgs","repos_url":"https://api.github.com/users/aicioara/repos","events_url":"https://api.github.com/users/aicioara/events{/privacy}","received_events_url":"https://api.github.com/users/aicioara/received_events","type":"User","site_admin":false},"body":"Part of #2623 \r\n\r\nI will be doing 2 passes because I will get more context (and better sense of best practices) by refactoring other files. However, please flag anything that seems unusual.\r\n\r\nAs part of this: \r\n- **Test semantics: hierarchy, naming, testing, but no coverage check**\r\n- Applied best practices from the wiki page\r\n- Factored out common code into `beforeEach()` clauses\r\n- No nested `beforeEach()`es\r\n- Remade hierarchy as shown bellow\r\n![screen shot 2015-08-24 at 12 59 14 pm](https://cloud.githubusercontent.com/assets/3248682/9450855/f2431ab0-4a5f-11e5-8bba-c94779d8545b.png)\r\n","created_at":"2015-08-24T19:59:27Z","updated_at":"2015-08-25T18:33:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ccd92466edccba366e0529a4a4e80b43964f4b97","assignee":{"login":"aicioara","id":3248682,"avatar_url":"https://avatars.githubusercontent.com/u/3248682?v=3","gravatar_id":"","url":"https://api.github.com/users/aicioara","html_url":"https://github.com/aicioara","followers_url":"https://api.github.com/users/aicioara/followers","following_url":"https://api.github.com/users/aicioara/following{/other_user}","gists_url":"https://api.github.com/users/aicioara/gists{/gist_id}","starred_url":"https://api.github.com/users/aicioara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aicioara/subscriptions","organizations_url":"https://api.github.com/users/aicioara/orgs","repos_url":"https://api.github.com/users/aicioara/repos","events_url":"https://api.github.com/users/aicioara/events{/privacy}","received_events_url":"https://api.github.com/users/aicioara/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/palantir/plottable/pulls/2667/commits","review_comments_url":"https://api.github.com/repos/palantir/plottable/pulls/2667/comments","review_comment_url":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}","comments_url":"https://api.github.com/repos/palantir/plottable/issues/2667/comments","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/fd9c6edc5b60a4eb326c7cdfc90144c308cba404","head":{"label":"palantir:refactorSelectionBoxLayer","ref":"refactorSelectionBoxLayer","sha":"fd9c6edc5b60a4eb326c7cdfc90144c308cba404","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":16149854,"name":"plottable","full_name":"palantir/plottable","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/plottable","description":"A library of modular chart components, built on D3","fork":false,"url":"https://api.github.com/repos/palantir/plottable","forks_url":"https://api.github.com/repos/palantir/plottable/forks","keys_url":"https://api.github.com/repos/palantir/plottable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/plottable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/plottable/teams","hooks_url":"https://api.github.com/repos/palantir/plottable/hooks","issue_events_url":"https://api.github.com/repos/palantir/plottable/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/plottable/events","assignees_url":"https://api.github.com/repos/palantir/plottable/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/plottable/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/plottable/tags","blobs_url":"https://api.github.com/repos/palantir/plottable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/plottable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/plottable/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/plottable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/plottable/languages","stargazers_url":"https://api.github.com/repos/palantir/plottable/stargazers","contributors_url":"https://api.github.com/repos/palantir/plottable/contributors","subscribers_url":"https://api.github.com/repos/palantir/plottable/subscribers","subscription_url":"https://api.github.com/repos/palantir/plottable/subscription","commits_url":"https://api.github.com/repos/palantir/plottable/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/plottable/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/plottable/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/plottable/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/plottable/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/plottable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/plottable/merges","archive_url":"https://api.github.com/repos/palantir/plottable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/plottable/downloads","issues_url":"https://api.github.com/repos/palantir/plottable/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/plottable/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/plottable/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/plottable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/plottable/labels{/name}","releases_url":"https://api.github.com/repos/palantir/plottable/releases{/id}","created_at":"2014-01-22T19:29:19Z","updated_at":"2015-08-24T16:53:20Z","pushed_at":"2015-08-25T18:16:52Z","git_url":"git://github.com/palantir/plottable.git","ssh_url":"git@github.com:palantir/plottable.git","clone_url":"https://github.com/palantir/plottable.git","svn_url":"https://github.com/palantir/plottable","homepage":"plottablejs.org","size":133857,"stargazers_count":679,"watchers_count":679,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":176,"forks":68,"open_issues":176,"watchers":679,"default_branch":"develop"}},"base":{"label":"palantir:develop","ref":"develop","sha":"02bcab49dff7b8619838c7e43064d4b41776abe8","user":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"repo":{"id":16149854,"name":"plottable","full_name":"palantir/plottable","owner":{"login":"palantir","id":303157,"avatar_url":"https://avatars.githubusercontent.com/u/303157?v=3","gravatar_id":"","url":"https://api.github.com/users/palantir","html_url":"https://github.com/palantir","followers_url":"https://api.github.com/users/palantir/followers","following_url":"https://api.github.com/users/palantir/following{/other_user}","gists_url":"https://api.github.com/users/palantir/gists{/gist_id}","starred_url":"https://api.github.com/users/palantir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palantir/subscriptions","organizations_url":"https://api.github.com/users/palantir/orgs","repos_url":"https://api.github.com/users/palantir/repos","events_url":"https://api.github.com/users/palantir/events{/privacy}","received_events_url":"https://api.github.com/users/palantir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/palantir/plottable","description":"A library of modular chart components, built on D3","fork":false,"url":"https://api.github.com/repos/palantir/plottable","forks_url":"https://api.github.com/repos/palantir/plottable/forks","keys_url":"https://api.github.com/repos/palantir/plottable/keys{/key_id}","collaborators_url":"https://api.github.com/repos/palantir/plottable/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/palantir/plottable/teams","hooks_url":"https://api.github.com/repos/palantir/plottable/hooks","issue_events_url":"https://api.github.com/repos/palantir/plottable/issues/events{/number}","events_url":"https://api.github.com/repos/palantir/plottable/events","assignees_url":"https://api.github.com/repos/palantir/plottable/assignees{/user}","branches_url":"https://api.github.com/repos/palantir/plottable/branches{/branch}","tags_url":"https://api.github.com/repos/palantir/plottable/tags","blobs_url":"https://api.github.com/repos/palantir/plottable/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/palantir/plottable/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/palantir/plottable/git/refs{/sha}","trees_url":"https://api.github.com/repos/palantir/plottable/git/trees{/sha}","statuses_url":"https://api.github.com/repos/palantir/plottable/statuses/{sha}","languages_url":"https://api.github.com/repos/palantir/plottable/languages","stargazers_url":"https://api.github.com/repos/palantir/plottable/stargazers","contributors_url":"https://api.github.com/repos/palantir/plottable/contributors","subscribers_url":"https://api.github.com/repos/palantir/plottable/subscribers","subscription_url":"https://api.github.com/repos/palantir/plottable/subscription","commits_url":"https://api.github.com/repos/palantir/plottable/commits{/sha}","git_commits_url":"https://api.github.com/repos/palantir/plottable/git/commits{/sha}","comments_url":"https://api.github.com/repos/palantir/plottable/comments{/number}","issue_comment_url":"https://api.github.com/repos/palantir/plottable/issues/comments{/number}","contents_url":"https://api.github.com/repos/palantir/plottable/contents/{+path}","compare_url":"https://api.github.com/repos/palantir/plottable/compare/{base}...{head}","merges_url":"https://api.github.com/repos/palantir/plottable/merges","archive_url":"https://api.github.com/repos/palantir/plottable/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/palantir/plottable/downloads","issues_url":"https://api.github.com/repos/palantir/plottable/issues{/number}","pulls_url":"https://api.github.com/repos/palantir/plottable/pulls{/number}","milestones_url":"https://api.github.com/repos/palantir/plottable/milestones{/number}","notifications_url":"https://api.github.com/repos/palantir/plottable/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/palantir/plottable/labels{/name}","releases_url":"https://api.github.com/repos/palantir/plottable/releases{/id}","created_at":"2014-01-22T19:29:19Z","updated_at":"2015-08-24T16:53:20Z","pushed_at":"2015-08-25T18:16:52Z","git_url":"git://github.com/palantir/plottable.git","ssh_url":"git@github.com:palantir/plottable.git","clone_url":"https://github.com/palantir/plottable.git","svn_url":"https://github.com/palantir/plottable","homepage":"plottablejs.org","size":133857,"stargazers_count":679,"watchers_count":679,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":176,"forks":68,"open_issues":176,"watchers":679,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2667"},"html":{"href":"https://github.com/palantir/plottable/pull/2667"},"issue":{"href":"https://api.github.com/repos/palantir/plottable/issues/2667"},"comments":{"href":"https://api.github.com/repos/palantir/plottable/issues/2667/comments"},"review_comments":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2667/comments"},"review_comment":{"href":"https://api.github.com/repos/palantir/plottable/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/palantir/plottable/pulls/2667/commits"},"statuses":{"href":"https://api.github.com/repos/palantir/plottable/statuses/fd9c6edc5b60a4eb326c7cdfc90144c308cba404"}}}}