Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This commit is contained in:
Nathan Sobo
2016-07-06 12:58:07 -06:00
committed by Max Brunsfeld
parent a5613cd7e4
commit bb1516ee77

View File

@@ -9,8 +9,8 @@ describe('TextEditorRegistry', function () {
registry = new TextEditorRegistry()
})
describe('when a TextEditor is added', function () {
it('gets added to the list of registered editors', function () {
describe('.add', function () {
it('adds an editor to the list of registered editors', function () {
editor = {}
registry.add(editor)
expect(editor.registered).toBe(true)
@@ -26,19 +26,9 @@ describe('TextEditorRegistry', function () {
expect(registry.editors.size).toBe(0)
expect(editor.registered).toBe(false)
})
it('can be removed', function () {
editor = {}
registry.add(editor)
expect(registry.editors.size).toBe(1)
const 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', function () {
describe('.observe', function () {
it('calls the callback for current and future editors until unsubscribed', function () {
const spy = jasmine.createSpy()
const [editor1, editor2, editor3] = [{}, {}, {}]