Commit 12353021 authored by Dave Pisek's avatar Dave Pisek

Add tooltip to DAST scan profiles delete button

This commit adds a hover / focus tooltip to the delete button
on the DAST on-demand scans profile page.
parent 83fe18a3
...@@ -146,11 +146,12 @@ export default { ...@@ -146,11 +146,12 @@ export default {
<template #cell(actions)="{ item }"> <template #cell(actions)="{ item }">
<div class="gl-text-right"> <div class="gl-text-right">
<gl-button <gl-button
v-gl-tooltip.hover.focus
icon="remove" icon="remove"
variant="danger" variant="danger"
category="secondary" category="secondary"
class="gl-mr-3" class="gl-mr-3"
:aria-label="__('Delete')" :title="s__('DastProfiles|Delete profile')"
@click="prepareProfileDeletion(item.id)" @click="prepareProfileDeletion(item.id)"
/> />
<gl-button v-if="item.editPath" :href="item.editPath">{{ __('Edit') }}</gl-button> <gl-button v-if="item.editPath" :href="item.editPath">{{ __('Edit') }}</gl-button>
......
---
title: Add tooltip to DAST scan profiles delete button
merge_request: 44876
author:
type: added
...@@ -2,6 +2,7 @@ import { merge } from 'lodash'; ...@@ -2,6 +2,7 @@ import { merge } from 'lodash';
import { mount, shallowMount, createWrapper } from '@vue/test-utils'; import { mount, shallowMount, createWrapper } from '@vue/test-utils';
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import DastProfilesList from 'ee/security_configuration/dast_profiles/components/dast_profiles_list.vue'; import DastProfilesList from 'ee/security_configuration/dast_profiles/components/dast_profiles_list.vue';
const TEST_ERROR_MESSAGE = 'something went wrong'; const TEST_ERROR_MESSAGE = 'something went wrong';
...@@ -27,6 +28,11 @@ describe('EE - DastProfilesList', () => { ...@@ -27,6 +28,11 @@ describe('EE - DastProfilesList', () => {
propsData: defaultProps, propsData: defaultProps,
}, },
options, options,
{
directives: {
GlTooltip: createMockDirective(),
},
},
), ),
); );
}; };
...@@ -195,6 +201,13 @@ describe('EE - DastProfilesList', () => { ...@@ -195,6 +201,13 @@ describe('EE - DastProfilesList', () => {
const getCurrentProfileDeleteButton = () => const getCurrentProfileDeleteButton = () =>
getDeleteButtonWithin(getTableRowForProfile(profile)); getDeleteButtonWithin(getTableRowForProfile(profile));
it('shows a tooltip on the delete button', () => {
expect(getBinding(getCurrentProfileDeleteButton().element, 'gl-tooltip')).not.toBe(
undefined,
);
expect(getCurrentProfileDeleteButton().attributes().title).toBe('Delete profile');
});
it('opens a modal with the correct title when a delete button is clicked', async () => { it('opens a modal with the correct title when a delete button is clicked', async () => {
expect(getModal().html()).toBe(''); expect(getModal().html()).toBe('');
......
...@@ -8133,6 +8133,9 @@ msgstr "" ...@@ -8133,6 +8133,9 @@ msgstr ""
msgid "DastProfiles|Debug messages" msgid "DastProfiles|Debug messages"
msgstr "" msgstr ""
msgid "DastProfiles|Delete profile"
msgstr ""
msgid "DastProfiles|Do you want to discard this scanner profile?" msgid "DastProfiles|Do you want to discard this scanner profile?"
msgstr "" msgstr ""
......
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