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
3aae4611
Commit
3aae4611
authored
Dec 13, 2021
by
Phil Hughes
Committed by
Natalia Tepluhina
Dec 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed placeholder note avatar size
parent
cf22999b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
app/assets/javascripts/vue_shared/components/notes/placeholder_note.vue
...ascripts/vue_shared/components/notes/placeholder_note.vue
+8
-2
spec/frontend/vue_shared/components/notes/placeholder_note_spec.js
...tend/vue_shared/components/notes/placeholder_note_spec.js
+16
-1
No files found.
app/assets/javascripts/vue_shared/components/notes/placeholder_note.vue
View file @
3aae4611
...
...
@@ -39,6 +39,11 @@ export default {
required
:
false
,
default
:
null
,
},
isOverviewTab
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
computed
:
{
...
mapGetters
([
'
getUserData
'
]),
...
...
@@ -46,9 +51,10 @@ export default {
return
renderMarkdown
(
this
.
note
.
body
);
},
avatarSize
()
{
if
(
this
.
line
)
{
return
16
;
if
(
this
.
line
&&
!
this
.
isOverviewTab
)
{
return
24
;
}
return
40
;
},
},
...
...
spec/frontend/vue_shared/components/notes/placeholder_note_spec.js
View file @
3aae4611
...
...
@@ -2,6 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
IssuePlaceholderNote
from
'
~/vue_shared/components/notes/placeholder_note.vue
'
;
import
UserAvatarLink
from
'
~/vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
{
userDataMock
}
from
'
../../../notes/mock_data
'
;
Vue
.
use
(
Vuex
);
...
...
@@ -15,7 +16,7 @@ describe('Issue placeholder note component', () => {
const
findNote
=
()
=>
wrapper
.
find
({
ref
:
'
note
'
});
const
createComponent
=
(
isIndividual
=
false
)
=>
{
const
createComponent
=
(
isIndividual
=
false
,
propsData
=
{}
)
=>
{
wrapper
=
shallowMount
(
IssuePlaceholderNote
,
{
store
:
new
Vuex
.
Store
({
getters
,
...
...
@@ -25,6 +26,7 @@ describe('Issue placeholder note component', () => {
body
:
'
Foo
'
,
individual_note
:
isIndividual
,
},
...
propsData
,
},
});
};
...
...
@@ -51,4 +53,17 @@ describe('Issue placeholder note component', () => {
expect
(
findNote
().
classes
()).
toContain
(
'
discussion
'
);
});
describe
(
'
avatar size
'
,
()
=>
{
it
.
each
`
size | line | isOverviewTab
${
40
}
|
${
null
}
|
${
false
}
${
24
}
|
${{
line_code
:
'
123
'
}
} |
${
false
}
${
40
}
|
${{
line_code
:
'
123
'
}
} |
${
true
}
`
(
'
renders avatar $size for $line and $isOverviewTab
'
,
({
size
,
line
,
isOverviewTab
})
=>
{
createComponent
(
false
,
{
line
,
isOverviewTab
});
expect
(
wrapper
.
findComponent
(
UserAvatarLink
).
props
(
'
imgSize
'
)).
toBe
(
size
);
});
});
});
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