Speed up cursor blink test

This commit is contained in:
Nathan Sobo
2017-03-29 20:22:18 -06:00
committed by Antonio Scandurra
parent 7da588c3ee
commit acf996fc14
2 changed files with 5 additions and 3 deletions

View File

@@ -256,9 +256,11 @@ describe('TextEditorComponent', () => {
it('blinks cursors when the editor is focused and the cursors are not moving', async () => {
assertDocumentFocused()
const {component, element, editor} = buildComponent()
component.props.cursorBlinkPeriod = 40
component.props.cursorBlinkResumeDelay = 40
editor.addCursorAtScreenPosition([1, 0])
element.focus()
await component.getNextUpdatePromise()
const [cursor1, cursor2] = element.querySelectorAll('.cursor')

View File

@@ -1430,7 +1430,7 @@ class TextEditorComponent {
this.cursorsBlinkedOff = true
this.startCursorBlinking()
this.resumeCursorBlinkingTimeoutHandle = null
}, CURSOR_BLINK_RESUME_DELAY)
}, (this.props.cursorBlinkResumeDelay || CURSOR_BLINK_RESUME_DELAY))
}
stopCursorBlinking () {
@@ -1448,7 +1448,7 @@ class TextEditorComponent {
this.cursorBlinkIntervalHandle = window.setInterval(() => {
this.cursorsBlinkedOff = !this.cursorsBlinkedOff
this.scheduleUpdate(true)
}, CURSOR_BLINK_PERIOD / 2)
}, (this.props.cursorBlinkPeriod || CURSOR_BLINK_PERIOD) / 2)
this.cursorsBlinking = true
this.scheduleUpdate(true)
}