mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-08-10 03:00:46 +00:00
29 lines
639 B
JavaScript
29 lines
639 B
JavaScript
import { shallowMount } from '@vue/test-utils';
|
|
import Vue from 'vue';
|
|
import GlAbilities from '~/vue_shared/gl_abilities_plugin';
|
|
|
|
describe('GitLab Abilities Plugin', () => {
|
|
beforeEach(() => {
|
|
window.gon = {
|
|
abilities: {
|
|
aAbility: true,
|
|
bAbility: false,
|
|
},
|
|
};
|
|
|
|
Vue.use(GlAbilities);
|
|
});
|
|
|
|
it('should provide glAbilities to components', () => {
|
|
const component = {
|
|
template: `<span></span>`,
|
|
inject: ['glAbilities'],
|
|
};
|
|
const wrapper = shallowMount(component);
|
|
expect(wrapper.vm.glAbilities).toEqual({
|
|
aAbility: true,
|
|
bAbility: false,
|
|
});
|
|
});
|
|
});
|