mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
💄 spec organization
This commit is contained in:
@@ -26,7 +26,7 @@ describe "EditorComponent", ->
|
||||
{lineHeightInPixels, charWidth} = component.measureLineDimensions()
|
||||
node = component.getDOMNode()
|
||||
|
||||
describe "scrolling", ->
|
||||
describe "line rendering", ->
|
||||
it "renders only the currently-visible lines", ->
|
||||
node.style.height = 4.5 * lineHeightInPixels + 'px'
|
||||
component.updateAllDimensions()
|
||||
@@ -50,16 +50,6 @@ describe "EditorComponent", ->
|
||||
expect(spacers[0].offsetHeight).toBe 2 * lineHeightInPixels
|
||||
expect(spacers[1].offsetHeight).toBe (editor.getScreenLineCount() - 8) * lineHeightInPixels
|
||||
|
||||
it "updates the scroll bar when the scrollTop is changed in the model", ->
|
||||
node.style.height = 4.5 * lineHeightInPixels + 'px'
|
||||
component.updateAllDimensions()
|
||||
|
||||
scrollbarNode = node.querySelector('.vertical-scrollbar')
|
||||
expect(scrollbarNode.scrollTop).toBe 0
|
||||
|
||||
editor.setScrollTop(10)
|
||||
expect(scrollbarNode.scrollTop).toBe 10
|
||||
|
||||
describe "cursor rendering", ->
|
||||
it "renders the currently visible cursors", ->
|
||||
cursor1 = editor.getCursor()
|
||||
@@ -328,3 +318,13 @@ describe "EditorComponent", ->
|
||||
expect(node.classList.contains('is-focused')).toBe true
|
||||
inputNode.blur()
|
||||
expect(node.classList.contains('is-focused')).toBe false
|
||||
|
||||
it "updates the scroll bar when the scrollTop is changed in the model", ->
|
||||
node.style.height = 4.5 * lineHeightInPixels + 'px'
|
||||
component.updateAllDimensions()
|
||||
|
||||
scrollbarNode = node.querySelector('.vertical-scrollbar')
|
||||
expect(scrollbarNode.scrollTop).toBe 0
|
||||
|
||||
editor.setScrollTop(10)
|
||||
expect(scrollbarNode.scrollTop).toBe 10
|
||||
|
||||
Reference in New Issue
Block a user