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
877a700e
Commit
877a700e
authored
Oct 11, 2021
by
Dave Pisek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reviewer feedback: Use withApollo factory
parent
0dd9d2ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
ee/spec/frontend/security_dashboard/components/pipeline/pipeline_security_dashboard_spec.js
...d/components/pipeline/pipeline_security_dashboard_spec.js
+11
-9
No files found.
ee/spec/frontend/security_dashboard/components/pipeline/pipeline_security_dashboard_spec.js
View file @
877a700e
...
...
@@ -41,11 +41,7 @@ describe('Pipeline Security Dashboard component', () => {
const
findVulnerabilityReport
=
()
=>
wrapper
.
findComponent
(
VulnerabilityReport
);
const
findScanErrorsAlert
=
()
=>
wrapper
.
findComponent
(
ScanErrorsAlert
);
const
factory
=
({
stubs
,
provide
,
requestHandlers
}
=
{})
=>
{
if
(
requestHandlers
)
{
localVue
.
use
(
VueApollo
);
}
const
factory
=
({
stubs
,
provide
,
apolloProvider
}
=
{})
=>
{
store
=
new
Vuex
.
Store
({
modules
:
{
vulnerabilities
:
{
...
...
@@ -67,7 +63,7 @@ describe('Pipeline Security Dashboard component', () => {
wrapper
=
shallowMount
(
PipelineSecurityDashboard
,
{
localVue
,
...(
requestHandlers
&&
{
apolloProvider
:
createMockApollo
(
requestHandlers
)
})
,
apolloProvider
,
store
,
provide
:
{
projectId
,
...
...
@@ -88,6 +84,12 @@ describe('Pipeline Security Dashboard component', () => {
});
};
const
factoryWithApollo
=
({
requestHandlers
})
=>
{
localVue
.
use
(
VueApollo
);
factory
({
apolloProvider
:
createMockApollo
(
requestHandlers
)
});
};
afterEach
(()
=>
{
wrapper
.
destroy
();
});
...
...
@@ -160,7 +162,7 @@ describe('Pipeline Security Dashboard component', () => {
describe
(
'
scans error alert
'
,
()
=>
{
describe
(
'
with errors
'
,
()
=>
{
beforeEach
(()
=>
{
factory
({
factory
WithApollo
({
requestHandlers
:
[
[
pipelineSecurityReportSummaryQuery
,
...
...
@@ -177,7 +179,7 @@ describe('Pipeline Security Dashboard component', () => {
describe
(
'
without errors
'
,
()
=>
{
beforeEach
(()
=>
{
factory
({
factory
WithApollo
({
requestHandlers
:
[
[
pipelineSecurityReportSummaryQuery
,
...
...
@@ -201,7 +203,7 @@ describe('Pipeline Security Dashboard component', () => {
`
(
'
shows the summary is "$shouldShowReportSummary"
'
,
async
({
response
,
shouldShowReportSummary
})
=>
{
factory
({
factory
WithApollo
({
requestHandlers
:
[
[
pipelineSecurityReportSummaryQuery
,
jest
.
fn
().
mockResolvedValueOnce
(
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