Merge branch '39188-change-default-disabled-merge-message' into 'master'

Change default disabled merge request widget message to be more general

Closes #39188

See merge request gitlab-org/gitlab-ce!14960
This commit is contained in:
Filipa Lacerda 2017-10-27 11:07:22 +00:00
commit e9d3526123
3 changed files with 54 additions and 2 deletions

View file

@ -286,6 +286,7 @@ export default {
<input
id="remove-source-branch-input"
v-model="removeSourceBranch"
class="js-remove-source-branch-checkbox"
:disabled="isRemoveSourceBranchButtonDisabled"
type="checkbox"/> Remove source branch
</label>
@ -311,8 +312,8 @@ export default {
</button>
</template>
<template v-else>
<span class="bold">
The pipeline for this merge request has not succeeded yet
<span class="bold js-resolve-mr-widget-items-message">
You can only merge once the items above are resolved
</span>
</template>
</div>

View file

@ -0,0 +1,5 @@
---
title: Update default disabled merge request widget message to reflect a general failure
merge_request: 14960
author:
type: changed

View file

@ -43,6 +43,10 @@ describe('MRWidgetReadyToMerge', () => {
vm = createComponent();
});
afterEach(() => {
vm.$destroy();
});
describe('props', () => {
it('should have props', () => {
const { mr, service } = readyToMergeComponent.props;
@ -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', () => {
it('when using merge commits, should show "Modify commit message" button', () => {
const customVm = createComponent({