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
c1deee21
Commit
c1deee21
authored
Feb 01, 2021
by
Dave Pisek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs: Shallow mount where possible
* Adds shallowMount factory * Uses it in places where possible
parent
704df448
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
ee/spec/frontend/security_dashboard/components/vulnerability_action_buttons_spec.js
...dashboard/components/vulnerability_action_buttons_spec.js
+11
-7
No files found.
ee/spec/frontend/security_dashboard/components/vulnerability_action_buttons_spec.js
View file @
c1deee21
import
{
createWrapper
,
mount
}
from
'
@vue/test-utils
'
;
import
{
createWrapper
,
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
VulnerabilityActionButtons
,
{
...
...
@@ -14,13 +14,17 @@ describe('Security Dashboard Action Buttons', () => {
let
store
;
let
wrapper
;
const
createComponent
=
({
...
options
})
=>
const
wrapperFactory
=
(
mountFn
)
=>
({
...
options
})
=>
extendedWrapper
(
mount
(
VulnerabilityActionButtons
,
{
mount
Fn
(
VulnerabilityActionButtons
,
{
...
options
,
store
,
}),
);
const
createShallowComponent
=
wrapperFactory
(
shallowMount
);
const
createFullComponent
=
wrapperFactory
(
mount
);
const
findAllButtons
=
()
=>
wrapper
.
findAllComponents
(
GlButton
);
const
findMoreInfoButton
=
()
=>
wrapper
.
findByTestId
(
'
more-info
'
);
const
findCreateIssueButton
=
()
=>
wrapper
.
findByTestId
(
'
create-issue
'
);
...
...
@@ -38,7 +42,7 @@ describe('Security Dashboard Action Buttons', () => {
describe
(
'
with a fresh vulnerability
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
wrapper
=
create
Full
Component
({
propsData
:
{
vulnerability
:
mockDataVulnerabilities
[
0
],
canCreateIssue
:
true
,
...
...
@@ -90,7 +94,7 @@ describe('Security Dashboard Action Buttons', () => {
describe
(
'
with Jira issues for vulnerabilities enabled
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
wrapper
=
create
Full
Component
({
propsData
:
{
vulnerability
:
mockDataVulnerabilities
[
8
],
canCreateIssue
:
true
,
...
...
@@ -140,7 +144,7 @@ describe('Security Dashboard Action Buttons', () => {
describe
(
'
with a vulnerability that has an issue
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
wrapper
=
create
Shallow
Component
({
propsData
:
{
vulnerability
:
mockDataVulnerabilities
[
3
],
},
...
...
@@ -158,7 +162,7 @@ describe('Security Dashboard Action Buttons', () => {
describe
(
'
with a vulnerability that has been dismissed
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
wrapper
=
create
Shallow
Component
({
propsData
:
{
vulnerability
:
mockDataVulnerabilities
[
2
],
canDismissVulnerability
:
true
,
...
...
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