diff options
author | Sam Beckham <sbeckham@gitlab.com> | 2018-07-26 16:24:48 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-07-26 16:24:48 +0000 |
commit | da20731f8b6ea0ab6bbd7bd4409508931810d18d (patch) | |
tree | c162396998864ec040a1595274a588ac3f405745 /spec/javascripts/vue_shared | |
parent | ef455b5d2349c7cef62abc4cfdb4b9f3ea0c0357 (diff) | |
download | gitlab-ce-da20731f8b6ea0ab6bbd7bd4409508931810d18d.tar.gz |
Full list of vulnerabilities
Diffstat (limited to 'spec/javascripts/vue_shared')
-rw-r--r-- | spec/javascripts/vue_shared/components/reports/report_section_spec.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/javascripts/vue_shared/components/reports/report_section_spec.js b/spec/javascripts/vue_shared/components/reports/report_section_spec.js index 8d5401a9d89..4e3986acb16 100644 --- a/spec/javascripts/vue_shared/components/reports/report_section_spec.js +++ b/spec/javascripts/vue_shared/components/reports/report_section_spec.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import reportSection from '~/vue_shared/components/reports/report_section.vue'; -import mountComponent from 'spec/helpers/vue_mount_component_helper'; +import mountComponent, { mountComponentWithSlots } from 'spec/helpers/vue_mount_component_helper'; describe('Report section', () => { let vm; @@ -171,4 +171,27 @@ describe('Report section', () => { expect(vm.$el.textContent.trim()).toEqual('Failed to load codeclimate report'); }); }); + + describe('with action buttons passed to the slot', () => { + beforeEach(() => { + vm = mountComponentWithSlots(ReportSection, { + props: { + status: 'SUCCESS', + successText: 'success', + hasIssues: true, + }, + slots: { + actionButtons: ['Action!'], + }, + }); + }); + + it('should render the passed button', () => { + expect(vm.$el.textContent.trim()).toContain('Action!'); + }); + + it('should still render the expand/collapse button', () => { + expect(vm.$el.querySelector('.js-collapse-btn').textContent.trim()).toEqual('Expand'); + }); + }); }); |