From be7f4a5ffd886e87d970c148e787ada4d8d7d2b7 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sun, 26 Feb 2017 10:49:35 -0700 Subject: [PATCH] Add workaround in test, but we need to make MarkerLayer updates sync --- spec/text-editor-component-spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index d8528a460..b2a2ba8c3 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -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)