All files / app/assets/javascripts/token_access index.js

66.66% Statements 6/9
66.66% Branches 2/3
50% Functions 1/2
66.66% Lines 6/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34            1x   1x       1x 1x   1x 1x                                  
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import TokenAccessApp from './components/token_access_app.vue';
import cacheConfig from './graphql/cache_config';
 
Vue.use(VueApollo);
 
const apolloProvider = new VueApollo({
  defaultClient: createDefaultClient({}, { cacheConfig }),
});
 
export const initTokenAccess = (containerId = 'js-ci-token-access-app') => {
  const containerEl = document.getElementById(containerId);
 
  Eif (!containerEl) {
    return false;
  }
 
  const { fullPath } = containerEl.dataset;
 
  return new Vue({
    el: containerEl,
    name: 'TokenAccessAppsRoot',
    apolloProvider,
    provide: {
      fullPath,
    },
    render(createElement) {
      return createElement(TokenAccessApp);
    },
  });
};