Commit 26590b83 authored by Thomas Randolph's avatar Thomas Randolph

Move WIP as low as possible but still above unresolved discussions

Also tests the (existing, untested) rebase state
parent 2ff0282b
......@@ -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) {
......
......@@ -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