2016-05-09 22:55:16 +03:00
|
|
|
'use strict';
|
2016-10-23 20:18:42 +03:00
|
|
|
import {
|
|
|
|
inject
|
|
|
|
} from '@angular/core/testing';
|
2016-05-09 22:55:16 +03:00
|
|
|
|
|
|
|
import { Hash } from './hash.service';
|
2016-10-23 20:18:42 +03:00
|
|
|
import { SpecManager } from '../utils/spec-manager';
|
2016-05-09 22:55:16 +03:00
|
|
|
|
|
|
|
describe('Hash Service', () => {
|
2016-10-23 20:18:42 +03:00
|
|
|
let specMgr = new SpecManager();
|
2016-05-09 22:55:16 +03:00
|
|
|
let hashService;
|
|
|
|
|
2016-10-23 20:18:42 +03:00
|
|
|
beforeEach(inject([Hash], (_hash) => hashService = _hash));
|
2016-05-09 22:55:16 +03:00
|
|
|
|
|
|
|
it('should trigger changed event after ReDoc bootstrapped', (done) => {
|
2016-11-23 02:23:32 +03:00
|
|
|
spyOn(hashService.value, 'next').and.stub();
|
2016-10-23 20:18:42 +03:00
|
|
|
specMgr.spec.next({});
|
2016-05-09 22:55:16 +03:00
|
|
|
setTimeout(() => {
|
2016-10-23 20:18:42 +03:00
|
|
|
expect(hashService.value.next).toHaveBeenCalled();
|
2016-11-23 02:23:32 +03:00
|
|
|
hashService.value.next.and.callThrough();
|
2016-05-09 22:55:16 +03:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|