Commit db2d8cb5 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '336933-improve-the-process-of-deleting-image-tags' into 'master'

Fix row alignment when delete is disabled

See merge request gitlab-org/gitlab!72125
parents 3b3ed4e8 325ee0d8
......@@ -181,13 +181,14 @@ export default {
</template>
<template #right-action>
<gl-dropdown
v-if="!isDeleteDisabled"
:disabled="isDeleteDisabled"
icon="ellipsis_v"
:text="$options.i18n.MORE_ACTIONS_TEXT"
:text-sr-only="true"
category="tertiary"
no-caret
right
:class="{ 'gl-opacity-0 gl-pointer-events-none': isDeleteDisabled }"
data-testid="additional-actions"
data-qa-selector="more_actions_menu"
>
......
......@@ -283,18 +283,20 @@ describe('tags list row', () => {
});
it.each`
canDelete | digest | disabled | visible
${true} | ${null} | ${true} | ${false}
${false} | ${'foo'} | ${true} | ${false}
${false} | ${null} | ${true} | ${false}
${true} | ${'foo'} | ${true} | ${false}
${true} | ${'foo'} | ${false} | ${true}
canDelete | digest | disabled | buttonDisabled
${true} | ${null} | ${true} | ${true}
${false} | ${'foo'} | ${true} | ${true}
${false} | ${null} | ${true} | ${true}
${true} | ${'foo'} | ${true} | ${true}
${true} | ${'foo'} | ${false} | ${false}
`(
'is $visible that is visible when canDelete is $canDelete and digest is $digest and disabled is $disabled',
({ canDelete, digest, disabled, visible }) => {
({ canDelete, digest, disabled, buttonDisabled }) => {
mountComponent({ ...defaultProps, tag: { ...tag, canDelete, digest }, disabled });
expect(findAdditionalActionsMenu().exists()).toBe(visible);
expect(findAdditionalActionsMenu().props('disabled')).toBe(buttonDisabled);
expect(findAdditionalActionsMenu().classes('gl-opacity-0')).toBe(buttonDisabled);
expect(findAdditionalActionsMenu().classes('gl-pointer-events-none')).toBe(buttonDisabled);
},
);
......
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