-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cdk): remove UNIQUE_SELECTION_DISPATCHER_PROVIDER from cdk
- Loading branch information
1 parent
54d3134
commit 9726e89
Showing
4 changed files
with
23 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import { UniqueSelectionDispatcher } from './unique-selection-dispatcher'; | ||
import {UniqueSelectionDispatcher} from './unique-selection-dispatcher'; | ||
|
||
|
||
describe('Unique selection dispatcher', () => { | ||
let dispatcher: UniqueSelectionDispatcher; | ||
let dispatcher: UniqueSelectionDispatcher; | ||
|
||
beforeEach(() => dispatcher = new UniqueSelectionDispatcher()); | ||
beforeEach(() => dispatcher = new UniqueSelectionDispatcher()); | ||
|
||
it('should notify registered listeners', () => { | ||
const spy = jasmine.createSpy('listen handler'); | ||
it('should notify registered listeners', () => { | ||
const spy = jasmine.createSpy('listen handler'); | ||
|
||
dispatcher.listen(spy); | ||
dispatcher.notify('id', 'name'); | ||
dispatcher.listen(spy); | ||
dispatcher.notify('id', 'name'); | ||
|
||
expect(spy).toHaveBeenCalledWith('id', 'name'); | ||
}); | ||
expect(spy).toHaveBeenCalledWith('id', 'name'); | ||
}); | ||
|
||
it('should not notify unregistered listeners', () => { | ||
const spy = jasmine.createSpy('listen handler'); | ||
const unregister = dispatcher.listen(spy); | ||
it('should not notify unregistered listeners', () => { | ||
const spy = jasmine.createSpy('listen handler'); | ||
const unregister = dispatcher.listen(spy); | ||
|
||
unregister(); | ||
dispatcher.notify('id', 'name'); | ||
unregister(); | ||
dispatcher.notify('id', 'name'); | ||
|
||
expect(spy).not.toHaveBeenCalled(); | ||
}); | ||
expect(spy).not.toHaveBeenCalled(); | ||
}); | ||
|
||
it('should remove all listeners when destroyed', () => { | ||
const spy = jasmine.createSpy('listen handler'); | ||
dispatcher.listen(spy); | ||
it('should remove all listeners when destroyed', () => { | ||
const spy = jasmine.createSpy('listen handler'); | ||
dispatcher.listen(spy); | ||
|
||
dispatcher.ngOnDestroy(); | ||
dispatcher.notify('id', 'name'); | ||
dispatcher.ngOnDestroy(); | ||
dispatcher.notify('id', 'name'); | ||
|
||
expect(spy).not.toHaveBeenCalled(); | ||
}); | ||
expect(spy).not.toHaveBeenCalled(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters