Commit 8c6f7fe9 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Convert glDeprecatedButton to glButton in empty_rule.vue

parent 1bc59e62
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import RuleInput from './mr_edit/rule_input.vue'; import RuleInput from './mr_edit/rule_input.vue';
import EmptyRuleName from './empty_rule_name.vue'; import EmptyRuleName from './empty_rule_name.vue';
import RuleBranches from './rule_branches.vue'; import RuleBranches from './rule_branches.vue';
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
RuleInput, RuleInput,
EmptyRuleName, EmptyRuleName,
RuleBranches, RuleBranches,
GlDeprecatedButton, GlButton,
}, },
props: { props: {
rule: { rule: {
...@@ -59,14 +59,14 @@ export default { ...@@ -59,14 +59,14 @@ export default {
<rule-input :rule="rule" :is-mr-edit="isMrEdit" /> <rule-input :rule="rule" :is-mr-edit="isMrEdit" />
</td> </td>
<td> <td>
<gl-deprecated-button <gl-button
v-if="!allowMultiRule && canEdit" v-if="!allowMultiRule && canEdit"
class="ml-auto btn-info btn-inverted" class="ml-auto btn-info btn-inverted"
data-qa-selector="add_approvers_button" data-qa-selector="add_approvers_button"
@click="openCreateModal(null)" @click="openCreateModal(null)"
> >
{{ __('Add approval rule') }} {{ __('Add approval rule') }}
</gl-deprecated-button> </gl-button>
</td> </td>
</tr> </tr>
</template> </template>
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import EmptyRule from 'ee/approvals/components/empty_rule.vue'; import EmptyRule from 'ee/approvals/components/empty_rule.vue';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
describe('Empty Rule', () => { describe('Empty Rule', () => {
let wrapper; let wrapper;
...@@ -25,7 +25,7 @@ describe('Empty Rule', () => { ...@@ -25,7 +25,7 @@ describe('Empty Rule', () => {
allowMultiRule: true, allowMultiRule: true,
canEdit: true, canEdit: true,
}); });
expect(wrapper.find(GlDeprecatedButton).exists()).toBe(false); expect(wrapper.find(GlButton).exists()).toBe(false);
}); });
}); });
...@@ -36,7 +36,7 @@ describe('Empty Rule', () => { ...@@ -36,7 +36,7 @@ describe('Empty Rule', () => {
canEdit: true, canEdit: true,
}); });
expect(wrapper.find(GlDeprecatedButton).exists()).toBe(true); expect(wrapper.find(GlButton).exists()).toBe(true);
}); });
it('does not display "Add approval rule" button if not allowed to edit', () => { it('does not display "Add approval rule" button if not allowed to edit', () => {
...@@ -44,7 +44,7 @@ describe('Empty Rule', () => { ...@@ -44,7 +44,7 @@ describe('Empty Rule', () => {
allowMultiRule: true, allowMultiRule: true,
canEdit: false, canEdit: false,
}); });
expect(wrapper.find(GlDeprecatedButton).exists()).toBe(false); expect(wrapper.find(GlButton).exists()).toBe(false);
}); });
}); });
}); });
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