Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Add failing test to demonstrate the bug identified in #17535
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrudolph committed Jul 24, 2018
1 parent 107ec43 commit 84a241c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/pane-spec.js
Expand Up @@ -219,6 +219,34 @@ describe('Pane', () => {
runs(() => expect(eventOrder).toEqual(['add', 'remove']))
})

it('subscribes to be notified when item terminates its pending state', () => {
const fakeDisposable = { dispose: () => {} }
const spy = jasmine.createSpy('onDidTerminatePendingState').andReturn((fakeDisposable))

const pane = new Pane(paneParams({items: []}))
const item = {
getTitle: () => '',
onDidTerminatePendingState: spy
}
pane.addItem(item)

expect(spy).toHaveBeenCalled()
})

it('subscribes to be notified when item is destroyed', () => {
const fakeDisposable = { dispose: () => {} }
const spy = jasmine.createSpy('onDidDestroy').andReturn((fakeDisposable))

const pane = new Pane(paneParams({items: []}))
const item = {
getTitle: () => '',
onDidDestroy: spy
}
pane.addItem(item)

expect(spy).toHaveBeenCalled()
})

describe('when using the old API of ::addItem(item, index)', () => {
beforeEach(() => spyOn(Grim, 'deprecate'))

Expand Down

0 comments on commit 84a241c

Please sign in to comment.