Commit 32572a3f authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/342424/disableApplySuggestionsButton' into 'master'

Added back tooltip to disabled apply suggestion button

See merge request gitlab-org/gitlab!71802
parents 563c9344 3d3a7343
......@@ -139,7 +139,7 @@ export default {
<gl-loading-icon size="sm" class="d-flex-center mr-2" />
<span>{{ applyingSuggestionsMessage }}</span>
</div>
<div v-else-if="canApply" class="d-flex align-items-center">
<div v-else-if="isLoggedIn" class="d-flex align-items-center">
<div v-if="isBatched">
<gl-button
class="btn-inverted js-remove-from-batch-btn btn-grouped"
......@@ -149,9 +149,8 @@ export default {
{{ __('Remove from batch') }}
</gl-button>
</div>
<div v-else>
<div v-else-if="!isDisableButton && suggestionsCount > 1">
<gl-button
v-if="!isDisableButton && suggestionsCount > 1"
class="btn-inverted js-add-to-batch-btn btn-grouped"
data-qa-selector="add_suggestion_batch_button"
:disabled="isDisableButton"
......
......@@ -230,5 +230,14 @@ describe('Suggestion Diff component', () => {
expect(tooltip.modifiers.viewport).toBe(true);
expect(tooltip.value).toBe('This also resolves this thread');
});
it('renders the inapplicable reason in the tooltip when button is not applicable', () => {
const inapplicableReason = 'lorem';
createComponent({ canApply: false, inapplicableReason, batchSuggestionsCount: 0 });
const tooltip = findTooltip();
expect(tooltip.modifiers.viewport).toBe(true);
expect(tooltip.value).toBe(inapplicableReason);
});
});
});
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