mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Fix tests in editor
This commit is contained in:
@@ -777,6 +777,9 @@ describe "Editor", ->
|
||||
# resizes with the editor
|
||||
expect(editor.width()).toBeLessThan(800)
|
||||
editor.width(800)
|
||||
editor.resize() # call to trigger the resize event.
|
||||
|
||||
region2 = selectionView.regions[1]
|
||||
expect(region2.width()).toBe(editor.renderedLines.outerWidth())
|
||||
|
||||
region3 = selectionView.regions[2]
|
||||
@@ -1332,7 +1335,7 @@ describe "Editor", ->
|
||||
setEditorWidthInChars(editor, maxLineLength)
|
||||
widthBefore = editor.renderedLines.width()
|
||||
expect(widthBefore).toBe editor.scrollView.width() + 20
|
||||
buffer.change([[12,0], [12,0]], [1..maxLineLength*2].join(''))
|
||||
buffer.change([[12,0], [12,0]], [1..maxLineLength*10].join(''))
|
||||
expect(editor.renderedLines.width()).toBeGreaterThan widthBefore
|
||||
|
||||
describe "when lines are removed", ->
|
||||
|
||||
@@ -773,8 +773,8 @@ class Editor extends View
|
||||
@subscribe $(window), "resize.editor-#{@id}", =>
|
||||
@setHeightInLines()
|
||||
@setWidthInChars()
|
||||
@requestDisplayUpdate()
|
||||
@updateLayerDimensions()
|
||||
@requestDisplayUpdate()
|
||||
@focus() if @isFocused
|
||||
|
||||
if pane = @getPane()
|
||||
@@ -1156,7 +1156,7 @@ class Editor extends View
|
||||
@verticalScrollbarContent.height(@layerHeight)
|
||||
@scrollBottom(height) if @scrollBottom() > height
|
||||
|
||||
minWidth = @scrollView.width()
|
||||
minWidth = Math.max(@charWidth * @getMaxScreenLineLength() + 20, @scrollView.width())
|
||||
unless @layerMinWidth == minWidth
|
||||
@renderedLines.css('min-width', minWidth)
|
||||
@underlayer.css('min-width', minWidth)
|
||||
|
||||
Reference in New Issue
Block a user