diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 15:09:37 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-12 15:09:37 +0000 |
commit | 2c89e169769ead722394a79ed67fcd08e96863dd (patch) | |
tree | 0dadb576846c484475b895f75fab41f71cdb952e /spec/frontend/blob/components/blob_header_default_actions_spec.js | |
parent | bd497e352ebd279536ae11855871162e82a3f88c (diff) | |
download | gitlab-ce-2c89e169769ead722394a79ed67fcd08e96863dd.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/blob/components/blob_header_default_actions_spec.js')
-rw-r--r-- | spec/frontend/blob/components/blob_header_default_actions_spec.js | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/spec/frontend/blob/components/blob_header_default_actions_spec.js b/spec/frontend/blob/components/blob_header_default_actions_spec.js index fe0edffd12d..5da0d40ab14 100644 --- a/spec/frontend/blob/components/blob_header_default_actions_spec.js +++ b/spec/frontend/blob/components/blob_header_default_actions_spec.js @@ -8,7 +8,6 @@ import { } from '~/blob/components/constants'; import { GlButtonGroup, GlButton } from '@gitlab/ui'; import { Blob } from './mock_data'; -import eventHub from '~/blob/event_hub'; describe('Blob Header Default Actions', () => { let wrapper; @@ -16,10 +15,10 @@ describe('Blob Header Default Actions', () => { let buttons; const hrefPrefix = 'http://localhost'; - function createComponent(blobProps = {}, propsData = {}) { + function createComponent(propsData = {}) { wrapper = mount(BlobHeaderActions, { propsData: { - blob: Object.assign({}, Blob, blobProps), + rawPath: Blob.rawPath, ...propsData, }, }); @@ -60,12 +59,9 @@ describe('Blob Header Default Actions', () => { }); it('renders "Copy file contents" button as disables if the viewer is Rich', () => { - createComponent( - {}, - { - activeViewer: RICH_BLOB_VIEWER, - }, - ); + createComponent({ + activeViewer: RICH_BLOB_VIEWER, + }); buttons = wrapper.findAll(GlButton); expect(buttons.at(0).attributes('disabled')).toBeTruthy(); @@ -74,10 +70,10 @@ describe('Blob Header Default Actions', () => { describe('functionally', () => { it('emits an event when a Copy Contents button is clicked', () => { - jest.spyOn(eventHub, '$emit'); + jest.spyOn(wrapper.vm, '$emit'); buttons.at(0).vm.$emit('click'); - expect(eventHub.$emit).toHaveBeenCalledWith('copy'); + expect(wrapper.vm.$emit).toHaveBeenCalledWith('copy'); }); }); }); |