Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
92f10950
Commit
92f10950
authored
Mar 05, 2020
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert mr_rules_spec to a jest test
- move over jest test - copy over mock test
parent
0f245d47
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
ee/spec/frontend/approvals/components/mr_edit/mr_rules_spec.js
...ec/frontend/approvals/components/mr_edit/mr_rules_spec.js
+3
-2
ee/spec/frontend/approvals/mock_data.js
ee/spec/frontend/approvals/mock_data.js
+25
-0
No files found.
ee/spec/
javascripts
/approvals/components/mr_edit/mr_rules_spec.js
→
ee/spec/
frontend
/approvals/components/mr_edit/mr_rules_spec.js
View file @
92f10950
...
...
@@ -6,7 +6,7 @@ import MRRules from 'ee/approvals/components/mr_edit/mr_rules.vue';
import
Rules
from
'
ee/approvals/components/rules.vue
'
;
import
RuleControls
from
'
ee/approvals/components/rule_controls.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
{
createEmptyRule
,
createMRRule
,
createMRRuleWithSource
}
from
'
../../mock
s
'
;
import
{
createEmptyRule
,
createMRRule
,
createMRRuleWithSource
}
from
'
../../mock
_data
'
;
const
{
HEADERS
}
=
Rules
;
...
...
@@ -26,6 +26,7 @@ describe('EE Approvals MRRules', () => {
wrapper
=
mount
(
localVue
.
extend
(
MRRules
),
{
localVue
,
store
:
new
Vuex
.
Store
(
store
),
attachToDocument
:
true
,
});
};
...
...
@@ -44,7 +45,7 @@ describe('EE Approvals MRRules', () => {
hasLoaded
:
true
,
rules
:
[],
};
store
.
modules
.
approvals
.
actions
.
putRule
=
j
asmine
.
createSpy
(
'
putRule
'
);
store
.
modules
.
approvals
.
actions
.
putRule
=
j
est
.
fn
(
);
});
afterEach
(()
=>
{
...
...
ee/spec/frontend/approvals/mock_data.js
0 → 100644
View file @
92f10950
export
const
createMRRule
=
()
=>
({
id
:
7
,
name
:
'
Amit
'
,
approvers
:
[{
id
:
1
},
{
id
:
2
}],
approvalsRequired
:
2
,
minApprovalsRequired
:
0
,
ruleType
:
'
regular
'
,
});
export
const
createEmptyRule
=
()
=>
({
id
:
5
,
name
:
'
All Members
'
,
approvers
:
[],
approvalsRequired
:
3
,
minApprovalsRequired
:
0
,
ruleType
:
'
any_approver
'
,
});
export
const
createMRRuleWithSource
=
()
=>
({
...
createEmptyRule
(),
...
createMRRule
(),
minApprovalsRequired
:
1
,
hasSource
:
true
,
sourceId
:
3
,
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment