2018-11-08 19:23:39 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import ParallelDiffView from '~/diffs/components/parallel_diff_view.vue';
|
2019-05-18 00:54:41 +05:30
|
|
|
import store from 'ee_else_ce/mr_notes/stores';
|
2018-11-08 19:23:39 +05:30
|
|
|
import * as constants from '~/diffs/constants';
|
|
|
|
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
|
|
|
|
import diffFileMockData from '../mock_data/diff_file';
|
|
|
|
|
|
|
|
describe('ParallelDiffView', () => {
|
|
|
|
let component;
|
|
|
|
const getDiffFileMock = () => Object.assign({}, diffFileMockData);
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
const diffFile = getDiffFileMock();
|
|
|
|
|
|
|
|
component = createComponentWithStore(Vue.extend(ParallelDiffView), store, {
|
|
|
|
diffFile,
|
2019-02-15 15:39:39 +05:30
|
|
|
diffLines: diffFile.parallel_diff_lines,
|
2018-11-08 19:23:39 +05:30
|
|
|
}).$mount();
|
|
|
|
});
|
|
|
|
|
2019-05-18 00:54:41 +05:30
|
|
|
afterEach(() => {
|
|
|
|
component.$destroy();
|
|
|
|
});
|
|
|
|
|
2018-11-20 20:47:30 +05:30
|
|
|
describe('assigned', () => {
|
|
|
|
describe('diffLines', () => {
|
2018-11-08 19:23:39 +05:30
|
|
|
it('should normalize lines for empty cells', () => {
|
2018-11-20 20:47:30 +05:30
|
|
|
expect(component.diffLines[0].left.type).toEqual(constants.EMPTY_CELL_TYPE);
|
|
|
|
expect(component.diffLines[1].left.type).toEqual(constants.EMPTY_CELL_TYPE);
|
2018-11-08 19:23:39 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|