Commit e9d35261 authored by Filipa Lacerda's avatar Filipa Lacerda

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
parents 284a9452 b7835587
......@@ -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>
......
---
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', () => {
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({
......
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