Commit 7d8ad86e authored by Phil Hughes's avatar Phil Hughes

Merge branch '58369-hide-squash-commit' into 'master'

Hide squash commit edit on single commit MR

Closes #58369

See merge request gitlab-org/gitlab-ce!25807
parents 5a82810f 52c772f9
......@@ -20,7 +20,6 @@ export default {
<div>
<gl-dropdown
right
no-caret
text="Use an existing commit message"
variant="link"
class="mr-commit-dropdown"
......
......@@ -329,7 +329,7 @@ export default {
>
<ul class="border-top content-list commits-list flex-list">
<commit-edit
v-if="squashBeforeMerge"
v-if="squashBeforeMerge && shouldShowSquashBeforeMerge"
v-model="squashCommitMessage"
:label="__('Squash commit message')"
input-id="squash-message-edit"
......
---
title: Resolve showing squash commit edit issue when only single commit is present
merge_request: 25807
author:
type: fixed
......@@ -673,7 +673,7 @@ describe('ReadyToMerge', () => {
.at(0)
.props('label');
it('should have two edit components when squash is enabled', () => {
it('should have two edit components when squash is enabled and there is more than 1 commit', () => {
createLocalComponent({
mr: {
commitsCount: 2,
......@@ -685,6 +685,18 @@ describe('ReadyToMerge', () => {
expect(findCommitEditElements().length).toBe(2);
});
it('should have one edit components when squash is enabled and there is 1 commit only', () => {
createLocalComponent({
mr: {
commitsCount: 1,
squash: true,
enableSquashBeforeMerge: true,
},
});
expect(findCommitEditElements().length).toBe(1);
});
it('should have correct edit merge commit label', () => {
createLocalComponent();
......@@ -711,8 +723,10 @@ describe('ReadyToMerge', () => {
expect(findCommitDropdownElement().exists()).toBeFalsy();
});
it('should be rendered if squash is enabled', () => {
createLocalComponent({ mr: { squash: true } });
it('should be rendered if squash is enabled and there is more than 1 commit', () => {
createLocalComponent({
mr: { enableSquashBeforeMerge: true, squash: true, commitsCount: 2 },
});
expect(findCommitDropdownElement().exists()).toBeTruthy();
});
......
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