diff options
author | jerasmus <jerasmus@gitlab.com> | 2018-10-15 12:42:24 +0200 |
---|---|---|
committer | jerasmus <jerasmus@gitlab.com> | 2018-10-15 12:42:24 +0200 |
commit | 58f29d5f855ea2e1411b99804a74710483a13f90 (patch) | |
tree | 0b06ecd3c0bb1bcf3d3c6660c2bc49eefaff08b2 /spec/javascripts/diffs/components/diff_file_header_spec.js | |
parent | 0572da24c990fc01d88acfbd32728221e3e3a711 (diff) | |
parent | a9827357186e38e5732d8dae23d9d02b1f4c7218 (diff) | |
download | gitlab-ce-58f29d5f855ea2e1411b99804a74710483a13f90.tar.gz |
Merge branch 'master' into 48746-fix-files-uploaded-in-base6448746-fix-files-uploaded-in-base64
Diffstat (limited to 'spec/javascripts/diffs/components/diff_file_header_spec.js')
-rw-r--r-- | spec/javascripts/diffs/components/diff_file_header_spec.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/javascripts/diffs/components/diff_file_header_spec.js b/spec/javascripts/diffs/components/diff_file_header_spec.js index c986ea604b2..1f7d5f42322 100644 --- a/spec/javascripts/diffs/components/diff_file_header_spec.js +++ b/spec/javascripts/diffs/components/diff_file_header_spec.js @@ -6,6 +6,8 @@ import DiffFileHeader from '~/diffs/components/diff_file_header.vue'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper'; +Vue.use(Vuex); + const discussionFixture = 'merge_requests/diff_discussion.json'; describe('diff_file_header', () => { @@ -58,19 +60,19 @@ describe('diff_file_header', () => { describe('titleLink', () => { beforeEach(() => { + props.discussionPath = 'link://to/discussion'; Object.assign(props.diffFile, { - fileHash: 'badc0ffee', submoduleLink: 'link://to/submodule', submoduleTreeUrl: 'some://tree/url', }); }); - it('returns the fileHash for files', () => { + it('returns the discussionPath for files', () => { props.diffFile.submodule = false; vm = mountComponentWithStore(Component, { props, store }); - expect(vm.titleLink).toBe(`#${props.diffFile.fileHash}`); + expect(vm.titleLink).toBe(props.discussionPath); }); it('returns the submoduleTreeUrl for submodules', () => { @@ -91,6 +93,13 @@ describe('diff_file_header', () => { expect(vm.titleLink).toBe(props.diffFile.submoduleLink); }); + + it('sets the correct path to the discussion', () => { + props.discussionPath = 'link://to/discussion'; + vm = mountComponentWithStore(Component, { props, store }); + const href = vm.$el.querySelector('.js-title-wrapper').getAttribute('href'); + expect(href).toBe(vm.discussionPath); + }); }); describe('filePath', () => { |