mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Replace ‘editor-created’ event with ::onDidAddTextEditor
This commit is contained in:
parent
83327eeabb
commit
22c62b3107
@ -203,17 +203,17 @@ describe "Workspace", ->
|
|||||||
workspace.open("bar://baz").then (item) ->
|
workspace.open("bar://baz").then (item) ->
|
||||||
expect(item).toEqual { bar: "bar://baz" }
|
expect(item).toEqual { bar: "bar://baz" }
|
||||||
|
|
||||||
it "emits an 'editor-created' event", ->
|
it "notifies ::onDidAddTextEditor observers", ->
|
||||||
absolutePath = require.resolve('./fixtures/dir/a')
|
absolutePath = require.resolve('./fixtures/dir/a')
|
||||||
newEditorHandler = jasmine.createSpy('newEditorHandler')
|
newEditorHandler = jasmine.createSpy('newEditorHandler')
|
||||||
workspace.on 'editor-created', newEditorHandler
|
workspace.onDidAddTextEditor newEditorHandler
|
||||||
|
|
||||||
editor = null
|
editor = null
|
||||||
waitsForPromise ->
|
waitsForPromise ->
|
||||||
workspace.open(absolutePath).then (e) -> editor = e
|
workspace.open(absolutePath).then (e) -> editor = e
|
||||||
|
|
||||||
runs ->
|
runs ->
|
||||||
expect(newEditorHandler).toHaveBeenCalledWith editor
|
expect(newEditorHandler.argsForCall[0][0].textEditor).toBe editor
|
||||||
|
|
||||||
describe "::reopenItem()", ->
|
describe "::reopenItem()", ->
|
||||||
it "opens the uri associated with the last closed pane that isn't currently open", ->
|
it "opens the uri associated with the last closed pane that isn't currently open", ->
|
||||||
|
Loading…
Reference in New Issue
Block a user