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) { ...@@ -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) {
......
...@@ -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