Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 1 | /// <reference path="../../../../typings/index.d.ts" /> |
| 2 | |
| 3 | import * as angular from 'angular'; |
| 4 | import 'angular-mocks'; |
| 5 | import {xosFooter} from './footer'; |
Matteo Scandolo | 828d1e8 | 2017-01-17 14:49:38 -0800 | [diff] [blame] | 6 | |
| 7 | const MockStyleConfig = { |
| 8 | projectName: 'CORD' |
| 9 | }; |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 10 | |
| 11 | describe('footer component', () => { |
| 12 | beforeEach(() => { |
| 13 | angular |
| 14 | .module('xosFooter', ['app/core/footer/footer.html']) |
Matteo Scandolo | 828d1e8 | 2017-01-17 14:49:38 -0800 | [diff] [blame] | 15 | .component('xosFooter', xosFooter) |
| 16 | .constant('StyleConfig', MockStyleConfig); |
| 17 | |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 18 | 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 Scandolo | 828d1e8 | 2017-01-17 14:49:38 -0800 | [diff] [blame] | 25 | expect(footer.html().trim()).toEqual(`${MockStyleConfig.projectName} Team`); |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 26 | })); |
| 27 | }); |