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
d451d002
Commit
d451d002
authored
May 25, 2021
by
Jannik Lehmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor utils spec
parent
82b6d9fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
63 deletions
+54
-63
spec/frontend/security_configuration/utils_mocks.js
spec/frontend/security_configuration/utils_mocks.js
+0
-53
spec/frontend/security_configuration/utils_spec.js
spec/frontend/security_configuration/utils_spec.js
+54
-10
No files found.
spec/frontend/security_configuration/utils_mocks.js
deleted
100644 → 0
View file @
82b6d9fd
export
const
mockSecurityFeatures
=
[
{
name
:
'
SAST
'
,
type
:
'
SAST
'
,
},
];
export
const
mockComplianceFeatures
=
[
{
name
:
'
LICENSE_COMPLIANCE
'
,
type
:
'
LICENSE_COMPLIANCE
'
,
},
];
export
const
mockFeaturesWithSecondary
=
[
{
name
:
'
DAST
'
,
type
:
'
DAST
'
,
secondary
:
{
type
:
'
DAST PROFILES
'
,
name
:
'
DAST PROFILES
'
,
},
},
];
export
const
mockInvalidCustomFeature
=
[
{
foo
:
'
bar
'
,
},
];
export
const
mockValidCustomFeature
=
[
{
name
:
'
SAST
'
,
type
:
'
SAST
'
,
customfield
:
'
customvalue
'
,
},
];
export
const
expectedOutputDefault
=
{
augmentedSecurityFeatures
:
mockSecurityFeatures
,
augmentedComplianceFeatures
:
mockComplianceFeatures
,
};
export
const
expectedOutputSecondary
=
{
augmentedSecurityFeatures
:
mockSecurityFeatures
,
augmentedComplianceFeatures
:
mockFeaturesWithSecondary
,
};
export
const
expectedOutputCustomFeature
=
{
augmentedSecurityFeatures
:
mockValidCustomFeature
,
augmentedComplianceFeatures
:
mockComplianceFeatures
,
};
spec/frontend/security_configuration/utils_spec.js
View file @
d451d002
import
{
augmentFeatures
}
from
'
~/security_configuration/utils
'
;
import
{
mockSecurityFeatures
,
mockComplianceFeatures
,
mockFeaturesWithSecondary
,
mockInvalidCustomFeature
,
mockValidCustomFeature
,
expectedOutputCustomFeature
,
expectedOutputDefault
,
expectedOutputSecondary
,
}
from
'
./utils_mocks
'
;
const
mockSecurityFeatures
=
[
{
name
:
'
SAST
'
,
type
:
'
SAST
'
,
},
];
const
mockComplianceFeatures
=
[
{
name
:
'
LICENSE_COMPLIANCE
'
,
type
:
'
LICENSE_COMPLIANCE
'
,
},
];
const
mockFeaturesWithSecondary
=
[
{
name
:
'
DAST
'
,
type
:
'
DAST
'
,
secondary
:
{
type
:
'
DAST PROFILES
'
,
name
:
'
DAST PROFILES
'
,
},
},
];
const
mockInvalidCustomFeature
=
[
{
foo
:
'
bar
'
,
},
];
const
mockValidCustomFeature
=
[
{
name
:
'
SAST
'
,
type
:
'
SAST
'
,
customfield
:
'
customvalue
'
,
},
];
const
expectedOutputDefault
=
{
augmentedSecurityFeatures
:
mockSecurityFeatures
,
augmentedComplianceFeatures
:
mockComplianceFeatures
,
};
const
expectedOutputSecondary
=
{
augmentedSecurityFeatures
:
mockSecurityFeatures
,
augmentedComplianceFeatures
:
mockFeaturesWithSecondary
,
};
const
expectedOutputCustomFeature
=
{
augmentedSecurityFeatures
:
mockValidCustomFeature
,
augmentedComplianceFeatures
:
mockComplianceFeatures
,
};
describe
(
'
augmentFeatures
'
,
()
=>
{
it
(
'
augments features array correctly when given an empty array
'
,
()
=>
{
...
...
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