summaryrefslogtreecommitdiff
path: root/spec/javascripts/diffs/components/diff_line_gutter_content_spec.js
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-06-27 21:20:41 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-06-27 21:20:41 +0000
commitfbf747194f2a655aab3670c30cc6f054c29bbfe7 (patch)
tree57fb1be412df30689face16c86ff8abe0c89c20c /spec/javascripts/diffs/components/diff_line_gutter_content_spec.js
parent5c13af58b89c6b6721ba018e519738b291f7f72b (diff)
downloadgitlab-ce-fbf747194f2a655aab3670c30cc6f054c29bbfe7.tar.gz
Componentize diff lines and diff comments
Diffstat (limited to 'spec/javascripts/diffs/components/diff_line_gutter_content_spec.js')
-rw-r--r--spec/javascripts/diffs/components/diff_line_gutter_content_spec.js47
1 files changed, 1 insertions, 46 deletions
diff --git a/spec/javascripts/diffs/components/diff_line_gutter_content_spec.js b/spec/javascripts/diffs/components/diff_line_gutter_content_spec.js
index cce10c4083c..2d136a63c52 100644
--- a/spec/javascripts/diffs/components/diff_line_gutter_content_spec.js
+++ b/spec/javascripts/diffs/components/diff_line_gutter_content_spec.js
@@ -2,12 +2,6 @@ import Vue from 'vue';
import DiffLineGutterContent from '~/diffs/components/diff_line_gutter_content.vue';
import store from '~/mr_notes/stores';
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
-import {
- MATCH_LINE_TYPE,
- CONTEXT_LINE_TYPE,
- OLD_NO_NEW_LINE_TYPE,
- NEW_NO_NEW_LINE_TYPE,
-} from '~/diffs/constants';
import discussionsMockData from '../mock_data/diff_discussions';
import diffFileMockData from '../mock_data/diff_file';
@@ -31,45 +25,6 @@ describe('DiffLineGutterContent', () => {
};
describe('computed', () => {
- describe('isMatchLine', () => {
- it('should return true for match line type', () => {
- const component = createComponent({ lineType: MATCH_LINE_TYPE });
- expect(component.isMatchLine).toEqual(true);
- });
-
- it('should return false for non-match line type', () => {
- const component = createComponent({ lineType: CONTEXT_LINE_TYPE });
- expect(component.isMatchLine).toEqual(false);
- });
- });
-
- describe('isContextLine', () => {
- it('should return true for context line type', () => {
- const component = createComponent({ lineType: CONTEXT_LINE_TYPE });
- expect(component.isContextLine).toEqual(true);
- });
-
- it('should return false for non-context line type', () => {
- const component = createComponent({ lineType: MATCH_LINE_TYPE });
- expect(component.isContextLine).toEqual(false);
- });
- });
-
- describe('isMetaLine', () => {
- it('should return true for meta line type', () => {
- const component = createComponent({ lineType: NEW_NO_NEW_LINE_TYPE });
- expect(component.isMetaLine).toEqual(true);
-
- const component2 = createComponent({ lineType: OLD_NO_NEW_LINE_TYPE });
- expect(component2.isMetaLine).toEqual(true);
- });
-
- it('should return false for non-meta line type', () => {
- const component = createComponent({ lineType: MATCH_LINE_TYPE });
- expect(component.isMetaLine).toEqual(false);
- });
- });
-
describe('lineHref', () => {
it('should prepend # to lineCode', () => {
const lineCode = 'LC_42';
@@ -109,7 +64,7 @@ describe('DiffLineGutterContent', () => {
describe('template', () => {
it('should render three dots for context lines', () => {
const component = createComponent({
- lineType: MATCH_LINE_TYPE,
+ isMatchLine: true,
});
expect(component.$el.querySelector('span').classList.contains('context-cell')).toEqual(true);