Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
99e96b4c
Commit
99e96b4c
authored
Dec 03, 2015
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove $compile global from tests
parent
cbb1d56d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
annotation-test.js
h/static/scripts/directive/test/annotation-test.js
+12
-14
No files found.
h/static/scripts/directive/test/annotation-test.js
View file @
99e96b4c
...
...
@@ -6,6 +6,15 @@ var events = require('../../events');
var
module
=
angular
.
mock
.
module
;
var
inject
=
angular
.
mock
.
inject
;
/** Return Angular's $compile service. */
function
compileService
()
{
var
$compile
;
inject
(
function
(
_$compile_
)
{
$compile
=
_$compile_
;
});
return
$compile
;
}
describe
(
'annotation.js'
,
function
()
{
describe
(
'extractDocumentMetadata()'
,
function
()
{
...
...
@@ -280,7 +289,6 @@ describe('annotation.js', function() {
});
describe
(
'AnnotationController'
,
function
()
{
var
$compile
;
var
$document
;
var
$element
;
var
$q
;
...
...
@@ -311,7 +319,7 @@ describe('annotation.js', function() {
createDirective
=
function
()
{
$element
=
angular
.
element
(
'<div annotation="annotation">'
);
$compile
(
$element
)(
$scope
);
compileService
()
(
$element
)(
$scope
);
$scope
.
$digest
();
var
controller
=
$element
.
controller
(
'annotation'
);
isolateScope
=
$element
.
isolateScope
();
...
...
@@ -431,9 +439,8 @@ describe('annotation.js', function() {
beforeEach
(
inject
(
function
(
_$
compile_
,
_$
document_
,
_$q_
,
_$rootScope_
,
_$timeout_
,
function
(
_$document_
,
_$q_
,
_$rootScope_
,
_$timeout_
,
_$window_
)
{
$compile
=
_$compile_
;
$document
=
_$document_
;
$window
=
_$window_
;
$q
=
_$q_
;
...
...
@@ -1235,15 +1242,6 @@ describe('annotation.js', function() {
beforeEach
(
module
(
'h.templates'
));
/** Return Angular's $compile service. */
function
getCompileService
()
{
var
$compile
;
inject
(
function
(
_$compile_
)
{
$compile
=
_$compile_
;
});
return
$compile
;
}
/** Return Angular's $rootScope. */
function
getRootScope
()
{
var
$rootScope
;
...
...
@@ -1355,7 +1353,7 @@ describe('annotation.js', function() {
$provide
.
value
(
'localStorage'
,
locals
.
localStorage
);
});
locals
.
element
=
angular
.
element
(
'<div annotation="annotation">'
);
var
compiledElement
=
getC
ompileService
()(
locals
.
element
);
var
compiledElement
=
c
ompileService
()(
locals
.
element
);
locals
.
$rootScope
=
getRootScope
();
locals
.
parentScope
=
locals
.
$rootScope
.
$new
();
locals
.
parentScope
.
annotation
=
args
.
annotation
||
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment