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
2016c935
Commit
2016c935
authored
Jun 19, 2017
by
Sean Hammond
Committed by
GitHub
Jun 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #448 from hypothesis/fix-angular-dup-warning
Fix warning about loading Angular twice in tests
parents
8b8ac608
a18bdaf6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
10 deletions
+6
-10
app.js
src/sidebar/app.js
+1
-0
session.js
src/sidebar/session.js
+1
-2
session-test.js
src/sidebar/test/session-test.js
+4
-8
No files found.
src/sidebar/app.js
View file @
2016c935
...
...
@@ -211,6 +211,7 @@ module.exports = angular.module('h', [
.
value
(
'ExcerptOverflowMonitor'
,
require
(
'./util/excerpt-overflow-monitor'
))
.
value
(
'VirtualThreadList'
,
require
(
'./virtual-thread-list'
))
.
value
(
'raven'
,
require
(
'./raven'
))
.
value
(
'serviceConfig'
,
serviceConfig
)
.
value
(
'settings'
,
settings
)
.
value
(
'time'
,
require
(
'./time'
))
.
value
(
'urlEncodeFilter'
,
require
(
'./filter/url'
).
encode
)
...
...
src/sidebar/session.js
View file @
2016c935
...
...
@@ -4,7 +4,6 @@ var angular = require('angular');
var
events
=
require
(
'./events'
);
var
retryUtil
=
require
(
'./retry-util'
);
var
serviceConfig
=
require
(
'./service-config'
);
var
CACHE_TTL
=
5
*
60
*
1000
;
// 5 minutes
...
...
@@ -45,7 +44,7 @@ function sessionActions(options) {
* @ngInject
*/
function
session
(
$http
,
$q
,
$resource
,
$rootScope
,
analytics
,
annotationUI
,
auth
,
flash
,
raven
,
settings
,
store
)
{
flash
,
raven
,
settings
,
s
erviceConfig
,
s
tore
)
{
// Headers sent by every request made by the session service.
var
headers
=
{};
var
actions
=
sessionActions
({
...
...
src/sidebar/test/session-test.js
View file @
2016c935
'use strict'
;
var
angular
=
require
(
'angular'
);
var
proxyquire
=
require
(
'proxyquire'
);
var
events
=
require
(
'../events'
);
...
...
@@ -15,7 +14,7 @@ describe('session', function () {
var
fakeAuth
;
var
fakeFlash
;
var
fakeRaven
;
var
fakeServiceConfig
=
sinon
.
stub
()
;
var
fakeServiceConfig
;
var
fakeSettings
;
var
fakeStore
;
var
sandbox
;
...
...
@@ -23,10 +22,7 @@ describe('session', function () {
before
(
function
()
{
angular
.
module
(
'h'
,
[
'ngResource'
])
.
service
(
'session'
,
proxyquire
(
'../session'
,
{
'./service-config'
:
fakeServiceConfig
})
);
.
service
(
'session'
,
require
(
'../session'
));
});
beforeEach
(
function
()
{
...
...
@@ -58,8 +54,7 @@ describe('session', function () {
update
:
sandbox
.
stub
().
returns
(
Promise
.
resolve
({})),
},
};
fakeServiceConfig
.
reset
();
fakeServiceConfig
.
returns
(
null
);
fakeServiceConfig
=
sinon
.
stub
().
returns
(
null
);
fakeSettings
=
{
serviceUrl
:
'https://test.hypothes.is/root/'
,
};
...
...
@@ -71,6 +66,7 @@ describe('session', function () {
flash
:
fakeFlash
,
raven
:
fakeRaven
,
settings
:
fakeSettings
,
serviceConfig
:
fakeServiceConfig
,
store
:
fakeStore
,
});
});
...
...
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