mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Explicitly assign height of editor-contents when height is auto
This commit is contained in:
@@ -61,8 +61,6 @@ describe "EditorComponent", ->
|
||||
verticalScrollbarNode = componentNode.querySelector('.vertical-scrollbar')
|
||||
horizontalScrollbarNode = componentNode.querySelector('.horizontal-scrollbar')
|
||||
|
||||
wrapperNode.style.height = editor.getLineCount() * lineHeightInPixels + 'px'
|
||||
wrapperNode.style.width = '1000px'
|
||||
component.measureScrollView()
|
||||
runSetImmediateCallbacks()
|
||||
|
||||
@@ -1920,7 +1918,7 @@ describe "EditorComponent", ->
|
||||
|
||||
it "updates the wrap location when the editor is resized", ->
|
||||
newHeight = 4 * editor.getLineHeightInPixels() + "px"
|
||||
expect(newHeight).toBeLessThan wrapperNode.style.height
|
||||
expect(parseInt(newHeight)).toBeLessThan wrapperNode.offsetHeight
|
||||
wrapperNode.style.height = newHeight
|
||||
|
||||
advanceClock(component.scrollViewMeasurementInterval)
|
||||
@@ -1991,6 +1989,18 @@ describe "EditorComponent", ->
|
||||
runSetImmediateCallbacks()
|
||||
expect(lineNumberHasClass(4, 'cursor-line-no-selection')).toBe false
|
||||
|
||||
describe "height", ->
|
||||
describe "when the wrapper view has an explicit height", ->
|
||||
it "does not assign a height on the component node", ->
|
||||
wrapperNode.style.height = '200px'
|
||||
component.measureScrollView()
|
||||
expect(componentNode.style.height).toBe ''
|
||||
|
||||
describe "when the wrapper view does not have an explicit height", ->
|
||||
it "assigns a height on the component node based on the editor's content", ->
|
||||
expect(wrapperNode.style.height).toBe ''
|
||||
expect(componentNode.style.height).toBe editor.getScreenLineCount() * lineHeightInPixels + 'px'
|
||||
|
||||
describe "when the 'mini' property is true", ->
|
||||
beforeEach ->
|
||||
component.setProps(mini: true)
|
||||
|
||||
Reference in New Issue
Block a user