Commit ebeb27f4 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '21318-rebase-button-not-available-for-wip-merge-requests' into 'master'

Check WIP status as late as possible

See merge request gitlab-org/gitlab!36624
parents 721a2e63 c53a80a1
......@@ -11,12 +11,12 @@ export default function deviseState(data) {
return stateKey.checking;
} else if (data.has_conflicts) {
return stateKey.conflicts;
} else if (data.work_in_progress) {
return stateKey.workInProgress;
} else if (this.shouldBeRebased) {
return stateKey.rebase;
} else if (this.onlyAllowMergeIfPipelineSucceeds && this.isPipelineFailed) {
return stateKey.pipelineFailed;
} else if (data.work_in_progress) {
return stateKey.workInProgress;
} else if (this.hasMergeableDiscussionsState) {
return stateKey.unresolvedDiscussions;
} else if (this.isPipelineBlocked) {
......
---
title: Check WIP status after all other possible statuses
merge_request: 36624
author:
type: changed
......@@ -49,14 +49,18 @@ describe('getStateKey', () => {
expect(bound()).toEqual('unresolvedDiscussions');
data.work_in_progress = true;
expect(bound()).toEqual('workInProgress');
context.onlyAllowMergeIfPipelineSucceeds = true;
context.isPipelineFailed = true;
expect(bound()).toEqual('pipelineFailed');
data.work_in_progress = true;
context.shouldBeRebased = true;
expect(bound()).toEqual('workInProgress');
expect(bound()).toEqual('rebase');
data.has_conflicts = true;
......
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