{"action":"created","comment":{"url":"https://api.github.com/repos/behance/helicropter/pulls/comments/47296647","id":47296647,"diff_hunk":"@@ -0,0 +1,118 @@\n+import ZoomSlider from 'ZoomSlider';\n+\n+describe('ZoomSlider', function() {\n+  beforeEach(function() {\n+    this.$el = affix('.js-zoom-slider-parent');\n+    this.zoomSlider = new ZoomSlider();\n+    this.zoomSlider.render(this.$el);\n+  });\n+\n+  it('renders', function() {\n+    expect(this.$el.find('.js-scale-slider').length).not.toBe(0);\n+  });\n+\n+  describe('#rendered', function() {\n+    it('creates slider input binding', function(done) {\n+      this.zoomSlider.on('scale', done);\n+      this.zoomSlider._$slider.val(50).trigger('input');\n+    });\n+  });\n+\n+  describe('#reset', function() {\n+    beforeEach(function() {\n+      this.zoomSlider._$slider.val(50);\n+    });\n+\n+    it('sets the slider value to 0', function() {\n+      expect(+this.zoomSlider._$slider.val()).not.toBe(0);\n+      this.zoomSlider.reset();\n+      expect(+this.zoomSlider._$slider.val()).toBe(0);\n+    });\n+\n+    it('triggers change on the input', function(done) {\n+      this.zoomSlider._$slider.on('change', done);\n+      this.zoomSlider.reset();\n+    });\n+  });\n+\n+  describe('#disable', function() {\n+    it('adds a disabled class to the slider container', function() {\n+      this.zoomSlider.disable();\n+      expect(this.zoomSlider.$view.is('.disabled')).toBe(true);\n+    });\n+\n+    it('disables the slider input', function() {\n+      this.zoomSlider.disable();\n+      expect(this.zoomSlider._$slider.prop('disabled')).toBe(true);\n+    });\n+  });\n+\n+  describe('#enable', function() {\n+    beforeEach(function() {\n+      this.zoomSlider.disable();\n+    });\n+\n+    it('adds a disabled class to the slider container', function() {\n+      this.zoomSlider.enable();\n+      expect(this.zoomSlider.$view.is('.disabled')).toBe(false);\n+    });\n+\n+    it('disables the slider input', function() {\n+      this.zoomSlider.enable();\n+      expect(this.zoomSlider._$slider.prop('disabled')).toBe(false);\n+    });\n+  });\n+\n+  describe('events', function() {\n+    describe('#image-loaded', function() {\n+      describe('when only triggered with a minScale', function() {\n+        beforeEach(function() {\n+          this.zoomSlider.trigger('image-loaded', { minScale: 0.0 });\n+        });\n+\n+        it('re-calculates the scaleStep', function() {\n+          expect(this.zoomSlider._scaleStep).toBe(0.01);\n+        });\n+      });\n+\n+      describe('when triggered with a minScale and a current scale', function() {\n+        beforeEach(function() {\n+          this.zoomSlider.trigger('image-loaded', { scale: 0.5, minScale: 0.0 });\n+        });\n+\n+        it('re-calculates the scaleStep', function() {\n+          expect(this.zoomSlider._scaleStep).toBe(0.01);\n+        });\n+\n+        it('sets the input to the value for the current scale', function() {\n+          expect(+this.zoomSlider._$slider.val()).toBe(50);","path":"test/specs/ZoomSlider.js","position":88,"original_position":88,"commit_id":"b794290ac458fd3f25d743bdbf5ad902caeef3f6","original_commit_id":"b794290ac458fd3f25d743bdbf5ad902caeef3f6","user":{"login":"mrjoelkemp","id":865203,"avatar_url":"https://avatars.githubusercontent.com/u/865203?v=3","gravatar_id":"","url":"https://api.github.com/users/mrjoelkemp","html_url":"https://github.com/mrjoelkemp","followers_url":"https://api.github.com/users/mrjoelkemp/followers","following_url":"https://api.github.com/users/mrjoelkemp/following{/other_user}","gists_url":"https://api.github.com/users/mrjoelkemp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrjoelkemp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrjoelkemp/subscriptions","organizations_url":"https://api.github.com/users/mrjoelkemp/orgs","repos_url":"https://api.github.com/users/mrjoelkemp/repos","events_url":"https://api.github.com/users/mrjoelkemp/events{/privacy}","received_events_url":"https://api.github.com/users/mrjoelkemp/received_events","type":"User","site_admin":false},"body":"Consider global js class","created_at":"2015-12-10T22:30:29Z","updated_at":"2015-12-10T22:30:29Z","html_url":"https://github.com/behance/helicropter/pull/38#discussion_r47296647","pull_request_url":"https://api.github.com/repos/behance/helicropter/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/behance/helicropter/pulls/comments/47296647"},"html":{"href":"https://github.com/behance/helicropter/pull/38#discussion_r47296647"},"pull_request":{"href":"https://api.github.com/repos/behance/helicropter/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/behance/helicropter/pulls/38","id":53042961,"html_url":"https://github.com/behance/helicropter/pull/38","diff_url":"https://github.com/behance/helicropter/pull/38.diff","patch_url":"https://github.com/behance/helicropter/pull/38.patch","issue_url":"https://api.github.com/repos/behance/helicropter/issues/38","number":38,"state":"open","locked":false,"title":"Cropper: Better UX around image scale","user":{"login":"Attamusc","id":868737,"avatar_url":"https://avatars.githubusercontent.com/u/868737?v=3","gravatar_id":"","url":"https://api.github.com/users/Attamusc","html_url":"https://github.com/Attamusc","followers_url":"https://api.github.com/users/Attamusc/followers","following_url":"https://api.github.com/users/Attamusc/following{/other_user}","gists_url":"https://api.github.com/users/Attamusc/gists{/gist_id}","starred_url":"https://api.github.com/users/Attamusc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Attamusc/subscriptions","organizations_url":"https://api.github.com/users/Attamusc/orgs","repos_url":"https://api.github.com/users/Attamusc/repos","events_url":"https://api.github.com/users/Attamusc/events{/privacy}","received_events_url":"https://api.github.com/users/Attamusc/received_events","type":"User","site_admin":false},"body":"- Switch from starting the image at the max scale (smallest generated image) to\r\n  minimum scale (largest generated image)\r\n- Add the ability to define a displayed width and a warning when scaling if the\r\n  generated width will be smaller than the displayed width\r\n\r\n## Preview\r\n\r\n![output_tiiumd](https://cloud.githubusercontent.com/assets/868737/11689565/9c3101e6-9e60-11e5-8395-bef7da34f606.gif)\r\n\r\n","created_at":"2015-12-08T21:42:47Z","updated_at":"2015-12-10T22:30:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6545c43c4e98fbe5d1892e5b61afe20f79d95dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/behance/helicropter/pulls/38/commits","review_comments_url":"https://api.github.com/repos/behance/helicropter/pulls/38/comments","review_comment_url":"https://api.github.com/repos/behance/helicropter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/behance/helicropter/issues/38/comments","statuses_url":"https://api.github.com/repos/behance/helicropter/statuses/b794290ac458fd3f25d743bdbf5ad902caeef3f6","head":{"label":"Attamusc:feature/blurry-warning","ref":"feature/blurry-warning","sha":"b794290ac458fd3f25d743bdbf5ad902caeef3f6","user":{"login":"Attamusc","id":868737,"avatar_url":"https://avatars.githubusercontent.com/u/868737?v=3","gravatar_id":"","url":"https://api.github.com/users/Attamusc","html_url":"https://github.com/Attamusc","followers_url":"https://api.github.com/users/Attamusc/followers","following_url":"https://api.github.com/users/Attamusc/following{/other_user}","gists_url":"https://api.github.com/users/Attamusc/gists{/gist_id}","starred_url":"https://api.github.com/users/Attamusc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Attamusc/subscriptions","organizations_url":"https://api.github.com/users/Attamusc/orgs","repos_url":"https://api.github.com/users/Attamusc/repos","events_url":"https://api.github.com/users/Attamusc/events{/privacy}","received_events_url":"https://api.github.com/users/Attamusc/received_events","type":"User","site_admin":false},"repo":{"id":41378253,"name":"helicropter","full_name":"Attamusc/helicropter","owner":{"login":"Attamusc","id":868737,"avatar_url":"https://avatars.githubusercontent.com/u/868737?v=3","gravatar_id":"","url":"https://api.github.com/users/Attamusc","html_url":"https://github.com/Attamusc","followers_url":"https://api.github.com/users/Attamusc/followers","following_url":"https://api.github.com/users/Attamusc/following{/other_user}","gists_url":"https://api.github.com/users/Attamusc/gists{/gist_id}","starred_url":"https://api.github.com/users/Attamusc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Attamusc/subscriptions","organizations_url":"https://api.github.com/users/Attamusc/orgs","repos_url":"https://api.github.com/users/Attamusc/repos","events_url":"https://api.github.com/users/Attamusc/events{/privacy}","received_events_url":"https://api.github.com/users/Attamusc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Attamusc/helicropter","description":"Crops, Bops, and Uploads","fork":true,"url":"https://api.github.com/repos/Attamusc/helicropter","forks_url":"https://api.github.com/repos/Attamusc/helicropter/forks","keys_url":"https://api.github.com/repos/Attamusc/helicropter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Attamusc/helicropter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Attamusc/helicropter/teams","hooks_url":"https://api.github.com/repos/Attamusc/helicropter/hooks","issue_events_url":"https://api.github.com/repos/Attamusc/helicropter/issues/events{/number}","events_url":"https://api.github.com/repos/Attamusc/helicropter/events","assignees_url":"https://api.github.com/repos/Attamusc/helicropter/assignees{/user}","branches_url":"https://api.github.com/repos/Attamusc/helicropter/branches{/branch}","tags_url":"https://api.github.com/repos/Attamusc/helicropter/tags","blobs_url":"https://api.github.com/repos/Attamusc/helicropter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Attamusc/helicropter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Attamusc/helicropter/git/refs{/sha}","trees_url":"https://api.github.com/repos/Attamusc/helicropter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Attamusc/helicropter/statuses/{sha}","languages_url":"https://api.github.com/repos/Attamusc/helicropter/languages","stargazers_url":"https://api.github.com/repos/Attamusc/helicropter/stargazers","contributors_url":"https://api.github.com/repos/Attamusc/helicropter/contributors","subscribers_url":"https://api.github.com/repos/Attamusc/helicropter/subscribers","subscription_url":"https://api.github.com/repos/Attamusc/helicropter/subscription","commits_url":"https://api.github.com/repos/Attamusc/helicropter/commits{/sha}","git_commits_url":"https://api.github.com/repos/Attamusc/helicropter/git/commits{/sha}","comments_url":"https://api.github.com/repos/Attamusc/helicropter/comments{/number}","issue_comment_url":"https://api.github.com/repos/Attamusc/helicropter/issues/comments{/number}","contents_url":"https://api.github.com/repos/Attamusc/helicropter/contents/{+path}","compare_url":"https://api.github.com/repos/Attamusc/helicropter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Attamusc/helicropter/merges","archive_url":"https://api.github.com/repos/Attamusc/helicropter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Attamusc/helicropter/downloads","issues_url":"https://api.github.com/repos/Attamusc/helicropter/issues{/number}","pulls_url":"https://api.github.com/repos/Attamusc/helicropter/pulls{/number}","milestones_url":"https://api.github.com/repos/Attamusc/helicropter/milestones{/number}","notifications_url":"https://api.github.com/repos/Attamusc/helicropter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Attamusc/helicropter/labels{/name}","releases_url":"https://api.github.com/repos/Attamusc/helicropter/releases{/id}","created_at":"2015-08-25T17:38:18Z","updated_at":"2015-08-25T17:38:19Z","pushed_at":"2015-12-10T21:30:55Z","git_url":"git://github.com/Attamusc/helicropter.git","ssh_url":"git@github.com:Attamusc/helicropter.git","clone_url":"https://github.com/Attamusc/helicropter.git","svn_url":"https://github.com/Attamusc/helicropter","homepage":null,"size":15707,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"behance:master","ref":"master","sha":"0838d5403aa18f7024dd0902f1f20e37b3717159","user":{"login":"behance","id":1197743,"avatar_url":"https://avatars.githubusercontent.com/u/1197743?v=3","gravatar_id":"","url":"https://api.github.com/users/behance","html_url":"https://github.com/behance","followers_url":"https://api.github.com/users/behance/followers","following_url":"https://api.github.com/users/behance/following{/other_user}","gists_url":"https://api.github.com/users/behance/gists{/gist_id}","starred_url":"https://api.github.com/users/behance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behance/subscriptions","organizations_url":"https://api.github.com/users/behance/orgs","repos_url":"https://api.github.com/users/behance/repos","events_url":"https://api.github.com/users/behance/events{/privacy}","received_events_url":"https://api.github.com/users/behance/received_events","type":"Organization","site_admin":false},"repo":{"id":38000509,"name":"helicropter","full_name":"behance/helicropter","owner":{"login":"behance","id":1197743,"avatar_url":"https://avatars.githubusercontent.com/u/1197743?v=3","gravatar_id":"","url":"https://api.github.com/users/behance","html_url":"https://github.com/behance","followers_url":"https://api.github.com/users/behance/followers","following_url":"https://api.github.com/users/behance/following{/other_user}","gists_url":"https://api.github.com/users/behance/gists{/gist_id}","starred_url":"https://api.github.com/users/behance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behance/subscriptions","organizations_url":"https://api.github.com/users/behance/orgs","repos_url":"https://api.github.com/users/behance/repos","events_url":"https://api.github.com/users/behance/events{/privacy}","received_events_url":"https://api.github.com/users/behance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/behance/helicropter","description":"Crops, Bops, and Uploads","fork":false,"url":"https://api.github.com/repos/behance/helicropter","forks_url":"https://api.github.com/repos/behance/helicropter/forks","keys_url":"https://api.github.com/repos/behance/helicropter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/behance/helicropter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/behance/helicropter/teams","hooks_url":"https://api.github.com/repos/behance/helicropter/hooks","issue_events_url":"https://api.github.com/repos/behance/helicropter/issues/events{/number}","events_url":"https://api.github.com/repos/behance/helicropter/events","assignees_url":"https://api.github.com/repos/behance/helicropter/assignees{/user}","branches_url":"https://api.github.com/repos/behance/helicropter/branches{/branch}","tags_url":"https://api.github.com/repos/behance/helicropter/tags","blobs_url":"https://api.github.com/repos/behance/helicropter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/behance/helicropter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/behance/helicropter/git/refs{/sha}","trees_url":"https://api.github.com/repos/behance/helicropter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/behance/helicropter/statuses/{sha}","languages_url":"https://api.github.com/repos/behance/helicropter/languages","stargazers_url":"https://api.github.com/repos/behance/helicropter/stargazers","contributors_url":"https://api.github.com/repos/behance/helicropter/contributors","subscribers_url":"https://api.github.com/repos/behance/helicropter/subscribers","subscription_url":"https://api.github.com/repos/behance/helicropter/subscription","commits_url":"https://api.github.com/repos/behance/helicropter/commits{/sha}","git_commits_url":"https://api.github.com/repos/behance/helicropter/git/commits{/sha}","comments_url":"https://api.github.com/repos/behance/helicropter/comments{/number}","issue_comment_url":"https://api.github.com/repos/behance/helicropter/issues/comments{/number}","contents_url":"https://api.github.com/repos/behance/helicropter/contents/{+path}","compare_url":"https://api.github.com/repos/behance/helicropter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/behance/helicropter/merges","archive_url":"https://api.github.com/repos/behance/helicropter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/behance/helicropter/downloads","issues_url":"https://api.github.com/repos/behance/helicropter/issues{/number}","pulls_url":"https://api.github.com/repos/behance/helicropter/pulls{/number}","milestones_url":"https://api.github.com/repos/behance/helicropter/milestones{/number}","notifications_url":"https://api.github.com/repos/behance/helicropter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/behance/helicropter/labels{/name}","releases_url":"https://api.github.com/repos/behance/helicropter/releases{/id}","created_at":"2015-06-24T17:40:35Z","updated_at":"2015-08-20T14:20:40Z","pushed_at":"2015-12-10T21:30:56Z","git_url":"git://github.com/behance/helicropter.git","ssh_url":"git@github.com:behance/helicropter.git","clone_url":"https://github.com/behance/helicropter.git","svn_url":"https://github.com/behance/helicropter","homepage":null,"size":15694,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/behance/helicropter/pulls/38"},"html":{"href":"https://github.com/behance/helicropter/pull/38"},"issue":{"href":"https://api.github.com/repos/behance/helicropter/issues/38"},"comments":{"href":"https://api.github.com/repos/behance/helicropter/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/behance/helicropter/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/behance/helicropter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/behance/helicropter/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/behance/helicropter/statuses/b794290ac458fd3f25d743bdbf5ad902caeef3f6"}}}}