mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
@@ -558,7 +558,7 @@ describe "Editor", ->
|
||||
|
||||
lineHeightBefore = editor.lineHeight
|
||||
charWidthBefore = editor.charWidth
|
||||
config.set("editor.fontFamily", "Courier")
|
||||
config.set("editor.fontFamily", "Consolas")
|
||||
editor.setCursorScreenPosition [5, 6]
|
||||
expect(editor.charWidth).not.toBe charWidthBefore
|
||||
expect(editor.getCursorView().position()).toEqual { top: 5 * editor.lineHeight, left: 6 * editor.charWidth }
|
||||
@@ -618,9 +618,9 @@ describe "Editor", ->
|
||||
|
||||
it "updates the gutter width and font size", ->
|
||||
rootView.attachToDom()
|
||||
config.set("editor.fontSize", 16 * 4)
|
||||
expect(editor.gutter.css('font-size')).toBe "#{16 * 4}px"
|
||||
expect(editor.gutter.width()).toBe(64 + editor.gutter.calculateLineNumberPadding())
|
||||
config.set("editor.fontSize", 20)
|
||||
expect(editor.gutter.css('font-size')).toBe "20px"
|
||||
expect(editor.gutter.width()).toBe(editor.charWidth * 2 + editor.gutter.calculateLineNumberPadding())
|
||||
|
||||
it "updates lines if there are unrendered lines", ->
|
||||
editor.attachToDom(heightInLines: 5)
|
||||
|
||||
@@ -43,6 +43,7 @@ beforeEach ->
|
||||
window.config = new Config()
|
||||
spyOn(config, 'load')
|
||||
spyOn(config, 'save')
|
||||
config.set "editor.fontFamily", "Courier"
|
||||
config.set "editor.fontSize", 16
|
||||
config.set "editor.autoIndent", false
|
||||
config.set "core.disabledPackages", ["package-that-throws-an-exception"]
|
||||
|
||||
@@ -31,7 +31,8 @@ describe "WrapGuide", ->
|
||||
it "updates the wrap guide position", ->
|
||||
initial = wrapGuide.position().left
|
||||
expect(initial).toBeGreaterThan(0)
|
||||
rootView.trigger('window:increase-font-size')
|
||||
fontSize = config.get("editor.fontSize")
|
||||
config.set("editor.fontSize", fontSize * 2)
|
||||
expect(wrapGuide.position().left).toBeGreaterThan(initial)
|
||||
expect(wrapGuide).toBeVisible()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user