Commit 24cafe45 authored by Eric Eastwood's avatar Eric Eastwood

Change default disabled merge request widget message to "Merge is not allowed yet"

Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/39188
parent 822d5612
...@@ -290,6 +290,7 @@ export default { ...@@ -290,6 +290,7 @@ export default {
<input <input
id="remove-source-branch-input" id="remove-source-branch-input"
v-model="removeSourceBranch" v-model="removeSourceBranch"
class="js-remove-source-branch-checkbox"
:disabled="isRemoveSourceBranchButtonDisabled" :disabled="isRemoveSourceBranchButtonDisabled"
type="checkbox"/> Remove source branch type="checkbox"/> Remove source branch
</label> </label>
...@@ -315,8 +316,8 @@ export default { ...@@ -315,8 +316,8 @@ export default {
</button> </button>
</template> </template>
<template v-else> <template v-else>
<span class="bold"> <span class="bold js-resolve-mr-widget-items-message">
The pipeline for this merge request has not succeeded yet You can only merge once the items above are resolved
</span> </span>
</template> </template>
</div> </div>
......
---
title: Update default disabled merge request widget message to reflect a general failure
merge_request: 14960
author:
type: changed
...@@ -43,6 +43,10 @@ describe('MRWidgetReadyToMerge', () => { ...@@ -43,6 +43,10 @@ describe('MRWidgetReadyToMerge', () => {
vm = createComponent(); vm = createComponent();
}); });
afterEach(() => {
vm.$destroy();
});
describe('props', () => { describe('props', () => {
it('should have props', () => { it('should have props', () => {
const { mr, service } = readyToMergeComponent.props; const { mr, service } = readyToMergeComponent.props;
...@@ -495,6 +499,48 @@ describe('MRWidgetReadyToMerge', () => { ...@@ -495,6 +499,48 @@ describe('MRWidgetReadyToMerge', () => {
}); });
}); });
describe('Merge controls', () => {
describe('when allowed to merge', () => {
beforeEach(() => {
vm = createComponent({
mr: { isMergeAllowed: true },
});
});
it('shows remove source branch checkbox', () => {
expect(vm.$el.querySelector('.js-remove-source-branch-checkbox')).toBeDefined();
});
it('shows modify commit message button', () => {
expect(vm.$el.querySelector('.js-modify-commit-message-button')).toBeDefined();
});
it('does not show message about needing to resolve items', () => {
expect(vm.$el.querySelector('.js-resolve-mr-widget-items-message')).toBeNull();
});
});
describe('when not allowed to merge', () => {
beforeEach(() => {
vm = createComponent({
mr: { isMergeAllowed: false },
});
});
it('does not show remove source branch checkbox', () => {
expect(vm.$el.querySelector('.js-remove-source-branch-checkbox')).toBeNull();
});
it('does not show modify commit message button', () => {
expect(vm.$el.querySelector('.js-modify-commit-message-button')).toBeNull();
});
it('shows message to resolve all items before being allowed to merge', () => {
expect(vm.$el.querySelector('.js-resolve-mr-widget-items-message')).toBeDefined();
});
});
});
describe('Commit message area', () => { describe('Commit message area', () => {
it('when using merge commits, should show "Modify commit message" button', () => { it('when using merge commits, should show "Modify commit message" button', () => {
const customVm = createComponent({ const customVm = createComponent({
......
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