mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
Keep unneeded block in TextEditor spec as it's a common pattern
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user