mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
Test it.
This commit is contained in:
parent
9adc822822
commit
d325e02def
@ -10,6 +10,7 @@ describe "TextEditorRegistry", ->
|
||||
it "gets added to the list of registered editors", ->
|
||||
editor = {}
|
||||
registry.add(editor)
|
||||
expect(editor.registered).toBe true
|
||||
expect(registry.editors.size).toBe 1
|
||||
expect(registry.editors.has(editor)).toBe(true)
|
||||
|
||||
@ -19,6 +20,16 @@ describe "TextEditorRegistry", ->
|
||||
expect(registry.editors.size).toBe 1
|
||||
disposable.dispose()
|
||||
expect(registry.editors.size).toBe 0
|
||||
expect(editor.registered).toBe false
|
||||
|
||||
it "can be removed", ->
|
||||
editor = {}
|
||||
registry.add(editor)
|
||||
expect(registry.editors.size).toBe 1
|
||||
success = registry.remove(editor)
|
||||
expect(success).toBe true
|
||||
expect(registry.editors.size).toBe 0
|
||||
expect(editor.registered).toBe false
|
||||
|
||||
describe "when the registry is observed", ->
|
||||
it "calls the callback for current and future editors until unsubscribed", ->
|
||||
|
Loading…
Reference in New Issue
Block a user