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
cdb002c8
Commit
cdb002c8
authored
May 27, 2021
by
Mark Florian
Committed by
Jannik Lehmann
Jun 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Unit Tests
parent
fca9abd3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
24 deletions
+23
-24
app/assets/javascripts/security_configuration/components/constants.js
...avascripts/security_configuration/components/constants.js
+3
-3
app/assets/javascripts/security_configuration/utils.js
app/assets/javascripts/security_configuration/utils.js
+2
-2
locale/gitlab.pot
locale/gitlab.pot
+0
-6
spec/frontend/security_configuration/components/redesigned_app_spec.js
.../security_configuration/components/redesigned_app_spec.js
+18
-13
No files found.
app/assets/javascripts/security_configuration/components/constants.js
View file @
cdb002c8
...
...
@@ -18,7 +18,7 @@ import {
* Translations & helpPagePaths for Static Security Configuration Page
*/
export
const
SAST_NAME
=
__
(
'
Static Application Security Testing (SAST)
'
);
export
const
SAST_SHORT_NAME
=
__
(
'
SAST
'
);
export
const
SAST_SHORT_NAME
=
s__
(
'
ciReport|
SAST
'
);
export
const
SAST_DESCRIPTION
=
__
(
'
Analyze your source code for known vulnerabilities.
'
);
export
const
SAST_HELP_PATH
=
helpPagePath
(
'
user/application_security/sast/index
'
);
export
const
SAST_CONFIG_HELP_PATH
=
helpPagePath
(
'
user/application_security/sast/index
'
,
{
...
...
@@ -26,7 +26,7 @@ export const SAST_CONFIG_HELP_PATH = helpPagePath('user/application_security/sas
});
export
const
DAST_NAME
=
__
(
'
Dynamic Application Security Testing (DAST)
'
);
export
const
DAST_SHORT_NAME
=
__
(
'
DAST
'
);
export
const
DAST_SHORT_NAME
=
s__
(
'
ciReport|
DAST
'
);
export
const
DAST_DESCRIPTION
=
__
(
'
Analyze a review version of your web application.
'
);
export
const
DAST_HELP_PATH
=
helpPagePath
(
'
user/application_security/dast/index
'
);
export
const
DAST_CONFIG_HELP_PATH
=
helpPagePath
(
'
user/application_security/dast/index
'
,
{
...
...
@@ -165,7 +165,7 @@ export const securityFeatures = [
helpPath
:
SAST_HELP_PATH
,
configurationHelpPath
:
SAST_CONFIG_HELP_PATH
,
type
:
REPORT_TYPE_SAST
,
// This field is currently hardcoded because SAST is always available
d
// This field is currently hardcoded because SAST is always available
.
// It will eventually come from the Backend, the progress is tracked in
// https://gitlab.com/gitlab-org/gitlab/-/issues/331622
available
:
true
,
...
...
app/assets/javascripts/security_configuration/utils.js
View file @
cdb002c8
...
...
@@ -18,7 +18,7 @@ export const augmentFeatures = (securityFeatures, complianceFeatures, features =
};
return
{
augmentedSecurityFeatures
:
securityFeatures
.
map
((
e
)
=>
augmentFeature
(
e
)),
augmentedComplianceFeatures
:
complianceFeatures
.
map
((
e
)
=>
augmentFeature
(
e
)),
augmentedSecurityFeatures
:
securityFeatures
.
map
((
feature
)
=>
augmentFeature
(
featur
e
)),
augmentedComplianceFeatures
:
complianceFeatures
.
map
((
feature
)
=>
augmentFeature
(
featur
e
)),
};
};
locale/gitlab.pot
View file @
cdb002c8
...
...
@@ -10006,9 +10006,6 @@ msgstr ""
msgid "DAG visualization requires at least 3 dependent jobs."
msgstr ""
msgid "DAST"
msgstr ""
msgid "DAST Configuration"
msgstr ""
...
...
@@ -28483,9 +28480,6 @@ msgstr ""
msgid "SAML for %{group_name}"
msgstr ""
msgid "SAST"
msgstr ""
msgid "SAST Configuration"
msgstr ""
...
...
spec/frontend/security_configuration/components/redesigned_app_spec.js
View file @
cdb002c8
import
{
GlTab
,
GlTabs
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
SAST_NAME
,
SAST_SHORT_NAME
,
SAST_DESCRIPTION
,
SAST_HELP_PATH
,
SAST_CONFIG_HELP_PATH
,
}
from
'
~/security_configuration/components/constants
'
;
import
FeatureCard
from
'
~/security_configuration/components/feature_card.vue
'
;
import
RedesignedSecurityConfigurationApp
from
'
~/security_configuration/components/redesigned_app.vue
'
;
...
...
@@ -17,18 +24,18 @@ describe('NewApp component', () => {
const
findMainHeading
=
()
=>
wrapper
.
find
(
'
h1
'
);
const
findSubHeading
=
()
=>
wrapper
.
find
(
'
h2
'
);
const
findTab
=
()
=>
wrapper
.
find
(
GlTab
);
const
findTabs
=
()
=>
wrapper
.
findAll
(
GlTabs
);
const
findTab
=
()
=>
wrapper
.
find
Component
(
GlTab
);
const
findTabs
=
()
=>
wrapper
.
findAll
Components
(
GlTabs
);
const
findByTestId
=
(
id
)
=>
wrapper
.
findByTestId
(
id
);
const
findFeatureCards
=
()
=>
wrapper
.
findAll
(
FeatureCard
);
const
findFeatureCards
=
()
=>
wrapper
.
findAll
Components
(
FeatureCard
);
const
securityFeaturesMock
=
[
{
name
:
'
Static Application Security Testing (SAST)
'
,
shortName
:
'
SAST
'
,
description
:
'
Analyze your source code for known vulnerabilities.
'
,
helpPath
:
'
/help/user/application_security/sast/index
'
,
configurationHelpPath
:
'
/help/user/application_security/sast/index#configuration
'
,
name
:
SAST_NAME
,
shortName
:
SAST_SHORT_NAME
,
description
:
SAST_DESCRIPTION
,
helpPath
:
SAST_HELP_PATH
,
configurationHelpPath
:
SAST_CONFIG_HELP_PATH
,
type
:
'
sast
'
,
available
:
true
,
},
...
...
@@ -66,7 +73,7 @@ describe('NewApp component', () => {
it
(
'
renders sub-heading with correct text
'
,
()
=>
{
const
subHeading
=
findSubHeading
();
expect
(
subHeading
).
toExist
();
expect
(
subHeading
.
text
()).
toContain
(
'
Security testing
'
);
expect
(
subHeading
.
text
()).
toContain
(
RedesignedSecurityConfigurationApp
.
i18n
.
securityTesting
);
});
it
(
'
renders right amount of feature cards for given props with correct props
'
,
()
=>
{
...
...
@@ -91,11 +98,9 @@ describe('NewApp component', () => {
it
(
'
should show latest pipeline info with correct link when latestPipelinePath is defined
'
,
()
=>
{
expect
(
findByTestId
(
'
latest-pipeline-info
'
).
exists
()).
toBe
(
true
);
expect
(
findByTestId
(
'
latest-pipeline-info
'
).
text
()).
toMatchInterpolatedText
(
"
The status of the tools only applies to the default branch and is based on the latest pipeline. Once you've enabled a scan for the default branch, any subsequent feature branch you create will include the scan.
"
,
);
expect
(
findByTestId
(
'
latest-pipeline-info
'
).
find
(
'
a
'
).
element
.
href
).
toEqual
(
'
http://test.host/test/path
'
,
RedesignedSecurityConfigurationApp
.
i18n
.
securityTestingDescription
,
);
expect
(
findByTestId
(
'
latest-pipeline-info
'
).
find
(
'
a
'
).
attributes
(
'
href
'
)).
toBe
(
'
test/path
'
);
});
});
});
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