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
783124ad
Commit
783124ad
authored
Jun 01, 2021
by
Jannik Lehmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor Spec
parent
17c667e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
+24
-19
app/assets/javascripts/security_configuration/components/redesigned_app.vue
...ipts/security_configuration/components/redesigned_app.vue
+13
-11
spec/frontend/security_configuration/components/redesigned_app_spec.js
.../security_configuration/components/redesigned_app_spec.js
+6
-3
spec/frontend/security_configuration/utils_spec.js
spec/frontend/security_configuration/utils_spec.js
+5
-5
No files found.
app/assets/javascripts/security_configuration/components/redesigned_app.vue
View file @
783124ad
...
...
@@ -3,7 +3,20 @@ import { GlTab, GlTabs, GlSprintf, GlLink } from '@gitlab/ui';
import
{
__
,
s__
}
from
'
~/locale
'
;
import
FeatureCard
from
'
./feature_card.vue
'
;
export
const
i18n
=
{
compliance
:
s__
(
'
SecurityConfiguration|Compliance
'
),
securityTesting
:
s__
(
'
SecurityConfiguration|Security testing
'
),
securityTestingDescription
:
s__
(
`SecurityConfiguration|The status of the tools only applies to the
default branch and is based on the %{linkStart}latest pipeline%{linkEnd}.
Once you've enabled a scan for the default branch, any subsequent feature
branch you create will include the scan.`
,
),
securityConfiguration
:
__
(
'
Security Configuration
'
),
};
export
default
{
i18n
,
components
:
{
GlTab
,
GlLink
,
...
...
@@ -22,17 +35,6 @@ export default {
default
:
''
,
},
},
i18n
:
{
compliance
:
s__
(
'
SecurityConfiguration|Compliance
'
),
securityTesting
:
s__
(
'
SecurityConfiguration|Security testing
'
),
securityTestingDescription
:
s__
(
`SecurityConfiguration|The status of the tools only applies to the
default branch and is based on the %{linkStart}latest pipeline%{linkEnd}.
Once you've enabled a scan for the default branch, any subsequent feature
branch you create will include the scan.`
,
),
securityConfiguration
:
__
(
'
Security Configuration
'
),
},
};
</
script
>
...
...
spec/frontend/security_configuration/components/redesigned_app_spec.js
View file @
783124ad
...
...
@@ -9,7 +9,10 @@ import {
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
'
;
import
RedesignedSecurityConfigurationApp
,
{
i18n
,
}
from
'
~/security_configuration/components/redesigned_app.vue
'
;
import
{
REPORT_TYPE_SAST
}
from
'
~/vue_shared/security_reports/constants
'
;
describe
(
'
NewApp component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -73,7 +76,7 @@ describe('NewApp component', () => {
it
(
'
renders sub-heading with correct text
'
,
()
=>
{
const
subHeading
=
findSubHeading
();
expect
(
subHeading
).
toExist
();
expect
(
subHeading
.
text
()).
toContain
(
RedesignedSecurityConfigurationApp
.
i18n
.
securityTesting
);
expect
(
subHeading
.
text
()).
toContain
(
i18n
.
securityTesting
);
});
it
(
'
renders right amount of feature cards for given props with correct props
'
,
()
=>
{
...
...
@@ -98,7 +101,7 @@ 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
(
RedesignedSecurityConfigurationApp
.
i18n
.
securityTestingDescription
,
i18n
.
securityTestingDescription
,
);
expect
(
findByTestId
(
'
latest-pipeline-info
'
).
find
(
'
a
'
).
attributes
(
'
href
'
)).
toBe
(
'
test/path
'
);
});
...
...
spec/frontend/security_configuration/utils_spec.js
View file @
783124ad
...
...
@@ -54,26 +54,26 @@ const expectedOutputCustomFeature = {
augmentedComplianceFeatures
:
mockComplianceFeatures
,
};
describe
(
'
augmentFeatures
'
,
()
=>
{
it
(
'
augments features array correctly when
given an empty array
'
,
()
=>
{
describe
(
'
returns an object with augmentedSecurityFeatures and augmentedComplianceFeatures when
'
,
()
=>
{
it
(
'
given an empty array
'
,
()
=>
{
expect
(
augmentFeatures
(
mockSecurityFeatures
,
mockComplianceFeatures
,
[])).
toEqual
(
expectedOutputDefault
,
);
});
it
(
'
augments features array correctly when
given an invalid populated array
'
,
()
=>
{
it
(
'
given an invalid populated array
'
,
()
=>
{
expect
(
augmentFeatures
(
mockSecurityFeatures
,
mockComplianceFeatures
,
mockInvalidCustomFeature
),
).
toEqual
(
expectedOutputDefault
);
});
it
(
'
augments features array correctly when
features have secondary key
'
,
()
=>
{
it
(
'
features have secondary key
'
,
()
=>
{
expect
(
augmentFeatures
(
mockSecurityFeatures
,
mockFeaturesWithSecondary
,
[])).
toEqual
(
expectedOutputSecondary
,
);
});
it
(
'
augments features array correctly when
given a valid populated array
'
,
()
=>
{
it
(
'
given a valid populated array
'
,
()
=>
{
expect
(
augmentFeatures
(
mockSecurityFeatures
,
mockComplianceFeatures
,
mockValidCustomFeature
),
).
toEqual
(
expectedOutputCustomFeature
);
...
...
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