Commit 253c905c authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '219872-empty-rule' into 'master'

Convert glDeprecatedButton to glButton

Closes #219872

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