blob: 4193bc9930ff37ec5fbb741de7aa12f55916f430 [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 {xosFooter} from './footer';
Matteo Scandolo828d1e82017-01-17 14:49:38 -08006
7const MockStyleConfig = {
8 projectName: 'CORD'
9};
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080010
11describe('footer component', () => {
12 beforeEach(() => {
13 angular
14 .module('xosFooter', ['app/core/footer/footer.html'])
Matteo Scandolo828d1e82017-01-17 14:49:38 -080015 .component('xosFooter', xosFooter)
16 .constant('StyleConfig', MockStyleConfig);
17
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080018 angular.mock.module('xosFooter');
19 });
20
21 it('should render "XOS Team"', angular.mock.inject(($rootScope: ng.IRootScopeService, $compile: ng.ICompileService) => {
22 const element = $compile('<xos-footer></xos-footer>')($rootScope);
23 $rootScope.$digest();
24 const footer = element.find('a');
Matteo Scandolo828d1e82017-01-17 14:49:38 -080025 expect(footer.html().trim()).toEqual(`${MockStyleConfig.projectName} Team`);
Matteo Scandolof6acdbe2016-12-13 10:29:37 -080026 }));
27});