UNPKG

612 BJavaScriptView Raw
1/**
2 * TODO(maksimrv): Remove this code
3 * It is currently required because permissions do not work without auth,
4 * but we can't stub the correct auth component and should mock all providers.
5 */
6export default function AuthProviderMock() {
7 this.$get = ['$q', function get($q) {
8 const promise = $q.resolve([]);
9
10 return {
11 auth: {
12 addListener() {},
13 getAPIPath() {
14 return '/';
15 },
16 requestToken() {
17 return promise;
18 },
19 http: {
20 get() {
21 return promise;
22 }
23 }
24 },
25 promise
26 };
27 }];
28}