mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Add spec to ensure we unsubscribe from every buffer when we remove editor
This commit is contained in:
parent
024618b69a
commit
1344d42061
@ -79,6 +79,18 @@ describe "Editor", ->
|
||||
expect(newEditor.scrollView.scrollLeft()).toBe 44
|
||||
newEditor.remove()
|
||||
|
||||
describe ".remove()", ->
|
||||
it "removes subscriptions from all edit session buffers", ->
|
||||
otherBuffer = new Buffer(require.resolve('fixtures/sample.txt'))
|
||||
expect(buffer.subscriptionCount()).toBeGreaterThan 1
|
||||
|
||||
editor.setBuffer(otherBuffer)
|
||||
expect(otherBuffer.subscriptionCount()).toBeGreaterThan 1
|
||||
|
||||
editor.remove()
|
||||
expect(buffer.subscriptionCount()).toBe 1
|
||||
expect(otherBuffer.subscriptionCount()).toBe 1
|
||||
|
||||
describe ".setBuffer(buffer)", ->
|
||||
it "sets the cursor to the beginning of the file", ->
|
||||
expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
|
||||
|
Loading…
Reference in New Issue
Block a user