From 39bc295f1cc7d1ed422a9f55e04dd1c899f3fd1e Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Fri, 21 Sep 2018 13:14:47 -0400 Subject: [PATCH] Test soft wrap column measurement with a custom gutter --- spec/text-editor-component-spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index 66274a99a..cbc65b188 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -2085,6 +2085,22 @@ describe('TextEditorComponent', () => { const bLabels = Array.from(bNumbers, e => e.textContent) expect(bLabels).toEqual(['b - 0', 'b - 1', 'b - 2', 'b - 3', 'b - 4', 'b - 5']) }) + + it("updates the editor's soft wrap width when a custom gutter's measurement is available", () => { + const {component, element, editor} = buildComponent({ + lineNumberGutterVisible: false, + width: 400, + softWrapped: true, + attach: false, + }) + const gutter = editor.addGutter({name: 'a', priority: 10}) + gutter.getElement().style.width = '100px' + + jasmine.attachToDOM(element) + + expect(component.getGutterContainerWidth()).toBe(100) + expect(editor.getSoftWrapColumn()).toBe(39); + }) }) describe('block decorations', () => {