Commit 491ac523 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera Committed by Andrew Fontaine

Set package delete button to secondary

- source
- tests
parent 04da813f
...@@ -123,7 +123,7 @@ export default { ...@@ -123,7 +123,7 @@ export default {
<gl-button <gl-button
data-testid="action-delete" data-testid="action-delete"
icon="remove" icon="remove"
category="primary" category="secondary"
variant="danger" variant="danger"
:title="s__('PackageRegistry|Remove package')" :title="s__('PackageRegistry|Remove package')"
:aria-label="s__('PackageRegistry|Remove package')" :aria-label="s__('PackageRegistry|Remove package')"
......
...@@ -48,6 +48,7 @@ export default { ...@@ -48,6 +48,7 @@ export default {
:title="title" :title="title"
:aria-label="title" :aria-label="title"
variant="danger" variant="danger"
category="secondary"
icon="remove" icon="remove"
@click="$emit('delete')" @click="$emit('delete')"
/> />
......
---
title: 'Registry: make delete icon buttons secondary'
merge_request: 54545
author:
type: changed
...@@ -102,7 +102,7 @@ exports[`packages_list_row renders 1`] = ` ...@@ -102,7 +102,7 @@ exports[`packages_list_row renders 1`] = `
<gl-button-stub <gl-button-stub
aria-label="Remove package" aria-label="Remove package"
buttontextclasses="" buttontextclasses=""
category="primary" category="secondary"
data-testid="action-delete" data-testid="action-delete"
icon="remove" icon="remove"
size="medium" size="medium"
......
...@@ -60,11 +60,9 @@ describe('packages_list_row', () => { ...@@ -60,11 +60,9 @@ describe('packages_list_row', () => {
}); });
describe('when is is group', () => { describe('when is is group', () => {
beforeEach(() => { it('has a package path component', () => {
mountComponent({ isGroup: true }); mountComponent({ isGroup: true });
});
it('has a package path component', () => {
expect(findPackagePath().exists()).toBe(true); expect(findPackagePath().exists()).toBe(true);
expect(findPackagePath().props()).toMatchObject({ path: 'foo/bar/baz' }); expect(findPackagePath().props()).toMatchObject({ path: 'foo/bar/baz' });
}); });
...@@ -92,10 +90,22 @@ describe('packages_list_row', () => { ...@@ -92,10 +90,22 @@ describe('packages_list_row', () => {
}); });
}); });
describe('delete event', () => { describe('delete button', () => {
beforeEach(() => mountComponent({ packageEntity: packageWithoutTags })); it('exists and has the correct props', () => {
mountComponent({ packageEntity: packageWithoutTags });
expect(findDeleteButton().exists()).toBe(true);
expect(findDeleteButton().attributes()).toMatchObject({
icon: 'remove',
category: 'secondary',
variant: 'danger',
title: 'Remove package',
});
});
it('emits the packageToDelete event when the delete button is clicked', async () => { it('emits the packageToDelete event when the delete button is clicked', async () => {
mountComponent({ packageEntity: packageWithoutTags });
findDeleteButton().vm.$emit('click'); findDeleteButton().vm.$emit('click');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
......
...@@ -58,6 +58,7 @@ describe('delete_button', () => { ...@@ -58,6 +58,7 @@ describe('delete_button', () => {
title: 'Foo title', title: 'Foo title',
variant: 'danger', variant: 'danger',
disabled: 'true', disabled: 'true',
category: 'secondary',
}); });
}); });
......
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