Commit 11cc44f8 authored by Illya Klymov's avatar Illya Klymov

Merge branch 'fix-design-management-archive-button' into 'master'

Fix design management delete_button.vue

See merge request gitlab-org/gitlab!40325
parents 43d4fed9 af5de43f
......@@ -98,6 +98,7 @@ export default {
:loading="loading"
:icon="buttonIcon"
:disabled="isDeleting || !hasSelectedDesigns"
/>
><slot></slot
></gl-button>
</div>
</template>
---
title: Fix design management Archive Selected button label
merge_request: 40325
author:
type: fixed
......@@ -8,7 +8,7 @@ describe('Batch delete button component', () => {
const findButton = () => wrapper.find(GlButton);
const findModal = () => wrapper.find(GlModal);
function createComponent(isDeleting = false) {
function createComponent({ isDeleting = false } = {}, { slots = {} } = {}) {
wrapper = shallowMount(BatchDeleteButton, {
propsData: {
isDeleting,
......@@ -16,6 +16,7 @@ describe('Batch delete button component', () => {
directives: {
GlModalDirective,
},
slots,
});
}
......@@ -31,7 +32,7 @@ describe('Batch delete button component', () => {
});
it('renders disabled button when design is deleting', () => {
createComponent(true);
createComponent({ isDeleting: true });
expect(findButton().attributes('disabled')).toBeTruthy();
});
......@@ -48,4 +49,18 @@ describe('Batch delete button component', () => {
expect(wrapper.emitted().deleteSelectedDesigns).toBeTruthy();
});
});
it('renders slot content', () => {
const testText = 'Archive selected';
createComponent(
{},
{
slots: {
default: testText,
},
},
);
expect(findButton().text()).toBe(testText);
});
});
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