test refactor
This commit is contained in:
parent
409c78ec94
commit
6ef769f209
|
@ -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();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue