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
cd341b33
Commit
cd341b33
authored
Aug 22, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update header_spec and header.vue
parent
d17168fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
ee/app/assets/javascripts/vulnerabilities/components/header.vue
.../assets/javascripts/vulnerabilities/components/header.vue
+10
-1
ee/spec/frontend/vulnerabilities/header_spec.js
ee/spec/frontend/vulnerabilities/header_spec.js
+13
-2
No files found.
ee/app/assets/javascripts/vulnerabilities/components/header.vue
View file @
cd341b33
...
@@ -136,7 +136,7 @@ export default {
...
@@ -136,7 +136,7 @@ export default {
})
})
.
finally
(()
=>
{
.
finally
(()
=>
{
this
.
isLoadingVulnerability
=
false
;
this
.
isLoadingVulnerability
=
false
;
this
.
$emit
(
'
vulnerability-state-change
'
);
this
.
$emit
(
'
vulnerability-state-change
'
,
newState
);
});
});
},
},
createMergeRequest
()
{
createMergeRequest
()
{
...
@@ -209,6 +209,15 @@ export default {
...
@@ -209,6 +209,15 @@ export default {
});
});
},
},
},
},
created
()
{
this
.
$on
(
'
vulnerability-state-change
'
,
newState
=>
{
// Indicates that the event emitter does not know the new state
if
(
!
newState
)
{
this
.
refreshVulnerability
();
}
});
},
};
};
</
script
>
</
script
>
...
...
ee/spec/frontend/vulnerabilities/header_spec.js
View file @
cd341b33
...
@@ -9,7 +9,6 @@ import StatusDescription from 'ee/vulnerabilities/components/status_description.
...
@@ -9,7 +9,6 @@ import StatusDescription from 'ee/vulnerabilities/components/status_description.
import
ResolutionAlert
from
'
ee/vulnerabilities/components/resolution_alert.vue
'
;
import
ResolutionAlert
from
'
ee/vulnerabilities/components/resolution_alert.vue
'
;
import
SplitButton
from
'
ee/vue_shared/security_reports/components/split_button.vue
'
;
import
SplitButton
from
'
ee/vue_shared/security_reports/components/split_button.vue
'
;
import
VulnerabilityStateDropdown
from
'
ee/vulnerabilities/components/vulnerability_state_dropdown.vue
'
;
import
VulnerabilityStateDropdown
from
'
ee/vulnerabilities/components/vulnerability_state_dropdown.vue
'
;
import
VulnerabilitiesEventBus
from
'
ee/vulnerabilities/components/vulnerabilities_event_bus
'
;
import
{
FEEDBACK_TYPES
,
VULNERABILITY_STATE_OBJECTS
}
from
'
ee/vulnerabilities/constants
'
;
import
{
FEEDBACK_TYPES
,
VULNERABILITY_STATE_OBJECTS
}
from
'
ee/vulnerabilities/constants
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
*
as
urlUtility
from
'
~/lib/utils/url_utility
'
;
import
*
as
urlUtility
from
'
~/lib/utils/url_utility
'
;
...
@@ -139,7 +138,19 @@ describe('Vulnerability Header', () => {
...
@@ -139,7 +138,19 @@ describe('Vulnerability Header', () => {
const
dropdown
=
wrapper
.
find
(
VulnerabilityStateDropdown
);
const
dropdown
=
wrapper
.
find
(
VulnerabilityStateDropdown
);
mockAxios
.
onPost
().
reply
(
400
);
mockAxios
.
onPost
().
reply
(
400
);
dropdown
.
vm
.
$emit
(
'
change
'
);
dropdown
.
vm
.
$emit
(
'
change
'
,
'
dismissed
'
);
return
waitForPromises
().
then
(()
=>
{
expect
(
mockAxios
.
history
.
post
).
toHaveLength
(
1
);
expect
(
createFlash
).
toHaveBeenCalledTimes
(
1
);
});
});
it
(
'
when the vulnerability state changes but the change is undefined, an error message is displayed
'
,
()
=>
{
const
dropdown
=
wrapper
.
find
(
VulnerabilityStateDropdown
);
mockAxios
.
onPost
().
reply
(
200
);
dropdown
.
vm
.
$emit
(
'
change
'
,
undefined
);
return
waitForPromises
().
then
(()
=>
{
return
waitForPromises
().
then
(()
=>
{
expect
(
mockAxios
.
history
.
post
).
toHaveLength
(
1
);
expect
(
mockAxios
.
history
.
post
).
toHaveLength
(
1
);
...
...
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