mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Remove event listeners from orphaned gutters
This commit is contained in:
@@ -743,6 +743,16 @@ describe "TextEditorComponent", ->
|
||||
beforeEach ->
|
||||
gutterNode = componentNode.querySelector('.gutter')
|
||||
|
||||
describe "when the component is destroyed", ->
|
||||
it "stops listening for folding events", ->
|
||||
component.destroy()
|
||||
|
||||
lineNumber = component.lineNumberNodeForScreenRow(1)
|
||||
target = lineNumber.querySelector('.icon-right')
|
||||
target.dispatchEvent(buildClickEvent(target))
|
||||
|
||||
expect(nextAnimationFrame).toBe(noAnimationFrame)
|
||||
|
||||
it "folds and unfolds the block represented by the fold indicator when clicked", ->
|
||||
expect(lineNumberHasClass(1, 'folded')).toBe false
|
||||
|
||||
@@ -1727,6 +1737,14 @@ describe "TextEditorComponent", ->
|
||||
beforeEach ->
|
||||
gutterNode = componentNode.querySelector('.gutter')
|
||||
|
||||
describe "when the component is destroyed", ->
|
||||
it "stops listening for selection events", ->
|
||||
component.destroy()
|
||||
|
||||
gutterNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenRowInGutter(1)))
|
||||
|
||||
expect(editor.getSelectedScreenRange()).toEqual [[0, 0], [0, 0]]
|
||||
|
||||
describe "when the gutter is clicked", ->
|
||||
it "selects the clicked row", ->
|
||||
gutterNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenRowInGutter(4)))
|
||||
|
||||
Reference in New Issue
Block a user