mirror of
https://github.com/atom/atom.git
synced 2026-02-13 08:04:56 -05:00
Test clicking more locations outside of the lines
This commit is contained in:
committed by
Antonio Scandurra
parent
893da22c55
commit
9bf0ea83f4
@@ -1548,6 +1548,25 @@ describe('TextEditorComponent', () => {
|
||||
const {component, element, editor} = buildComponent()
|
||||
const {lineHeight} = component.measurements
|
||||
|
||||
editor.setCursorScreenPosition([Infinity, Infinity], {autoscroll: false})
|
||||
component.didMouseDownOnContent({
|
||||
detail: 1,
|
||||
button: 0,
|
||||
clientX: clientLeftForCharacter(component, 0, 0) - 1,
|
||||
clientY: clientTopForLine(component, 0) - 1
|
||||
})
|
||||
expect(editor.getCursorScreenPosition()).toEqual([0, 0])
|
||||
|
||||
const maxRow = editor.getLastScreenRow()
|
||||
editor.setCursorScreenPosition([Infinity, Infinity], {autoscroll: false})
|
||||
component.didMouseDownOnContent({
|
||||
detail: 1,
|
||||
button: 0,
|
||||
clientX: clientLeftForCharacter(component, maxRow, editor.lineLengthForScreenRow(maxRow)) + 1,
|
||||
clientY: clientTopForLine(component, maxRow) + 1
|
||||
})
|
||||
expect(editor.getCursorScreenPosition()).toEqual([maxRow, editor.lineLengthForScreenRow(maxRow)])
|
||||
|
||||
component.didMouseDownOnContent({
|
||||
detail: 1,
|
||||
button: 0,
|
||||
|
||||
Reference in New Issue
Block a user