2019-12-02 13:15:58 -05:00
|
|
|
import { docRegionObserver } from './subscribing';
|
|
|
|
|
|
|
|
describe('subscribing', () => {
|
|
|
|
it('should subscribe and emit', () => {
|
2021-05-08 16:02:03 +02:00
|
|
|
const consoleSpy = jasmine.createSpyObj<Console>('console', ['log']);
|
|
|
|
docRegionObserver(consoleSpy);
|
|
|
|
expect(consoleSpy.log).toHaveBeenCalledTimes(8);
|
|
|
|
expect(consoleSpy.log.calls.allArgs()).toEqual([
|
2019-12-02 13:15:58 -05:00
|
|
|
['Observer got a next value: 1'],
|
|
|
|
['Observer got a next value: 2'],
|
|
|
|
['Observer got a next value: 3'],
|
|
|
|
['Observer got a complete notification'],
|
|
|
|
['Observer got a next value: 1'],
|
|
|
|
['Observer got a next value: 2'],
|
|
|
|
['Observer got a next value: 3'],
|
|
|
|
['Observer got a complete notification'],
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|