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
d7123410
Commit
d7123410
authored
Feb 24, 2021
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken tests
parent
903a5fee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
ee/spec/frontend/vulnerabilities/vulnerability_state_dropdown_spec.js
...tend/vulnerabilities/vulnerability_state_dropdown_spec.js
+6
-2
No files found.
ee/spec/frontend/vulnerabilities/vulnerability_state_dropdown_spec.js
View file @
d7123410
import
{
GlDropdown
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
VulnerabilityStateDropdown
from
'
ee/vulnerabilities/components/vulnerability_state_dropdown.vue
'
;
import
{
VULNERABILITY_STATE_OBJECTS
}
from
'
ee/vulnerabilities/constants
'
;
...
...
@@ -11,6 +12,9 @@ describe('Vulnerability state dropdown component', () => {
// Create a dropdown that by default has the first vulnerability state selected.
wrapper
=
shallowMount
(
VulnerabilityStateDropdown
,
{
propsData
:
{
initialState
},
stubs
:
{
GlDropdown
,
},
});
// Mock out this function, it's called by some methods in the component.
...
...
@@ -136,13 +140,13 @@ describe('Vulnerability state dropdown component', () => {
});
});
it
(
'
when the parent component changes the state, the dropdown will update its selected and initial item
'
,
()
=>
{
it
(
'
when the parent component changes the state, the dropdown will update its selected and initial item
'
,
async
()
=>
{
const
[
stateString
,
stateObject
]
=
vulnerabilityStateEntries
[
1
];
wrapper
.
setProps
({
initialState
:
stateString
});
// Change the state.
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
innerDropdown
().
attribute
s
(
'
text
'
)).
toBe
(
stateString
);
// Check that the dropdown button's value matches the initial state.
expect
(
innerDropdown
().
prop
s
(
'
text
'
)).
toBe
(
stateString
);
// Check that the dropdown button's value matches the initial state.
expect
(
selectedItem
().
text
()).
toMatch
(
new
RegExp
(
`^
${
stateObject
.
action
}
`
,
'
i
'
));
// Check that the selected item is the initial state.
expect
(
isDisabled
(
saveButton
())).
toBe
(
true
);
// Check that the save button is disabled.
});
...
...
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