mirror of
https://github.com/atom/atom.git
synced 2026-02-10 22:55:09 -05:00
Editor emits an editor-open event when attached
This commit is contained in:
committed by
Corey Johnson
parent
b1ab0735c7
commit
800f16bb29
@@ -51,6 +51,17 @@ describe "Editor", ->
|
||||
expect(newEditor.editSessions[0]).toEqual(editor.editSessions[0])
|
||||
expect(newEditor.editSessions[0]).not.toBe(editor.editSessions[0])
|
||||
|
||||
describe "editor-open event", ->
|
||||
it 'triggers an editor-open event when it is added to the DOM', ->
|
||||
openHandler = jasmine.createSpy('openHandler')
|
||||
editor.on 'editor-open', openHandler
|
||||
|
||||
editor.simulateDomAttachment()
|
||||
|
||||
expect(openHandler).toHaveBeenCalled()
|
||||
[event, eventEditor] = openHandler.argsForCall[0]
|
||||
expect(eventEditor).toBe editor
|
||||
|
||||
describe "text rendering", ->
|
||||
it "creates a line element for each line in the buffer with the html-escaped text of the line", ->
|
||||
expect(editor.lines.find('.line').length).toEqual(buffer.numLines())
|
||||
|
||||
Reference in New Issue
Block a user