From 6ef769f209532748e17677e461a63b26d72bc7b7 Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 22 Oct 2018 14:36:32 +0200 Subject: [PATCH] test refactor --- client/core/src/directives/specs/bind.spec.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/client/core/src/directives/specs/bind.spec.js b/client/core/src/directives/specs/bind.spec.js index c96979f2f7..8a3551feb3 100644 --- a/client/core/src/directives/specs/bind.spec.js +++ b/client/core/src/directives/specs/bind.spec.js @@ -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(); }); };