diff options
author | Kushal Pandya <kushal@gitlab.com> | 2018-03-05 15:38:56 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2018-03-05 15:38:56 +0300 |
commit | 5989aa18f4ec49973e4d42015c1af8c93d3aed1f (patch) | |
tree | 002020c3becdce2b6e487045c659e89cd5c79125 /spec/javascripts/vue_shared/components/sidebar/labels_select | |
parent | ab1bc5c7f76bcb893004749918a2913c2c965a1b (diff) |
LabelsSelect DropdownHeader Component
Diffstat (limited to 'spec/javascripts/vue_shared/components/sidebar/labels_select')
-rw-r--r-- | spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_header_spec.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_header_spec.js b/spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_header_spec.js new file mode 100644 index 00000000000..325fa47c957 --- /dev/null +++ b/spec/javascripts/vue_shared/components/sidebar/labels_select/dropdown_header_spec.js @@ -0,0 +1,36 @@ +import Vue from 'vue'; + +import dropdownHeaderComponent from '~/vue_shared/components/sidebar/labels_select/dropdown_header.vue'; + +import mountComponent from '../../../../helpers/vue_mount_component_helper'; + +const createComponent = () => { + const Component = Vue.extend(dropdownHeaderComponent); + + return mountComponent(Component); +}; + +describe('DropdownHeaderComponent', () => { + let vm; + + beforeEach(() => { + vm = createComponent(); + }); + + afterEach(() => { + vm.$destroy(); + }); + + describe('template', () => { + it('renders header text element', () => { + const headerEl = vm.$el.querySelector('.dropdown-title span'); + expect(headerEl.innerText.trim()).toBe('Assign labels'); + }); + + it('renders `Close` button element', () => { + const closeBtnEl = vm.$el.querySelector('.dropdown-title button.dropdown-title-button.dropdown-menu-close'); + expect(closeBtnEl).not.toBeNull(); + expect(closeBtnEl.querySelector('.fa-times.dropdown-menu-close-icon')).not.toBeNull(); + }); + }); +}); |