LabelsSelect DropdownHeader Component
This commit is contained in:
parent
ab1bc5c7f7
commit
5989aa18f4
|
|
@ -0,0 +1,21 @@
|
|||
<script>
|
||||
export default {};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="dropdown-title">
|
||||
<span>{{ __('Assign labels') }}</span>
|
||||
<button
|
||||
type="button"
|
||||
class="dropdown-title-button dropdown-menu-close"
|
||||
:aria-label="__('Close')"
|
||||
>
|
||||
<i
|
||||
aria-hidden="true"
|
||||
class="fa fa-times dropdown-menu-close-icon"
|
||||
data-hidden="true"
|
||||
>
|
||||
</i>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue