diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:05 +0300 |
commit | c2367afbf57ebc65d5b78a743b5d6a91f0aece9f (patch) | |
tree | 165c2c54bf72ab3a3a9417d97f63ece5c9eba9f5 /spec/frontend/releases/components/evidence_block_spec.js | |
parent | 51a9512965d86e3094968fa514e4ae8a96d38cf3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/releases/components/evidence_block_spec.js')
-rw-r--r-- | spec/frontend/releases/components/evidence_block_spec.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/frontend/releases/components/evidence_block_spec.js b/spec/frontend/releases/components/evidence_block_spec.js index 7b896575965..fb62f4a3bfe 100644 --- a/spec/frontend/releases/components/evidence_block_spec.js +++ b/spec/frontend/releases/components/evidence_block_spec.js @@ -2,12 +2,14 @@ import { mount } from '@vue/test-utils'; import { GlLink } from '@gitlab/ui'; import { truncateSha } from '~/lib/utils/text_utility'; import Icon from '~/vue_shared/components/icon.vue'; -import { release } from '../mock_data'; +import { release as originalRelease } from '../mock_data'; import EvidenceBlock from '~/releases/components/evidence_block.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; +import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; describe('Evidence Block', () => { let wrapper; + let release; const factory = (options = {}) => { wrapper = mount(EvidenceBlock, { @@ -16,6 +18,8 @@ describe('Evidence Block', () => { }; beforeEach(() => { + release = convertObjectPropsToCamelCase(originalRelease, { deep: true }); + factory({ propsData: { release, @@ -32,7 +36,7 @@ describe('Evidence Block', () => { }); it('renders the title for the dowload link', () => { - expect(wrapper.find(GlLink).text()).toBe(`${release.tag_name}-evidence.json`); + expect(wrapper.find(GlLink).text()).toBe(`${release.tagName}-evidence.json`); }); it('renders the correct hover text for the download', () => { @@ -40,19 +44,19 @@ describe('Evidence Block', () => { }); it('renders the correct file link for download', () => { - expect(wrapper.find(GlLink).attributes().download).toBe(`${release.tag_name}-evidence.json`); + expect(wrapper.find(GlLink).attributes().download).toBe(`${release.tagName}-evidence.json`); }); describe('sha text', () => { it('renders the short sha initially', () => { - expect(wrapper.find('.js-short').text()).toBe(truncateSha(release.evidence_sha)); + expect(wrapper.find('.js-short').text()).toBe(truncateSha(release.evidenceSha)); }); it('renders the long sha after expansion', () => { wrapper.find('.js-text-expander-prepend').trigger('click'); return wrapper.vm.$nextTick().then(() => { - expect(wrapper.find('.js-expanded').text()).toBe(release.evidence_sha); + expect(wrapper.find('.js-expanded').text()).toBe(release.evidenceSha); }); }); }); @@ -68,7 +72,7 @@ describe('Evidence Block', () => { it('copies the sha', () => { expect(wrapper.find(ClipboardButton).attributes('data-clipboard-text')).toBe( - release.evidence_sha, + release.evidenceSha, ); }); }); |