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
66a10e9d
Commit
66a10e9d
authored
May 08, 2020
by
Himanshu Kapoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move ee/approvals specs to Jest
Move some ee/spec/javascripts/approvals specs to Jest
parent
ab30bbb8
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
29 deletions
+37
-29
ee/spec/frontend/approvals/components/hidden_groups_item_spec.js
.../frontend/approvals/components/hidden_groups_item_spec.js
+0
-0
ee/spec/frontend/approvals/components/modal_rule_create_spec.js
...c/frontend/approvals/components/modal_rule_create_spec.js
+1
-1
ee/spec/frontend/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
...provals/components/mr_edit/mr_rules_hidden_inputs_spec.js
+17
-9
ee/spec/frontend/approvals/components/project_settings/project_rules_spec.js
...provals/components/project_settings/project_rules_spec.js
+0
-0
ee/spec/frontend/approvals/components/rule_controls_spec.js
ee/spec/frontend/approvals/components/rule_controls_spec.js
+3
-3
ee/spec/frontend/approvals/components/rule_form_spec.js
ee/spec/frontend/approvals/components/rule_form_spec.js
+16
-16
ee/spec/frontend/approvals/mocks.js
ee/spec/frontend/approvals/mocks.js
+0
-0
No files found.
ee/spec/
javascripts
/approvals/components/hidden_groups_item_spec.js
→
ee/spec/
frontend
/approvals/components/hidden_groups_item_spec.js
View file @
66a10e9d
File moved
ee/spec/
javascripts
/approvals/components/modal_rule_create_spec.js
→
ee/spec/
frontend
/approvals/components/modal_rule_create_spec.js
View file @
66a10e9d
...
...
@@ -78,7 +78,7 @@ describe('Approvals ModalRuleCreate', () => {
factory
();
const
form
=
wrapper
.
find
(
RuleForm
);
form
.
vm
.
submit
=
j
asmine
.
createSpy
(
'
submit
'
);
form
.
vm
.
submit
=
j
est
.
fn
(
);
const
modal
=
wrapper
.
find
(
GlModalVuex
);
modal
.
vm
.
$emit
(
'
ok
'
,
new
Event
(
'
ok
'
));
...
...
ee/spec/
javascripts
/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
→
ee/spec/
frontend
/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
View file @
66a10e9d
...
...
@@ -95,7 +95,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
factory
();
expect
(
findHiddenInputs
()).
toEqual
(
jasmine
.
arrayContaining
([
expect
.
arrayContaining
([
{
name
:
INPUT_ID
,
value
:
'
4
'
},
{
name
:
INPUT_DELETE
,
value
:
'
1
'
},
{
name
:
INPUT_ID
,
value
:
'
7
'
},
...
...
@@ -177,10 +177,14 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it
(
'
renders source id input
'
,
()
=>
{
factory
();
expect
(
findHiddenInputs
()).
toContain
({
expect
(
findHiddenInputs
()).
toEqual
(
expect
.
arrayContaining
([
{
name
:
INPUT_SOURCE_ID
,
value
:
rule
.
sourceId
.
toString
(),
});
},
]),
);
});
});
});
...
...
@@ -193,10 +197,14 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it
(
'
renders input to remove hidden groups
'
,
()
=>
{
factory
();
expect
(
findHiddenInputs
()).
toContain
({
expect
(
findHiddenInputs
()).
toEqual
(
expect
.
arrayContaining
([
{
name
:
INPUT_REMOVE_HIDDEN_GROUPS
,
value
:
'
true
'
,
});
},
]),
);
});
});
});
...
...
ee/spec/
javascripts
/approvals/components/project_settings/project_rules_spec.js
→
ee/spec/
frontend
/approvals/components/project_settings/project_rules_spec.js
View file @
66a10e9d
File moved
ee/spec/
javascripts
/approvals/components/rule_controls_spec.js
→
ee/spec/
frontend
/approvals/components/rule_controls_spec.js
View file @
66a10e9d
...
...
@@ -39,7 +39,7 @@ describe('EE Approvals RuleControls', () => {
beforeEach
(()
=>
{
store
=
createStoreOptions
(
MREditModule
());
({
actions
}
=
store
.
modules
.
approvals
);
[
'
requestEditRule
'
,
'
requestDeleteRule
'
].
forEach
(
actionName
=>
spyOn
(
actions
,
actionName
));
[
'
requestEditRule
'
,
'
requestDeleteRule
'
].
forEach
(
actionName
=>
jest
.
spyOn
(
actions
,
actionName
));
});
afterEach
(()
=>
{
...
...
@@ -69,7 +69,7 @@ describe('EE Approvals RuleControls', () => {
button
.
vm
.
$emit
(
'
click
'
);
expect
(
store
.
modules
.
approvals
.
actions
.
requestEditRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expect
.
anything
(),
TEST_RULE
,
undefined
,
);
...
...
@@ -94,7 +94,7 @@ describe('EE Approvals RuleControls', () => {
button
.
vm
.
$emit
(
'
click
'
);
expect
(
store
.
modules
.
approvals
.
actions
.
requestDeleteRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expect
.
anything
(),
TEST_RULE
,
undefined
,
);
...
...
ee/spec/
javascripts
/approvals/components/rule_form_spec.js
→
ee/spec/
frontend
/approvals/components/rule_form_spec.js
View file @
66a10e9d
...
...
@@ -79,7 +79,7 @@ describe('EE Approvals RuleForm', () => {
store
=
createStoreOptions
(
projectSettingsModule
(),
{
projectId
:
TEST_PROJECT_ID
});
[
'
postRule
'
,
'
putRule
'
,
'
deleteRule
'
,
'
putFallbackRule
'
].
forEach
(
actionName
=>
{
spyOn
(
store
.
modules
.
approvals
.
actions
,
actionName
);
jest
.
spyOn
(
store
.
modules
.
approvals
.
actions
,
actionName
).
mockImplementation
(()
=>
{}
);
});
({
actions
}
=
store
.
modules
.
approvals
);
...
...
@@ -166,7 +166,7 @@ describe('EE Approvals RuleForm', () => {
wrapper
.
vm
.
submit
();
expect
(
actions
.
postRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expected
,
undefined
);
expect
(
actions
.
postRule
).
toHaveBeenCalledWith
(
expect
.
anything
(),
expected
,
undefined
);
});
});
});
...
...
@@ -266,7 +266,7 @@ describe('EE Approvals RuleForm', () => {
wrapper
.
vm
.
submit
();
expect
(
actions
.
postRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expected
,
undefined
);
expect
(
actions
.
postRule
).
toHaveBeenCalledWith
(
expect
.
anything
(),
expected
,
undefined
);
});
it
(
'
adds selected approvers on selection
'
,
()
=>
{
...
...
@@ -319,7 +319,7 @@ describe('EE Approvals RuleForm', () => {
wrapper
.
vm
.
submit
();
expect
(
actions
.
putRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expected
,
undefined
);
expect
(
actions
.
putRule
).
toHaveBeenCalledWith
(
expect
.
anything
(),
expected
,
undefined
);
});
});
...
...
@@ -346,7 +346,7 @@ describe('EE Approvals RuleForm', () => {
it
(
'
puts fallback rule
'
,
()
=>
{
expect
(
actions
.
putFallbackRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expect
.
anything
(),
{
approvalsRequired
:
TEST_APPROVALS_REQUIRED
},
undefined
,
);
...
...
@@ -434,8 +434,8 @@ describe('EE Approvals RuleForm', () => {
wrapper
.
vm
.
submit
();
expect
(
actions
.
putRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
jasmine
.
objectContaining
({
expect
.
anything
(),
expect
.
objectContaining
({
removeHiddenGroups
:
false
,
}),
undefined
,
...
...
@@ -451,8 +451,8 @@ describe('EE Approvals RuleForm', () => {
wrapper
.
vm
.
submit
();
expect
(
actions
.
putRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
jasmine
.
objectContaining
({
expect
.
anything
(),
expect
.
objectContaining
({
removeHiddenGroups
:
true
,
}),
undefined
,
...
...
@@ -533,8 +533,8 @@ describe('EE Approvals RuleForm', () => {
it
(
'
posts new rule
'
,
()
=>
{
expect
(
actions
.
postRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
jasmine
.
objectContaining
({
expect
.
anything
(),
expect
.
objectContaining
({
approvalsRequired
:
TEST_APPROVALS_REQUIRED
,
users
:
TEST_APPROVERS
.
map
(
x
=>
x
.
id
),
}),
...
...
@@ -552,7 +552,7 @@ describe('EE Approvals RuleForm', () => {
it
(
'
puts fallback rule
'
,
()
=>
{
expect
(
actions
.
putFallbackRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expect
.
anything
(),
{
approvalsRequired
:
TEST_APPROVALS_REQUIRED
},
undefined
,
);
...
...
@@ -579,7 +579,7 @@ describe('EE Approvals RuleForm', () => {
it
(
'
deletes rule
'
,
()
=>
{
expect
(
actions
.
deleteRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expect
.
anything
(),
TEST_RULE
.
id
,
undefined
,
);
...
...
@@ -587,7 +587,7 @@ describe('EE Approvals RuleForm', () => {
it
(
'
puts fallback rule
'
,
()
=>
{
expect
(
actions
.
putFallbackRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
expect
.
anything
(),
{
approvalsRequired
:
TEST_APPROVALS_REQUIRED
},
undefined
,
);
...
...
@@ -605,8 +605,8 @@ describe('EE Approvals RuleForm', () => {
it
(
'
puts rule
'
,
()
=>
{
expect
(
actions
.
putRule
).
toHaveBeenCalledWith
(
jasmine
.
anything
(),
jasmine
.
objectContaining
({
expect
.
anything
(),
expect
.
objectContaining
({
id
:
TEST_RULE
.
id
,
name
:
'
Bogus
'
,
approvalsRequired
:
TEST_APPROVALS_REQUIRED
,
...
...
ee/spec/
javascripts
/approvals/mocks.js
→
ee/spec/
frontend
/approvals/mocks.js
View file @
66a10e9d
File moved
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