test refactor

This commit is contained in:
Gerard 2018-10-22 14:36:32 +02:00
parent 409c78ec94
commit 6ef769f209
1 changed files with 6 additions and 12 deletions

View File

@ -1,19 +1,13 @@
describe('Directive bind', () => { describe('Directive bind', () => {
let $scope;
let element;
let compile; let compile;
beforeEach(() => { beforeEach(ngModule('client'));
angular.mock.module('client');
});
compile = _element => { compile = html => {
inject(($compile, $rootScope, _$timeout_, _$httpBackend_) => { inject(($compile, $rootScope) => {
$scope = $rootScope.$new(); let $element = $compile(html)($rootScope);
element = angular.element(_element); $rootScope.$digest();
_$httpBackend_.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({}); $element.remove();
$compile(element)($scope);
$scope.$digest();
}); });
}; };