gitlab-org--gitlab-foss/spec/frontend/diffs/components/parallel_diff_view_spec.js

34 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-06-21 08:22:40 -04:00
import Vue from 'vue';
import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
import { createStore } from '~/mr_notes/stores';
import ParallelDiffView from '~/diffs/components/parallel_diff_view.vue';
import * as constants from '~/diffs/constants';
2018-06-21 08:22:40 -04:00
import diffFileMockData from '../mock_data/diff_file';
describe('ParallelDiffView', () => {
let component;
const getDiffFileMock = () => ({ ...diffFileMockData });
2018-06-21 08:22:40 -04:00
beforeEach(() => {
const diffFile = getDiffFileMock();
component = createComponentWithStore(Vue.extend(ParallelDiffView), createStore(), {
2018-06-21 08:22:40 -04:00
diffFile,
diffLines: diffFile.parallel_diff_lines,
2018-06-21 08:22:40 -04:00
}).$mount();
});
afterEach(() => {
component.$destroy();
});
2018-09-03 03:44:46 -04:00
describe('assigned', () => {
describe('diffLines', () => {
2018-06-21 08:22:40 -04:00
it('should normalize lines for empty cells', () => {
2018-09-03 03:44:46 -04:00
expect(component.diffLines[0].left.type).toEqual(constants.EMPTY_CELL_TYPE);
expect(component.diffLines[1].left.type).toEqual(constants.EMPTY_CELL_TYPE);
2018-06-21 08:22:40 -04:00
});
});
});
});