test refactor
This commit is contained in:
parent
409c78ec94
commit
6ef769f209
|
@ -1,19 +1,13 @@
|
|||
describe('Directive bind', () => {
|
||||
let $scope;
|
||||
let element;
|
||||
let compile;
|
||||
|
||||
beforeEach(() => {
|
||||
angular.mock.module('client');
|
||||
});
|
||||
beforeEach(ngModule('client'));
|
||||
|
||||
compile = _element => {
|
||||
inject(($compile, $rootScope, _$timeout_, _$httpBackend_) => {
|
||||
$scope = $rootScope.$new();
|
||||
element = angular.element(_element);
|
||||
_$httpBackend_.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({});
|
||||
$compile(element)($scope);
|
||||
$scope.$digest();
|
||||
compile = html => {
|
||||
inject(($compile, $rootScope) => {
|
||||
let $element = $compile(html)($rootScope);
|
||||
$rootScope.$digest();
|
||||
$element.remove();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue