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) { ...@@ -11,12 +11,12 @@ export default function deviseState(data) {
return stateKey.checking; return stateKey.checking;
} else if (data.has_conflicts) { } else if (data.has_conflicts) {
return stateKey.conflicts; return stateKey.conflicts;
} else if (data.work_in_progress) {
return stateKey.workInProgress;
} else if (this.shouldBeRebased) { } else if (this.shouldBeRebased) {
return stateKey.rebase; return stateKey.rebase;
} else if (this.onlyAllowMergeIfPipelineSucceeds && this.isPipelineFailed) { } else if (this.onlyAllowMergeIfPipelineSucceeds && this.isPipelineFailed) {
return stateKey.pipelineFailed; return stateKey.pipelineFailed;
} else if (data.work_in_progress) {
return stateKey.workInProgress;
} else if (this.hasMergeableDiscussionsState) { } else if (this.hasMergeableDiscussionsState) {
return stateKey.unresolvedDiscussions; return stateKey.unresolvedDiscussions;
} else if (this.isPipelineBlocked) { } 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', () => { ...@@ -49,14 +49,18 @@ describe('getStateKey', () => {
expect(bound()).toEqual('unresolvedDiscussions'); expect(bound()).toEqual('unresolvedDiscussions');
data.work_in_progress = true;
expect(bound()).toEqual('workInProgress');
context.onlyAllowMergeIfPipelineSucceeds = true; context.onlyAllowMergeIfPipelineSucceeds = true;
context.isPipelineFailed = true; context.isPipelineFailed = true;
expect(bound()).toEqual('pipelineFailed'); expect(bound()).toEqual('pipelineFailed');
data.work_in_progress = true; context.shouldBeRebased = true;
expect(bound()).toEqual('workInProgress'); expect(bound()).toEqual('rebase');
data.has_conflicts = true; 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