Commit 80f733d2 authored by Phil Hughes's avatar Phil Hughes

Merge branch '34149-hide-delete-selected-in-designs-when-viewing-an-old-version' into 'master'

Resolve "Hide "Delete selected" in designs when viewing an old version"

See merge request gitlab-org/gitlab!19889
parents 997a786e 17b2450f
---
title: Resolve Hide Delete selected in designs when viewing an old version
merge_request: 19889
author:
type: fixed
...@@ -267,6 +267,7 @@ export default { ...@@ -267,6 +267,7 @@ export default {
@done="onDesignDelete" @done="onDesignDelete"
> >
<delete-button <delete-button
v-if="isLatestVersion"
:is-deleting="loading" :is-deleting="loading"
button-class="btn-danger btn-inverted mr-2" button-class="btn-danger btn-inverted mr-2"
:has-selected-designs="hasSelectedDesigns" :has-selected-designs="hasSelectedDesigns"
......
...@@ -233,7 +233,7 @@ describe('Design management index page', () => { ...@@ -233,7 +233,7 @@ describe('Design management index page', () => {
createFlash.mockReset(); createFlash.mockReset();
}); });
it('doesn not warn when the max files are uploaded', () => { it('does not warn when the max files are uploaded', () => {
createComponent(); createComponent();
wrapper.vm.onUploadDesign(new Array(MAXIMUM_FILE_UPLOAD_LIMIT).fill(mockDesigns[0])); wrapper.vm.onUploadDesign(new Array(MAXIMUM_FILE_UPLOAD_LIMIT).fill(mockDesigns[0]));
...@@ -260,6 +260,10 @@ describe('Design management index page', () => { ...@@ -260,6 +260,10 @@ describe('Design management index page', () => {
expect(findDesignCheckboxes().length).toBe(mockDesigns.length); expect(findDesignCheckboxes().length).toBe(mockDesigns.length);
}); });
it('renders Delete selected button', () => {
expect(findDeleteButton().exists()).toBe(true);
});
it('renders a button with Select all text', () => { it('renders a button with Select all text', () => {
expect(findSelectAllButton().exists()).toBe(true); expect(findSelectAllButton().exists()).toBe(true);
expect(findSelectAllButton().text()).toBe('Select all'); expect(findSelectAllButton().text()).toBe('Select all');
...@@ -325,6 +329,10 @@ describe('Design management index page', () => { ...@@ -325,6 +329,10 @@ describe('Design management index page', () => {
expect(findDesignCheckboxes().length).toBe(0); expect(findDesignCheckboxes().length).toBe(0);
}); });
it('does not render Delete selected button', () => {
expect(findDeleteButton().exists()).toBe(false);
});
it('does not render Select All button', () => { it('does not render Select All button', () => {
expect(findSelectAllButton().exists()).toBe(false); expect(findSelectAllButton().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