Remove unnecessary scrollbar specs

This commit is contained in:
Ben Ogle
2014-07-23 16:25:24 -07:00
parent 3295b9b0dd
commit 242df788e6

View File

@@ -1566,58 +1566,8 @@ describe "EditorComponent", ->
runSetImmediateCallbacks()
expect(horizontalScrollbarNode.scrollWidth).toBe editor.getScrollWidth()
it "updates the position and width of the horizontal scrollbar when editor.showLineNumbers is toggled", ->
componentNode.style.width = 10 * charWidth + 'px'
component.measureHeightAndWidth()
runSetImmediateCallbacks()
gutterNode = componentNode.querySelector('.gutter')
expect(horizontalScrollbarNode.scrollWidth).toBe editor.getScrollWidth()
expect(horizontalScrollbarNode.style.left).toBe gutterNode.offsetWidth + 'px'
atom.config.set("editor.showLineNumbers", false)
runSetImmediateCallbacks()
gutterNode = componentNode.querySelector('.gutter')
expect(horizontalScrollbarNode.scrollWidth).toBe editor.getScrollWidth()
expect(horizontalScrollbarNode.style.left).toBe '0px'
atom.config.set("editor.showLineNumbers", true)
runSetImmediateCallbacks()
gutterNode = componentNode.querySelector('.gutter')
expect(horizontalScrollbarNode.scrollWidth).toBe editor.getScrollWidth()
expect(horizontalScrollbarNode.style.left).toBe gutterNode.offsetWidth + 'px'
describe "when the editor is hidden", ->
hideEditorView = ->
wrapperNode.style.display = 'none'
expect(component.isVisible()).toBe false
showEditorView = ->
wrapperNode.style.display = 'block'
expect(component.isVisible()).toBe true
it "updates the position of the horizontal scrollbar only when the editor is visible", ->
# toggling gutter off
hideEditorView()
atom.config.set("editor.showLineNumbers", false)
showEditorView()
component.forceUpdate()
runSetImmediateCallbacks()
gutterNode = componentNode.querySelector('.gutter')
expect(horizontalScrollbarNode.style.left).toBe '0px'
# toggling gutter back on
hideEditorView()
atom.config.set("editor.showLineNumbers", true)
showEditorView()
component.forceUpdate()
runSetImmediateCallbacks()
gutterNode = componentNode.querySelector('.gutter')
expect(horizontalScrollbarNode.style.left).toBe gutterNode.offsetWidth + 'px'
describe "mousewheel events", ->
beforeEach ->
atom.config.set('editor.scrollSensitivity', 100)