2016-05-09 22:55:16 +03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter';
|
|
|
|
|
|
|
|
import { RedocEventsService } from './events.service';
|
|
|
|
import { Hash } from './hash.service';
|
|
|
|
|
|
|
|
describe('Hash Service', () => {
|
|
|
|
let events = new RedocEventsService();
|
|
|
|
let hashService;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
hashService = new Hash(new BrowserDomAdapter(), events);
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
hashService.unbind();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should trigger changed event after ReDoc bootstrapped', (done) => {
|
|
|
|
spyOn(hashService.changed, 'next').and.callThrough();
|
2016-05-25 18:34:31 +03:00
|
|
|
events.bootstrapped.next({});
|
2016-05-09 22:55:16 +03:00
|
|
|
setTimeout(() => {
|
|
|
|
expect(hashService.changed.next).toHaveBeenCalled();
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|