Commit 9a779aa0 authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch '219894-migrate-show-more-tree-root-button' into 'master'

Migrate deprecated buttons for Epics - Show More

Closes #219894

See merge request gitlab-org/gitlab!40091
parents 3544bdf0 ac87e5d6
<script> <script>
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui'; import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import TreeDragAndDropMixin from '../mixins/tree_dd_mixin'; import TreeDragAndDropMixin from '../mixins/tree_dd_mixin';
...@@ -8,7 +8,7 @@ import { ChildType } from '../constants'; ...@@ -8,7 +8,7 @@ import { ChildType } from '../constants';
export default { export default {
components: { components: {
GlDeprecatedButton, GlButton,
GlLoadingIcon, GlLoadingIcon,
}, },
mixins: [TreeDragAndDropMixin], mixins: [TreeDragAndDropMixin],
...@@ -72,12 +72,12 @@ export default { ...@@ -72,12 +72,12 @@ export default {
> >
<tree-item v-for="item in children" :key="item.id" :parent-item="parentItem" :item="item" /> <tree-item v-for="item in children" :key="item.id" :parent-item="parentItem" :item="item" />
<li v-if="hasMoreChildren" class="tree-item list-item pt-0 pb-0 d-flex justify-content-center"> <li v-if="hasMoreChildren" class="tree-item list-item pt-0 pb-0 d-flex justify-content-center">
<gl-deprecated-button <gl-button
v-if="!fetchInProgress" v-if="!fetchInProgress"
class="d-inline-block mb-2" class="d-inline-block mb-2"
variant="link" variant="link"
@click="handleShowMoreClick($event)" @click="handleShowMoreClick($event)"
>{{ s__('Epics|Show more') }}</gl-deprecated-button >{{ s__('Epics|Show more') }}</gl-button
> >
<gl-loading-icon v-else size="sm" class="mt-1 mb-1" /> <gl-loading-icon v-else size="sm" class="mt-1 mb-1" />
</li> </li>
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import Draggable from 'vuedraggable'; import Draggable from 'vuedraggable';
...@@ -410,13 +410,13 @@ describe('RelatedItemsTree', () => { ...@@ -410,13 +410,13 @@ describe('RelatedItemsTree', () => {
}); });
it('renders `Show more` link', () => { it('renders `Show more` link', () => {
expect(wrapper.find(GlDeprecatedButton).text()).toBe('Show more'); expect(wrapper.find(GlButton).text()).toBe('Show more');
}); });
it('calls `handleShowMoreClick` when `Show more` link is clicked', () => { it('calls `handleShowMoreClick` when `Show more` link is clicked', () => {
jest.spyOn(wrapper.vm, 'handleShowMoreClick').mockImplementation(() => {}); jest.spyOn(wrapper.vm, 'handleShowMoreClick').mockImplementation(() => {});
wrapper.find(GlDeprecatedButton).vm.$emit('click'); wrapper.find(GlButton).vm.$emit('click');
expect(wrapper.vm.handleShowMoreClick).toHaveBeenCalled(); expect(wrapper.vm.handleShowMoreClick).toHaveBeenCalled();
}); });
......
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