mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don't make assumptions about the character width in specs
This commit is contained in:
@@ -52,13 +52,13 @@ describe "Editor", ->
|
||||
|
||||
describe "when soft-wrap is enabled", ->
|
||||
beforeEach ->
|
||||
editor.width(11 * 50)
|
||||
otherEditor = new Editor
|
||||
otherEditor.attachToDom()
|
||||
charWidth = otherEditor.charWidth
|
||||
otherEditor.remove()
|
||||
editor.width(charWidth * 50)
|
||||
editor.setSoftWrap(true)
|
||||
editor.attachToDom()
|
||||
# this verifies the assumption made above in setting the editor's width
|
||||
# charWidth isn't be calculated until it's the editor is on the DOM, but
|
||||
# we need to ensure that the maxLineLength is recalculated when we attach.
|
||||
expect(editor.charWidth).toBe 11
|
||||
|
||||
it "wraps lines that are too long to fit within the editor's width, adjusting cursor positioning accordingly", ->
|
||||
expect(editor.lines.find('.line').length).toBe 16
|
||||
|
||||
Reference in New Issue
Block a user