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>
import { mapState, mapActions } from 'vuex';
import { GlDeprecatedButton, GlLoadingIcon } from '@gitlab/ui';
import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import TreeDragAndDropMixin from '../mixins/tree_dd_mixin';
......@@ -8,7 +8,7 @@ import { ChildType } from '../constants';
export default {
components: {
GlDeprecatedButton,
GlButton,
GlLoadingIcon,
},
mixins: [TreeDragAndDropMixin],
......@@ -72,12 +72,12 @@ export default {
>
<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">
<gl-deprecated-button
<gl-button
v-if="!fetchInProgress"
class="d-inline-block mb-2"
variant="link"
@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" />
</li>
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import { GlDeprecatedButton } from '@gitlab/ui';
import { GlButton } from '@gitlab/ui';
import Draggable from 'vuedraggable';
......@@ -410,13 +410,13 @@ describe('RelatedItemsTree', () => {
});
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', () => {
jest.spyOn(wrapper.vm, 'handleShowMoreClick').mockImplementation(() => {});
wrapper.find(GlDeprecatedButton).vm.$emit('click');
wrapper.find(GlButton).vm.$emit('click');
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