mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge pull request #16074 from UziTech/patch-4
Make notifications.clear public and emit event
This commit is contained in:
@@ -66,4 +66,27 @@ describe('NotificationManager', () => {
|
||||
expect(notification.getType()).toBe('success')
|
||||
})
|
||||
})
|
||||
|
||||
describe('clearing notifications', () => {
|
||||
it('clears the notifications when ::clear has been called', () => {
|
||||
manager.addSuccess('success')
|
||||
expect(manager.getNotifications().length).toBe(1)
|
||||
manager.clear()
|
||||
expect(manager.getNotifications().length).toBe(0)
|
||||
})
|
||||
|
||||
describe('adding events', () => {
|
||||
let clearSpy
|
||||
|
||||
beforeEach(() => {
|
||||
clearSpy = jasmine.createSpy()
|
||||
manager.onDidClearNotifications(clearSpy)
|
||||
})
|
||||
|
||||
it('emits an event when the notifications have been cleared', () => {
|
||||
manager.clear()
|
||||
expect(clearSpy).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user