Commit 2a83a508 authored by Robert Knight's avatar Robert Knight

Make fake services/filters local to beforeEach() scope

Where a fake service/filter is not accessed directly
by any tests, make it local to beforeEach().

This reduces the surface area of globals exposed to all tests.
parent e1620fc8
......@@ -423,19 +423,12 @@ describe('annotation', function() {
var $timeout;
var $window;
var fakeAnnotationMapper;
var fakeAnnotationUI;
var fakeDocumentDomainFilter;
var fakeDocumentTitleFilter;
var fakeDrafts;
var fakeFeatures;
var fakeFlash;
var fakeGroups;
var fakePermissions;
var fakeSession;
var fakeSettings;
var fakeTags;
var fakeTime;
var fakeUrlEncodeFilter;
var sandbox;
function createDirective(annotation) {
......@@ -572,7 +565,7 @@ describe('annotation', function() {
deleteAnnotation: sandbox.stub()
};
fakeAnnotationUI = {};
var fakeAnnotationUI = {};
fakeDrafts = {
update: sandbox.stub(),
......@@ -580,7 +573,7 @@ describe('annotation', function() {
get: sandbox.stub()
};
fakeFeatures = {
var fakeFeatures = {
flagEnabled: sandbox.stub().returns(true)
};
......@@ -608,11 +601,11 @@ describe('annotation', function() {
}
};
fakeSettings = {
var fakeSettings = {
serviceUrl: 'https://test.hypothes.is/',
};
fakeTags = {
var fakeTags = {
filter: sandbox.stub().returns('a while ago'),
store: sandbox.stub()
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment