Add workaround in test, but we need to make MarkerLayer updates sync

This commit is contained in:
Nathan Sobo 2017-02-26 10:49:35 -07:00 committed by Antonio Scandurra
parent d780b15248
commit be7f4a5ffd

View File

@ -34,6 +34,12 @@ describe('TextEditorComponent', () => {
it('renders lines and line numbers for the visible region', async () => {
const {component, element, editor} = buildComponent({rowsPerTile: 3})
// TODO: An extra update is caused by marker layer events being asynchronous,
// so the cursor getting added triggers an update even though we created
// the component after this occurred. We should make marker layer events
// synchronous and batched on the transaction.
await component.getNextUpdatePromise()
expect(element.querySelectorAll('.line-number').length).toBe(13)
expect(element.querySelectorAll('.line').length).toBe(13)