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
53a9e843
Commit
53a9e843
authored
Apr 04, 2022
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to use name field instead of externalId
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/357727
parent
1ad684ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_training.vue
...pts/vulnerabilities/components/vulnerability_training.vue
+2
-2
ee/spec/frontend/vulnerabilities/vulnerability_training_spec.js
...c/frontend/vulnerabilities/vulnerability_training_spec.js
+27
-1
No files found.
ee/app/assets/javascripts/vulnerabilities/components/vulnerability_training.vue
View file @
53a9e843
...
...
@@ -113,8 +113,8 @@ export default {
return
this
.
securityTrainingProviders
?.
some
(({
isEnabled
})
=>
isEnabled
);
},
supportedIdentifiersExternalIds
()
{
return
this
.
identifiers
.
flatMap
(({
externalType
,
externalId
})
=>
externalType
?.
toLowerCase
()
===
SUPPORTED_IDENTIFIER_TYPES
.
cwe
?
externalId
:
[],
return
this
.
identifiers
.
flatMap
(({
externalType
,
name
})
=>
externalType
?.
toLowerCase
()
===
SUPPORTED_IDENTIFIER_TYPES
.
cwe
?
name
:
[],
);
},
hasSupportedIdentifier
()
{
...
...
ee/spec/frontend/vulnerabilities/vulnerability_training_spec.js
View file @
53a9e843
...
...
@@ -158,7 +158,7 @@ describe('VulnerabilityTraining component', () => {
${
'
non-supported-identifier
'
}
|
${
true
}
`
(
'
sets it to "$exists" for "$identifier"
'
,
async
({
identifier
,
exists
})
=>
{
createApolloProvider
();
createComponent
({
identifiers
:
[{
externalType
:
identifier
,
externalId
:
'
cwe-1
'
}]
});
createComponent
({
identifiers
:
[{
externalType
:
identifier
,
name
:
'
cwe-1
'
}]
});
await
waitForQueryToBeLoaded
();
expect
(
findUnavailableMessage
().
exists
()).
toBe
(
exists
);
});
...
...
@@ -262,6 +262,32 @@ describe('VulnerabilityTraining component', () => {
expect
(
findTrainingItemLinkIcons
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
security training query
'
,
()
=>
{
it
(
'
is called with the correct variables
'
,
async
()
=>
{
const
projectQueryHandler
=
jest
.
fn
().
mockResolvedValue
(
TEST_TRAINING_URLS_EMPTY
.
response
);
const
identifiers
=
[
{
externalType
:
SUPPORTED_IDENTIFIER_TYPES
.
cwe
,
externalId
:
'
some external id
'
,
name
:
'
cwe-1
'
,
},
];
createApolloProvider
({
projectQueryHandler
});
createComponent
({
identifiers
});
await
waitForQueryToBeLoaded
();
expect
(
projectQueryHandler
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
identifierExternalIds
:
[
identifiers
[
0
].
name
],
projectFullPath
,
}),
);
});
});
});
describe
(
'
with the query resulting in an error
'
,
()
=>
{
...
...
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