blob: 0191a87da3e15044ef972df3a4354e85759b8335 [file] [log] [blame]
Matteo Scandolof6acdbe2016-12-13 10:29:37 -08001/// <reference path="../../../../typings/index.d.ts" />
2
3import * as angular from 'angular';
4import 'angular-mocks';
5import {xosHeader} from './header';
6import {StyleConfig} from '../../config/style.config';
Matteo Scandolo63e43eb2016-12-14 14:18:53 -08007import {Subject} from 'rxjs';
Matteo Scandolof6acdbe2016-12-13 10:29:37 -08008
9describe('header component', () => {
10 beforeEach(() => {
11 angular
12 .module('xosHeader', ['app/core/header/header.html'])
Matteo Scandolo63e43eb2016-12-14 14:18:53 -080013 .component('xosHeader', xosHeader)
14 .service('SynchronizerStore', function(){
15 const events = new Subject();
16 this.query = () => {
17 return events.asObservable();
18 };
19 });
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080020 angular.mock.module('xosHeader');
21 });
22
23 it('should render the appropriate title', angular.mock.inject(($rootScope: ng.IRootScopeService, $compile: ng.ICompileService) => {
24 const element = $compile('<xos-header></xos-header>')($rootScope);
25 $rootScope.$digest();
26 const header = element.find('a');
27 expect(header.html().trim()).toEqual(StyleConfig.projectName);
28 }));
29});