Commit bba555e7 authored by Christie Lenneville's avatar Christie Lenneville Committed by Natalia Tepluhina

Migrate empty state button

parent 8dd8e6ad
<script> <script>
import { GlEmptyState, GlDeprecatedButton } from '@gitlab/ui'; import { GlEmptyState, GlButton } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { FilterState, FilterStateEmptyMessage } from '../constants'; import { FilterState, FilterStateEmptyMessage } from '../constants';
...@@ -7,7 +7,7 @@ import { FilterState, FilterStateEmptyMessage } from '../constants'; ...@@ -7,7 +7,7 @@ import { FilterState, FilterStateEmptyMessage } from '../constants';
export default { export default {
components: { components: {
GlEmptyState, GlEmptyState,
GlDeprecatedButton, GlButton,
}, },
props: { props: {
filterBy: { filterBy: {
...@@ -53,12 +53,9 @@ export default { ...@@ -53,12 +53,9 @@ export default {
:description="emptyStateDescription" :description="emptyStateDescription"
> >
<template v-if="emptyStateDescription && canCreateRequirement" #actions> <template v-if="emptyStateDescription && canCreateRequirement" #actions>
<gl-deprecated-button <gl-button category="primary" variant="success" @click="$emit('clickNewRequirement')">{{
category="primary" __('New requirement')
variant="success" }}</gl-button>
@click="$emit('clickNewRequirement')"
>{{ __('New requirement') }}</gl-deprecated-button
>
</template> </template>
</gl-empty-state> </gl-empty-state>
</div> </div>
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlEmptyState, GlDeprecatedButton } from '@gitlab/ui'; import { GlEmptyState, GlButton } from '@gitlab/ui';
import RequirementsEmptyState from 'ee/requirements/components/requirements_empty_state.vue'; import RequirementsEmptyState from 'ee/requirements/components/requirements_empty_state.vue';
import { FilterState } from 'ee/requirements/constants'; import { FilterState } from 'ee/requirements/constants';
...@@ -106,7 +106,7 @@ describe('RequirementsEmptyState', () => { ...@@ -106,7 +106,7 @@ describe('RequirementsEmptyState', () => {
}); });
it('renders new requirement button when project has no requirements', () => { it('renders new requirement button when project has no requirements', () => {
const newReqButton = wrapper.find(GlDeprecatedButton); const newReqButton = wrapper.find(GlButton);
expect(newReqButton.exists()).toBe(true); expect(newReqButton.exists()).toBe(true);
expect(newReqButton.text()).toBe('New requirement'); expect(newReqButton.text()).toBe('New requirement');
...@@ -122,7 +122,7 @@ describe('RequirementsEmptyState', () => { ...@@ -122,7 +122,7 @@ describe('RequirementsEmptyState', () => {
}); });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
const newReqButton = wrapper.find(GlDeprecatedButton); const newReqButton = wrapper.find(GlButton);
expect(newReqButton.exists()).toBe(false); expect(newReqButton.exists()).toBe(false);
}); });
...@@ -134,7 +134,7 @@ describe('RequirementsEmptyState', () => { ...@@ -134,7 +134,7 @@ describe('RequirementsEmptyState', () => {
}); });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
const newReqButton = wrapper.find(GlDeprecatedButton); const newReqButton = wrapper.find(GlButton);
expect(newReqButton.exists()).toBe(false); expect(newReqButton.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