37 lines
898 B
JavaScript
37 lines
898 B
JavaScript
import { shallowMount, createLocalVue } from '@vue/test-utils';
|
|
import Vuex from 'vuex';
|
|
import parallelDiffTableRow from '~/diffs/components/parallel_diff_table_row.vue';
|
|
import ParallelDiffView from '~/diffs/components/parallel_diff_view.vue';
|
|
import { createStore } from '~/mr_notes/stores';
|
|
import diffFileMockData from '../mock_data/diff_file';
|
|
|
|
let wrapper;
|
|
const localVue = createLocalVue();
|
|
|
|
localVue.use(Vuex);
|
|
|
|
function factory() {
|
|
const diffFile = { ...diffFileMockData };
|
|
const store = createStore();
|
|
|
|
wrapper = shallowMount(ParallelDiffView, {
|
|
localVue,
|
|
store,
|
|
propsData: {
|
|
diffFile,
|
|
diffLines: diffFile.parallel_diff_lines,
|
|
},
|
|
});
|
|
}
|
|
|
|
describe('ParallelDiffView', () => {
|
|
afterEach(() => {
|
|
wrapper.destroy();
|
|
});
|
|
|
|
it('renders diff lines', () => {
|
|
factory();
|
|
|
|
expect(wrapper.findAll(parallelDiffTableRow).length).toBe(8);
|
|
});
|
|
});
|