debian-mirror-gitlab/spec/frontend/diffs/components/parallel_diff_view_spec.js

34 lines
1 KiB
JavaScript
Raw Normal View History

2018-11-08 19:23:39 +05:30
import Vue from 'vue';
2019-10-12 21:52:04 +05:30
import { createStore } from 'ee_else_ce/mr_notes/stores';
2020-04-22 19:07:51 +05:30
import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
2020-01-01 13:55:28 +05:30
import ParallelDiffView from '~/diffs/components/parallel_diff_view.vue';
import * as constants from '~/diffs/constants';
2018-11-08 19:23:39 +05:30
import diffFileMockData from '../mock_data/diff_file';
describe('ParallelDiffView', () => {
let component;
2020-05-24 23:13:21 +05:30
const getDiffFileMock = () => ({ ...diffFileMockData });
2018-11-08 19:23:39 +05:30
beforeEach(() => {
const diffFile = getDiffFileMock();
2019-10-12 21:52:04 +05:30
component = createComponentWithStore(Vue.extend(ParallelDiffView), createStore(), {
2018-11-08 19:23:39 +05:30
diffFile,
2019-02-15 15:39:39 +05:30
diffLines: diffFile.parallel_diff_lines,
2018-11-08 19:23:39 +05:30
}).$mount();
});
2019-07-07 11:18:12 +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
});
});
});
});