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
c0df9432
Commit
c0df9432
authored
Dec 16, 2021
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate DAST failed site validations mocks
parent
000fdbe6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
10 deletions
+42
-10
ee/spec/frontend/fixtures/dast_profiles.rb
ee/spec/frontend/fixtures/dast_profiles.rb
+40
-0
ee/spec/frontend/security_configuration/dast_profiles/mocks/mock_data.js
...d/security_configuration/dast_profiles/mocks/mock_data.js
+2
-10
No files found.
ee/spec/frontend/fixtures/dast_profiles.rb
View file @
c0df9432
...
...
@@ -349,5 +349,45 @@ RSpec.describe 'DAST profiles (GraphQL fixtures)' do
expect
(
graphql_data_at
(
:project
,
:dastProfiles
,
:edges
)).
to
have_attributes
(
size:
dast_profiles
.
length
)
end
end
describe
'dast_site_validations'
do
context
'failed site validations'
do
path
=
'security_configuration/dast_profiles/graphql/dast_failed_site_validations.query.graphql'
let_it_be
(
:dast_site_validation_https
)
do
create
(
:dast_site_validation
,
state: :failed
,
dast_site_token:
create
(
:dast_site_token
,
url:
'https://example.com'
,
project:
project
)
)
end
let_it_be
(
:dast_site_validation_http
)
do
create
(
:dast_site_validation
,
state: :failed
,
dast_site_token:
create
(
:dast_site_token
,
url:
'http://example.com'
,
project:
project
)
)
end
it
"graphql/
#{
path
}
.json"
do
query
=
get_graphql_query_as_string
(
path
,
ee:
true
)
post_graphql
(
query
,
current_user:
current_user
,
variables:
{
fullPath:
project
.
full_path
})
expect_graphql_errors_to_be_empty
expect
(
graphql_data_at
(
:project
,
:validations
,
:nodes
)).
to
have_attributes
(
size:
2
)
end
end
end
end
end
ee/spec/frontend/security_configuration/dast_profiles/mocks/mock_data.js
View file @
c0df9432
...
...
@@ -3,6 +3,7 @@ import scannerProfilesFixtures from 'test_fixtures/graphql/security_configuratio
import
profilesFixtures
from
'
test_fixtures/graphql/security_configuration/dast_profiles/graphql/dast_profiles.query.graphql.json
'
;
import
policySiteProfilesFixtures
from
'
test_fixtures/graphql/security_configuration/dast_profiles/graphql/dast_site_profiles.query.graphql.from_policies.json
'
;
import
policyScannerProfilesFixtures
from
'
test_fixtures/graphql/security_configuration/dast_profiles/graphql/dast_scanner_profiles.query.graphql.from_policies.json
'
;
import
dastFailedSiteValidationsFixtures
from
'
test_fixtures/graphql/security_configuration/dast_profiles/graphql/dast_failed_site_validations.query.graphql.json
'
;
export
const
siteProfiles
=
siteProfilesFixture
.
data
.
project
.
siteProfiles
.
edges
.
map
(
({
node
})
=>
node
,
...
...
@@ -29,13 +30,4 @@ export const scannerProfiles = scannerProfilesFixtures.data.project.scannerProfi
export
const
savedScans
=
profilesFixtures
.
data
.
project
.
dastProfiles
.
edges
.
map
(({
node
})
=>
node
);
export
const
failedSiteValidations
=
[
{
id
:
'
1
'
,
normalizedTargetUrl
:
'
http://example.com:80
'
,
},
{
id
:
'
2
'
,
normalizedTargetUrl
:
'
https://example.com:443
'
,
},
];
export
const
failedSiteValidations
=
dastFailedSiteValidationsFixtures
.
data
.
project
.
validations
.
nodes
;
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