Jelajahi Sumber

fix(): fixed failing unit test

Torkel Ödegaard 9 tahun lalu
induk
melakukan
431a610f00
1 mengubah file dengan 7 tambahan dan 1 penghapusan
  1. 7 1
      public/app/core/services/context_srv.ts

+ 7 - 1
public/app/core/services/context_srv.ts

@@ -2,7 +2,6 @@
 
 import config from 'app/core/config';
 import _ from 'lodash';
-import $ from 'jquery';
 import coreModule from 'app/core/core_module';
 import store from 'app/core/store';
 
@@ -34,6 +33,13 @@ export class ContextSrv {
       this.sidemenu = true;
     }
 
+    if (!config.buildInfo) {
+      config.buildInfo = {};
+    }
+    if (!config.bootData) {
+      config.bootData = {user: {}, settings: {}};
+    }
+
     this.version = config.buildInfo.version;
     this.lightTheme = false;
     this.user = new User();