Use Courier as the default font for specs

Fixes #323
This commit is contained in:
probablycorey
2013-03-04 16:40:02 -08:00
parent 0fe570fc47
commit 30d4cb81b8
3 changed files with 7 additions and 5 deletions

View File

@@ -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)

View File

@@ -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"]

View File

@@ -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()