Keep unneeded block in TextEditor spec as it's a common pattern

This commit is contained in:
Rafael Oleza
2019-02-27 11:32:07 +01:00
parent 55cdc398f6
commit 2dd2c299b3

View File

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