summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-09-05 16:45:21 +0100
committerPhil Hughes <me@iamphill.com>2017-09-05 16:45:21 +0100
commitdf35410a9b908361843dcc9e36bcf73d4a704300 (patch)
tree3e61b74cc69a8b680dbdf34154bb7c9ce473276f
parent337a73e18c63ff3abe9d3b66892176e0118d4046 (diff)
downloadgitlab-ce-df35410a9b908361843dcc9e36bcf73d4a704300.tar.gz
fixed karma spec
-rw-r--r--spec/javascripts/projects_dropdown/service/projects_service_spec.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/javascripts/projects_dropdown/service/projects_service_spec.js b/spec/javascripts/projects_dropdown/service/projects_service_spec.js
index e9aabfaec1f..7abfa463582 100644
--- a/spec/javascripts/projects_dropdown/service/projects_service_spec.js
+++ b/spec/javascripts/projects_dropdown/service/projects_service_spec.js
@@ -12,12 +12,21 @@ FREQUENT_PROJECTS.MAX_COUNT = 3;
describe('ProjectsService', () => {
let service;
+ let originalGon;
beforeEach(() => {
- gon.api_version = currentSession.apiVersion;
+ originalGon = window.gon;
+
+ window.gon = Object.assign({}, {
+ api_version: currentSession.apiVersion,
+ });
service = new ProjectsService(currentSession.username);
});
+ afterEach(() => {
+ window.gon = originalGon;
+ });
+
describe('contructor', () => {
it('should initialize default properties of class', () => {
expect(service.isLocalStorageAvailable).toBeTruthy();