Test soft wrap column measurement with a custom gutter

This commit is contained in:
Ash Wilson 2018-09-21 13:14:47 -04:00
parent a239b66396
commit 39bc295f1c
No known key found for this signature in database
GPG Key ID: 81B1DDB704F69D2A

View File

@ -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', () => {