Commit 6c824a4b authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Convert gl-deprecated-button to gl-button in dropdown_header.vue

parent 881661c2
<script> <script>
import { GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
export default { export default {
components: { components: {
GlDeprecatedButton, GlButton,
GlIcon,
}, },
}; };
</script> </script>
...@@ -12,12 +11,11 @@ export default { ...@@ -12,12 +11,11 @@ export default {
<template> <template>
<div class="dropdown-title"> <div class="dropdown-title">
<span>{{ __('Assign epic') }}</span> <span>{{ __('Assign epic') }}</span>
<gl-deprecated-button <gl-button
:aria-label="__('Close')" :aria-label="__('Close')"
variant="link" category="tertiary"
class="dropdown-title-button dropdown-menu-close" class="dropdown-title-button dropdown-menu-close"
> icon="close"
<gl-icon name="close" /> />
</gl-deprecated-button>
</div> </div>
</template> </template>
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import DropdownHeader from 'ee/vue_shared/components/sidebar/epics_select/dropdown_header.vue'; import DropdownHeader from 'ee/vue_shared/components/sidebar/epics_select/dropdown_header.vue';
describe('EpicsSelect', () => { describe('EpicsSelect', () => {
...@@ -25,20 +25,14 @@ describe('EpicsSelect', () => { ...@@ -25,20 +25,14 @@ describe('EpicsSelect', () => {
}); });
it('should render close button', () => { it('should render close button', () => {
const buttonEl = wrapper.find(GlDeprecatedButton); const buttonEl = wrapper.find(GlButton);
expect(buttonEl.exists()).toBe(true); expect(buttonEl.exists()).toBe(true);
expect(buttonEl.attributes('aria-label')).toBe('Close'); expect(buttonEl.attributes('aria-label')).toBe('Close');
expect(buttonEl.classes()).toEqual( expect(buttonEl.classes()).toEqual(
expect.arrayContaining(['dropdown-title-button', 'dropdown-menu-close']), expect.arrayContaining(['dropdown-title-button', 'dropdown-menu-close']),
); );
}); expect(buttonEl.props('icon')).toBe('close');
it('should render close button icon', () => {
const iconEl = wrapper.find(GlDeprecatedButton).find(GlIcon);
expect(iconEl.exists()).toBe(true);
expect(iconEl.attributes('name')).toBe('close');
}); });
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment