mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Move snapshot code to package
This commit is contained in:
@@ -2706,21 +2706,6 @@ describe "EditorView", ->
|
||||
expect(buffer.lineForRow(15)).toBeUndefined()
|
||||
expect(editorView.getCursorBufferPosition()).toEqual [13, 0]
|
||||
|
||||
describe "editor:save-debug-snapshot", ->
|
||||
it "saves the state of the rendered lines, the display buffer, and the buffer to a file of the user's choosing", ->
|
||||
saveDialogCallback = null
|
||||
spyOn(atom, 'showSaveDialog').andCallFake (callback) -> saveDialogCallback = callback
|
||||
spyOn(fs, 'writeFileSync')
|
||||
|
||||
editorView.trigger 'editor:save-debug-snapshot'
|
||||
|
||||
statePath = path.join(temp.dir, 'state')
|
||||
expect(atom.showSaveDialog).toHaveBeenCalled()
|
||||
saveDialogCallback(statePath)
|
||||
expect(fs.writeFileSync).toHaveBeenCalled()
|
||||
expect(fs.writeFileSync.argsForCall[0][0]).toBe statePath
|
||||
expect(typeof fs.writeFileSync.argsForCall[0][1]).toBe 'string'
|
||||
|
||||
describe "when the escape key is pressed on the editor view", ->
|
||||
it "clears multiple selections if there are any, and otherwise allows other bindings to be handled", ->
|
||||
atom.keymap.bindKeys 'name', '.editor', 'escape': 'test-event'
|
||||
|
||||
Reference in New Issue
Block a user