From 2dd2c299b3b08ab7abeeb5482d9f664efb5517eb Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Wed, 27 Feb 2019 11:32:07 +0100 Subject: [PATCH] Keep unneeded block in TextEditor spec as it's a common pattern --- spec/text-editor-component-spec.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index a1cd8d67e..4cef9f136 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -173,19 +173,22 @@ describe('TextEditorComponent', () => { expect(actualWidth).toBe(expectedWidth + 'px') } - // Make sure we do not throw an error if a synchronous update is - // triggered before measuring the longest line from a - // previously-scheduled update. - editor.getBuffer().insert(Point(12, Infinity), 'x'.repeat(100)) - expect(editor.getLongestScreenRow()).toBe(12) + // eslint-disable-next-line no-lone-blocks + { + // Make sure we do not throw an error if a synchronous update is + // triggered before measuring the longest line from a + // previously-scheduled update. + editor.getBuffer().insert(Point(12, Infinity), 'x'.repeat(100)) + expect(editor.getLongestScreenRow()).toBe(12) - TextEditorComponent.getScheduler().readDocument(() => { - // This will happen before the measurement phase of the update - // triggered above. - component.pixelPositionForScreenPosition(Point(11, Infinity)) - }) + TextEditorComponent.getScheduler().readDocument(() => { + // This will happen before the measurement phase of the update + // triggered above. + component.pixelPositionForScreenPosition(Point(11, Infinity)) + }) - await component.getNextUpdatePromise() + await component.getNextUpdatePromise() + } }) it('re-renders lines when their height changes', async () => {