debian-mirror-gitlab/spec/frontend/boards/components/issuable_title_spec.js

34 lines
820 B
JavaScript
Raw Normal View History

2020-11-24 15:15:51 +05:30
import { shallowMount } from '@vue/test-utils';
import IssuableTitle from '~/boards/components/issuable_title.vue';
describe('IssuableTitle', () => {
let wrapper;
const defaultProps = {
title: 'One',
refPath: 'path',
};
const createComponent = () => {
wrapper = shallowMount(IssuableTitle, {
propsData: { ...defaultProps },
});
};
const findIssueContent = () => wrapper.find('[data-testid="issue-title"]');
beforeEach(() => {
createComponent();
});
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it('renders a title of an issue in the sidebar', () => {
expect(findIssueContent().text()).toContain('One');
});
it('renders a referencePath of an issue in the sidebar', () => {
expect(findIssueContent().text()).toContain('path');
});
});