Commit 1a3a21d6 authored by Natalia Tepluhina's avatar Natalia Tepluhina Committed by Phil Hughes

Replace v-show on Designs toolbar with d-none class

parent f2731aac
...@@ -195,7 +195,7 @@ export default { ...@@ -195,7 +195,7 @@ export default {
<header v-if="showToolbar" class="row-content-block border-top-0 p-2 d-flex"> <header v-if="showToolbar" class="row-content-block border-top-0 p-2 d-flex">
<div class="d-flex justify-content-between align-items-center w-100"> <div class="d-flex justify-content-between align-items-center w-100">
<design-version-dropdown /> <design-version-dropdown />
<div v-show="hasDesigns" class="d-flex qa-selector-toolbar"> <div :class="['qa-selector-toolbar', { 'd-flex': hasDesigns, 'd-none': !hasDesigns }]">
<gl-button <gl-button
v-if="isLatestVersion" v-if="isLatestVersion"
variant="link" variant="link"
...@@ -204,7 +204,7 @@ export default { ...@@ -204,7 +204,7 @@ export default {
>{{ selectAllButtonText }}</gl-button >{{ selectAllButtonText }}</gl-button
> >
<design-destroyer <design-destroyer
v-slot="{ mutate, loading, error }" v-slot="{ mutate, loading }"
:filenames="selectedDesigns" :filenames="selectedDesigns"
:project-path="projectPath" :project-path="projectPath"
:iid="issueIid" :iid="issueIid"
......
...@@ -69,7 +69,7 @@ exports[`Design management index page designs renders designs list and header wi ...@@ -69,7 +69,7 @@ exports[`Design management index page designs renders designs list and header wi
<design-version-dropdown-stub /> <design-version-dropdown-stub />
<div <div
class="d-flex qa-selector-toolbar" class="qa-selector-toolbar d-flex"
> >
<gl-button-stub <gl-button-stub
class="mr-2 js-select-all" class="mr-2 js-select-all"
......
...@@ -303,7 +303,7 @@ describe('Design management index page', () => { ...@@ -303,7 +303,7 @@ describe('Design management index page', () => {
}); });
}); });
describe('on latest version', () => { describe('on latest version when has designs', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ designs: mockDesigns, allVersions: [mockVersion] }); createComponent({ designs: mockDesigns, allVersions: [mockVersion] });
}); });
...@@ -312,13 +312,10 @@ describe('Design management index page', () => { ...@@ -312,13 +312,10 @@ describe('Design management index page', () => {
expect(findDesignCheckboxes().length).toBe(mockDesigns.length); expect(findDesignCheckboxes().length).toBe(mockDesigns.length);
}); });
it('renders Delete selected button', () => { it('renders toolbar buttons', () => {
expect(findDeleteButton().exists()).toBe(true); expect(findToolbar().exists()).toBe(true);
}); expect(findToolbar().classes()).toContain('d-flex');
expect(findToolbar().classes()).not.toContain('d-none');
it('renders a button with Select all text', () => {
expect(findSelectAllButton().exists()).toBe(true);
expect(findSelectAllButton().text()).toBe('Select all');
}); });
it('adds two designs to selected designs when their checkboxes are checked', () => { it('adds two designs to selected designs when their checkboxes are checked', () => {
...@@ -375,6 +372,11 @@ describe('Design management index page', () => { ...@@ -375,6 +372,11 @@ describe('Design management index page', () => {
}); });
}); });
it('on latest version when has no designs does not render toolbar buttons', () => {
createComponent({ designs: [], allVersions: [mockVersion] });
expect(findToolbar().exists()).toBe(false);
});
describe('on non-latest version', () => { describe('on non-latest version', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ designs: mockDesigns, allVersions: [mockVersion] }); createComponent({ designs: mockDesigns, allVersions: [mockVersion] });
......
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