summaryrefslogtreecommitdiff
path: root/spec/javascripts/diffs/components/parallel_diff_view_spec.js
blob: 091e01868d3994d38e925193f18176ec06a099c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Vue from 'vue';
import ParallelDiffView from '~/diffs/components/parallel_diff_view.vue';
import store from '~/mr_notes/stores';
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,
      diffLines: diffFile.parallelDiffLines,
    }).$mount();
  });

  describe('assigned', () => {
    describe('diffLines', () => {
      it('should normalize lines for empty cells', () => {
        expect(component.diffLines[0].left.type).toEqual(constants.EMPTY_CELL_TYPE);
        expect(component.diffLines[1].left.type).toEqual(constants.EMPTY_CELL_TYPE);
      });
    });
  });
});