Commit ec5fa0a7 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch '219902-commits-header-deprecated-button' into 'master'

Replace deprecated-button with button in commits_header.vue

Closes #219902

See merge request gitlab-org/gitlab!38805
parents 77fc4324 7fcd16b0
<script> <script>
/* eslint-disable vue/no-v-html */ /* eslint-disable vue/no-v-html */
import { GlDeprecatedButton, GlIcon } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { escape } from 'lodash'; import { escape } from 'lodash';
import { __, n__, sprintf, s__ } from '~/locale'; import { __, n__, sprintf, s__ } from '~/locale';
export default { export default {
components: { components: {
GlIcon, GlButton,
GlDeprecatedButton,
}, },
props: { props: {
isSquashEnabled: { isSquashEnabled: {
...@@ -80,20 +79,19 @@ export default { ...@@ -80,20 +79,19 @@ export default {
class="js-mr-widget-commits-count mr-widget-extension clickable d-flex align-items-center px-3 py-2" class="js-mr-widget-commits-count mr-widget-extension clickable d-flex align-items-center px-3 py-2"
@click="toggle()" @click="toggle()"
> >
<gl-deprecated-button <gl-button
:aria-label="ariaLabel" :aria-label="ariaLabel"
variant="blank" category="tertiary"
class="commit-edit-toggle square s24 gl-mr-3" class="commit-edit-toggle gl-mr-3"
:icon="collapseIcon"
@click.stop="toggle()" @click.stop="toggle()"
> />
<gl-icon :name="collapseIcon" :size="16" />
</gl-deprecated-button>
<span v-if="expanded">{{ __('Collapse') }}</span> <span v-if="expanded">{{ __('Collapse') }}</span>
<span v-else> <span v-else>
<span class="vertical-align-middle" v-html="message"></span> <span class="vertical-align-middle" v-html="message"></span>
<gl-deprecated-button variant="link" class="modify-message-button"> <gl-button variant="link" class="modify-message-button">
{{ modifyLinkMessage }} {{ modifyLinkMessage }}
</gl-deprecated-button> </gl-button>
</span> </span>
</div> </div>
<div v-show="expanded"><slot></slot></div> <div v-show="expanded"><slot></slot></div>
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
import CommitsHeader from '~/vue_merge_request_widget/components/states/commits_header.vue'; import CommitsHeader from '~/vue_merge_request_widget/components/states/commits_header.vue';
describe('Commits header component', () => { describe('Commits header component', () => {
...@@ -23,7 +22,6 @@ describe('Commits header component', () => { ...@@ -23,7 +22,6 @@ describe('Commits header component', () => {
const findHeaderWrapper = () => wrapper.find('.js-mr-widget-commits-count'); const findHeaderWrapper = () => wrapper.find('.js-mr-widget-commits-count');
const findCommitToggle = () => wrapper.find('.commit-edit-toggle'); const findCommitToggle = () => wrapper.find('.commit-edit-toggle');
const findIcon = () => wrapper.find(GlIcon);
const findCommitsCountMessage = () => wrapper.find('.commits-count-message'); const findCommitsCountMessage = () => wrapper.find('.commits-count-message');
const findTargetBranchMessage = () => wrapper.find('.label-branch'); const findTargetBranchMessage = () => wrapper.find('.label-branch');
const findModifyButton = () => wrapper.find('.modify-message-button'); const findModifyButton = () => wrapper.find('.modify-message-button');
...@@ -61,7 +59,7 @@ describe('Commits header component', () => { ...@@ -61,7 +59,7 @@ describe('Commits header component', () => {
wrapper.setData({ expanded: false }); wrapper.setData({ expanded: false });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(findIcon().props('name')).toBe('chevron-right'); expect(findCommitToggle().props('icon')).toBe('chevron-right');
}); });
}); });
...@@ -119,7 +117,7 @@ describe('Commits header component', () => { ...@@ -119,7 +117,7 @@ describe('Commits header component', () => {
it('has a chevron-down icon', done => { it('has a chevron-down icon', done => {
wrapper.vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
expect(findIcon().props('name')).toBe('chevron-down'); expect(findCommitToggle().props('icon')).toBe('chevron-down');
done(); done();
}); });
}); });
......
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