diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/frontend/vue_mr_widget/stores/get_state_key_spec.js | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/frontend/vue_mr_widget/stores/get_state_key_spec.js')
-rw-r--r-- | spec/frontend/vue_mr_widget/stores/get_state_key_spec.js | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/spec/frontend/vue_mr_widget/stores/get_state_key_spec.js b/spec/frontend/vue_mr_widget/stores/get_state_key_spec.js index 1cb2c6c669b..128e0f39c41 100644 --- a/spec/frontend/vue_mr_widget/stores/get_state_key_spec.js +++ b/spec/frontend/vue_mr_widget/stores/get_state_key_spec.js @@ -11,15 +11,13 @@ describe('getStateKey', () => { hasMergeableDiscussionsState: false, isPipelineBlocked: false, canBeMerged: false, + projectArchived: false, + branchMissing: false, + commitsCount: 2, + hasConflicts: false, + workInProgress: false, }; - const data = { - project_archived: false, - branch_missing: false, - commits_count: 2, - has_conflicts: false, - work_in_progress: false, - }; - const bound = getStateKey.bind(context, data); + const bound = getStateKey.bind(context); expect(bound()).toEqual(null); @@ -49,7 +47,7 @@ describe('getStateKey', () => { expect(bound()).toEqual('unresolvedDiscussions'); - data.work_in_progress = true; + context.workInProgress = true; expect(bound()).toEqual('workInProgress'); @@ -62,7 +60,7 @@ describe('getStateKey', () => { expect(bound()).toEqual('rebase'); - data.has_conflicts = true; + context.hasConflicts = true; expect(bound()).toEqual('conflicts'); @@ -70,15 +68,15 @@ describe('getStateKey', () => { expect(bound()).toEqual('checking'); - data.commits_count = 0; + context.commitsCount = 0; expect(bound()).toEqual('nothingToMerge'); - data.branch_missing = true; + context.branchMissing = true; expect(bound()).toEqual('missingBranch'); - data.project_archived = true; + context.projectArchived = true; expect(bound()).toEqual('archived'); }); @@ -94,15 +92,13 @@ describe('getStateKey', () => { isPipelineBlocked: false, canBeMerged: false, shouldBeRebased: true, + projectArchived: false, + branchMissing: false, + commitsCount: 2, + hasConflicts: false, + workInProgress: false, }; - const data = { - project_archived: false, - branch_missing: false, - commits_count: 2, - has_conflicts: false, - work_in_progress: false, - }; - const bound = getStateKey.bind(context, data); + const bound = getStateKey.bind(context); expect(bound()).toEqual('rebase'); }); @@ -115,15 +111,11 @@ describe('getStateKey', () => { `( 'returns $stateKey when canMerge is $canMerge and isSHAMismatch is $isSHAMismatch', ({ canMerge, isSHAMismatch, stateKey }) => { - const bound = getStateKey.bind( - { - canMerge, - isSHAMismatch, - }, - { - commits_count: 2, - }, - ); + const bound = getStateKey.bind({ + canMerge, + isSHAMismatch, + commitsCount: 2, + }); expect(bound()).toEqual(stateKey); }, |