Commit d925aae1 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'empty-state-button' into 'master'

Migrate empty state button

Closes #219878

See merge request gitlab-org/gitlab!35798
parents 55b61773 bba555e7
<script>
import { GlEmptyState, GlDeprecatedButton } from '@gitlab/ui';
import { GlEmptyState, GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
import { FilterState, FilterStateEmptyMessage } from '../constants';
......@@ -7,7 +7,7 @@ import { FilterState, FilterStateEmptyMessage } from '../constants';
export default {
components: {
GlEmptyState,
GlDeprecatedButton,
GlButton,
},
props: {
filterBy: {
......@@ -53,12 +53,9 @@ export default {
:description="emptyStateDescription"
>
<template v-if="emptyStateDescription && canCreateRequirement" #actions>
<gl-deprecated-button
category="primary"
variant="success"
@click="$emit('clickNewRequirement')"
>{{ __('New requirement') }}</gl-deprecated-button
>
<gl-button category="primary" variant="success" @click="$emit('clickNewRequirement')">{{
__('New requirement')
}}</gl-button>
</template>
</gl-empty-state>
</div>
......
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 { FilterState } from 'ee/requirements/constants';
......@@ -106,7 +106,7 @@ describe('RequirementsEmptyState', () => {
});
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.text()).toBe('New requirement');
......@@ -122,7 +122,7 @@ describe('RequirementsEmptyState', () => {
});
return wrapper.vm.$nextTick(() => {
const newReqButton = wrapper.find(GlDeprecatedButton);
const newReqButton = wrapper.find(GlButton);
expect(newReqButton.exists()).toBe(false);
});
......@@ -134,7 +134,7 @@ describe('RequirementsEmptyState', () => {
});
return wrapper.vm.$nextTick(() => {
const newReqButton = wrapper.find(GlDeprecatedButton);
const newReqButton = wrapper.find(GlButton);
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