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
f50cb38a
Commit
f50cb38a
authored
May 18, 2021
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fallback to toString method instead of computing the value
parent
3def11a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/value.vue
...vulnerabilities/components/generic_report/types/value.vue
+1
-10
ee/spec/frontend/vulnerabilities/generic_report/types/value_spec.js
...ontend/vulnerabilities/generic_report/types/value_spec.js
+8
-8
No files found.
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/value.vue
View file @
f50cb38a
...
...
@@ -7,17 +7,8 @@ export default {
required
:
true
,
},
},
computed
:
{
printValue
()
{
if
(
typeof
this
.
value
===
'
boolean
'
)
{
return
this
.
value
?
'
true
'
:
'
false
'
;
}
return
this
.
value
;
},
},
};
</
script
>
<
template
>
<span>
{{
printV
alue
}}
</span>
<span>
{{
v
alue
}}
</span>
</
template
>
ee/spec/frontend/vulnerabilities/generic_report/types/value_spec.js
View file @
f50cb38a
...
...
@@ -5,12 +5,12 @@ describe('ee/vulnerabilities/components/generic_report/types/value.vue', () => {
let
wrapper
;
describe
.
each
`
field type | value
| printValue
${
'
string
'
}
|
${
'
some string
'
}
|
${
'
some string
'
}
${
'
number
'
}
|
${
8
}
|
${
'
8
'
}
${
'
boolean
'
}
|
${
true
}
|
${
'
true
'
}
${
'
boolean
'
}
|
${
false
}
|
${
'
false
'
}
`
(
'
with value of type "$fieldType"
'
,
({
fieldType
,
value
,
printValue
})
=>
{
field type | value
${
'
string
'
}
|
${
'
some string
'
}
${
'
number
'
}
|
${
8
}
${
'
boolean
'
}
|
${
true
}
${
'
boolean
'
}
|
${
false
}
`
(
'
with value of type "$fieldType"
'
,
({
fieldType
,
value
})
=>
{
const
createWrapper
=
()
=>
{
return
shallowMount
(
Text
,
{
propsData
:
{
...
...
@@ -29,8 +29,8 @@ describe('ee/vulnerabilities/components/generic_report/types/value.vue', () => {
wrapper
.
destroy
();
});
it
(
`renders
"
${
printValue
}
"
`
,
()
=>
{
expect
(
wrapper
.
text
()).
toBe
(
printValue
);
it
(
`renders
${
fieldType
}
type
`
,
()
=>
{
expect
(
wrapper
.
text
()).
toBe
(
value
.
toString
()
);
});
});
});
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