mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add specs for toggling the gutter when the editor is hidden
This commit is contained in:
@@ -1589,6 +1589,36 @@ describe "EditorComponent", ->
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user