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 {main} from './main'; |
| 6 | |
| 7 | describe('main component', () => { |
| 8 | beforeEach(() => { |
| 9 | angular |
| 10 | .module('app', ['app/main.html']) |
| 11 | .component('app', main); |
| 12 | angular.mock.module('app'); |
| 13 | }); |
| 14 | |
Matteo Scandolo | a4a4711 | 2016-12-16 10:06:13 -0800 | [diff] [blame] | 15 | it('should render the header and footer', angular.mock.inject(($rootScope: ng.IRootScopeService, $compile: ng.ICompileService) => { |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 16 | const element = $compile('<app></app>')($rootScope); |
| 17 | $rootScope.$digest(); |
| 18 | expect(element.find('xos-header').length).toEqual(1); |
Matteo Scandolo | 266907e | 2016-12-20 13:41:42 -0800 | [diff] [blame] | 19 | // expect(element.find('xos-footer').length).toEqual(1); |
Matteo Scandolo | f6acdbe | 2016-12-13 10:29:37 -0800 | [diff] [blame] | 20 | })); |
| 21 | }); |