redoc/lib/services/hash.service.spec.ts

24 lines
578 B
TypeScript
Raw Normal View History

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-10-23 20:18:42 +03:00
spyOn(hashService.value, 'next').and.callThrough();
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-05-09 22:55:16 +03:00
done();
});
});
});