Commit 8653b1c0 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'use-gl-button-in-rule-controls' into 'master'

Replace gl-deprecated-button in rule controls

See merge request gitlab-org/gitlab!34549
parents 00dd1d06 21236c08
<script> <script>
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
export default { export default {
components: { components: {
GlDeprecatedButton, GlButton,
Icon, Icon,
}, },
props: { props: {
...@@ -25,15 +25,16 @@ export default { ...@@ -25,15 +25,16 @@ export default {
<template> <template>
<div> <div>
<gl-deprecated-button variant="none" @click="requestEditRule(rule)"> <gl-button @click="requestEditRule(rule)">
<span>{{ __('Edit') }}</span> <span>{{ __('Edit') }}</span>
</gl-deprecated-button> </gl-button>
<gl-deprecated-button <gl-button
class="gl-ml-3 btn btn-inverted" class="gl-ml-3 btn btn-inverted"
variant="danger" variant="danger"
category="primary"
@click="requestDeleteRule(rule)" @click="requestDeleteRule(rule)"
> >
<icon name="remove" :aria-label="__('Remove')" /> <icon name="remove" :aria-label="__('Remove')" />
</gl-deprecated-button> </gl-button>
</div> </div>
</template> </template>
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import MREditModule from 'ee/approvals/stores/modules/mr_edit'; import MREditModule from 'ee/approvals/stores/modules/mr_edit';
import { createStoreOptions } from 'ee/approvals/stores'; import { createStoreOptions } from 'ee/approvals/stores';
import RuleControls from 'ee/approvals/components/rule_controls.vue'; import RuleControls from 'ee/approvals/components/rule_controls.vue';
...@@ -31,7 +31,7 @@ describe('EE Approvals RuleControls', () => { ...@@ -31,7 +31,7 @@ describe('EE Approvals RuleControls', () => {
store: new Vuex.Store(store), store: new Vuex.Store(store),
}); });
}; };
const findButtons = () => wrapper.findAll(GlDeprecatedButton); const findButtons = () => wrapper.findAll(GlButton);
const findButton = label => findButtons().filter(button => hasLabel(button, label)).wrappers[0]; const findButton = label => findButtons().filter(button => hasLabel(button, label)).wrappers[0];
const findEditButton = () => findButton('Edit'); const findEditButton = () => findButton('Edit');
const findRemoveButton = () => findButton('Remove'); const findRemoveButton = () => findButton('Remove');
......
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