angular-nevera-generator
Version:
Yeoman AngularJS scaffold a webapp with Angular 1 written in ES6 (Babel), TypeScript through Webpack or SystemJS including tools Gulp 4, ESLint, Browsersync and Karma
20 lines (17 loc) • 741 B
text/typescript
import * as angular from 'angular';
import 'angular-mocks';
import {footer} from './footer';
describe('footer component', () => {
beforeEach(() => {
angular
.module('fountainFooter', ['<%- templateUrl %>'])
.component('fountainFooter', footer);
<%- modules !== 'systemjs' ? 'angular.mock.' : '' %>module('fountainFooter');
});
it('should render \'FountainJS team\'', <%- modules !== 'systemjs' ? 'angular.mock.' : '' %>inject(($rootScope: ng.IRootScopeService, $compile: ng.ICompileService) => {
const element = $compile('<fountain-footer></fountain-footer>')($rootScope);
$rootScope.$digest();
const footer = element.find('a');
expect(footer.html().trim()).toEqual('FountainJS team');
}));
});