Commit 0a7b35b8 authored by Justin Ho's avatar Justin Ho

Add specs for Vue code

parent dbd0fbee
import { shallowMount } from '@vue/test-utils';
import JiraConnectApp from '~/jira_connect/components/app.vue';
describe('JiraConnectApp', () => {
let wrapper;
const createComponent = ({ ...options }) => {
wrapper = shallowMount(JiraConnectApp, {
...options,
});
};
afterEach(() => {
if (wrapper) {
wrapper.destroy();
wrapper = null;
}
});
const findHeader = () => wrapper.find('h3');
const findHeaderText = () => wrapper.find('h3').text();
describe('template', () => {
describe('newJiraConnectUi is false', () => {
it('does not render new UI', () => {
createComponent({
provide: {
glFeatures: { newJiraConnectUi: false },
},
});
expect(findHeader().exists()).toBe(false);
});
});
describe('newJiraConnectUi is true', () => {
it('renders new UI', () => {
createComponent({
provide: {
glFeatures: { newJiraConnectUi: true },
},
});
expect(findHeader().exists()).toBe(true);
expect(findHeaderText()).toBe('Linked namespaces');
});
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment