Commit e21ce4bc authored by David O'Regan's avatar David O'Regan Committed by Kushal Pandya

Fix(MVC) Assignee(s) avatar dissapear when opening issue sidebar in board

parent 7b1d23ab
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
:key="assignee.id" :key="assignee.id"
:link-href="assigneeUrl(assignee)" :link-href="assigneeUrl(assignee)"
:img-alt="avatarUrlTitle(assignee)" :img-alt="avatarUrlTitle(assignee)"
:img-src="assignee.avatar" :img-src="assignee.avatar || assignee.avatar_url"
:img-size="24" :img-size="24"
class="js-no-trigger" class="js-no-trigger"
tooltip-placement="bottom" tooltip-placement="bottom"
......
---
title: MVC for assignees avatar dissapearing when opening issue sidebar in board
merge_request:
author: Oregand
type: fixed
...@@ -97,6 +97,9 @@ describe('Issue card component', () => { ...@@ -97,6 +97,9 @@ describe('Issue card component', () => {
issue: { issue: {
...wrapper.props('issue'), ...wrapper.props('issue'),
assignees: [user], assignees: [user],
updateData(newData) {
Object.assign(this, newData);
},
}, },
}); });
...@@ -118,6 +121,28 @@ describe('Issue card component', () => { ...@@ -118,6 +121,28 @@ describe('Issue card component', () => {
it('renders avatar', () => { it('renders avatar', () => {
expect(wrapper.find('.board-card-assignee img').exists()).toBe(true); expect(wrapper.find('.board-card-assignee img').exists()).toBe(true);
}); });
it('renders the avatar using avatar_url property', done => {
wrapper.props('issue').updateData({
...wrapper.props('issue'),
assignees: [
{
id: '1',
name: 'test',
state: 'active',
username: 'test_name',
avatar_url: 'test_image_from_avatar_url',
},
],
});
wrapper.vm.$nextTick(() => {
expect(wrapper.find('.board-card-assignee img').attributes('src')).toBe(
'test_image_from_avatar_url?width=24',
);
done();
});
});
}); });
describe('assignee default avatar', () => { describe('assignee default avatar', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment