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
139e730a
Commit
139e730a
authored
May 11, 2021
by
Paul Gascou-Vaillancourt
Committed by
Mark Florian
May 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test mutation payload in ManageViaMr
parent
da05f79b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
ee/spec/frontend/vue_shared/security_reports/components/manage_via_mr_spec.js
..._shared/security_reports/components/manage_via_mr_spec.js
+15
-2
No files found.
ee/spec/frontend/vue_shared/security_reports/components/manage_via_mr_spec.js
View file @
139e730a
...
...
@@ -19,6 +19,8 @@ jest.mock('~/lib/utils/url_utility');
Vue
.
use
(
VueApollo
);
const
projectPath
=
'
namespace/project
'
;
describe
(
'
ManageViaMr component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -29,7 +31,7 @@ describe('ManageViaMr component', () => {
${
'
DEPENDENCY_SCANNING
'
}
|
${
REPORT_TYPE_SECRET_DETECTION
}
|
${
configureSecretDetectionMutation
}
|
${
'
configureSecretDetection
'
}
`
(
'
$featureType
'
,
({
featureName
,
mutation
,
featureType
,
mutationId
})
=>
{
const
buildConfigureSecurityFeatureMock
=
buildConfigureSecurityFeatureMockFactory
(
mutationId
);
const
successHandler
=
async
()
=>
buildConfigureSecurityFeatureMock
(
);
const
successHandler
=
jest
.
fn
(
async
()
=>
buildConfigureSecurityFeatureMock
()
);
const
noSuccessPathHandler
=
async
()
=>
buildConfigureSecurityFeatureMock
({
successPath
:
''
,
...
...
@@ -51,7 +53,7 @@ describe('ManageViaMr component', () => {
mount
(
ManageViaMr
,
{
apolloProvider
:
mockApollo
,
provide
:
{
projectPath
:
'
testProjectPath
'
,
projectPath
,
},
propsData
:
{
feature
:
{
...
...
@@ -88,6 +90,17 @@ describe('ManageViaMr component', () => {
it
(
'
it does render a button
'
,
()
=>
{
expect
(
findButton
().
exists
()).
toBe
(
true
);
});
it
(
'
clicking on the button triggers the configure mutation
'
,
()
=>
{
findButton
().
trigger
(
'
click
'
);
expect
(
successHandler
).
toHaveBeenCalledTimes
(
1
);
expect
(
successHandler
).
toHaveBeenCalledWith
({
input
:
{
projectPath
,
},
});
});
});
describe
(
'
given a pending response
'
,
()
=>
{
...
...
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