Commit d0f22537 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'tor/feature/reviewer-full-names' into 'master'

Add Reviewer name to sidebar Reviewers list

See merge request gitlab-org/gitlab!72244
parents 6e9dfb6a 925c1246
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
> >
<!-- use d-flex so that slot can be appropriately styled --> <!-- use d-flex so that slot can be appropriately styled -->
<span class="gl-display-flex gl-align-items-center"> <span class="gl-display-flex gl-align-items-center">
<reviewer-avatar :user="user" :img-size="24" :issuable-type="issuableType" /> <reviewer-avatar :user="user" :img-size="32" :issuable-type="issuableType" />
<slot :user="user"></slot> <slot :user="user"></slot>
</span> </span>
</gl-link> </gl-link>
......
...@@ -91,7 +91,10 @@ export default { ...@@ -91,7 +91,10 @@ export default {
data-testid="reviewer" data-testid="reviewer"
> >
<reviewer-avatar-link :user="user" :root-path="rootPath" :issuable-type="issuableType"> <reviewer-avatar-link :user="user" :root-path="rootPath" :issuable-type="issuableType">
<div class="gl-ml-3">@{{ user.username }}</div> <div class="gl-ml-3 gl-line-height-normal gl-display-grid">
<span>{{ user.name }}</span>
<span>@{{ user.username }}</span>
</div>
</reviewer-avatar-link> </reviewer-avatar-link>
<gl-icon <gl-icon
v-if="user.approved" v-if="user.approved"
......
...@@ -26,9 +26,9 @@ describe('UncollapsedReviewerList component', () => { ...@@ -26,9 +26,9 @@ describe('UncollapsedReviewerList component', () => {
}); });
describe('single reviewer', () => { describe('single reviewer', () => {
beforeEach(() => { const user = userDataMock();
const user = userDataMock();
beforeEach(() => {
createComponent({ createComponent({
users: [user], users: [user],
}); });
...@@ -39,6 +39,7 @@ describe('UncollapsedReviewerList component', () => { ...@@ -39,6 +39,7 @@ describe('UncollapsedReviewerList component', () => {
}); });
it('shows one user with avatar, username and author name', () => { it('shows one user with avatar, username and author name', () => {
expect(wrapper.text()).toContain(user.name);
expect(wrapper.text()).toContain(`@root`); expect(wrapper.text()).toContain(`@root`);
}); });
...@@ -56,11 +57,18 @@ describe('UncollapsedReviewerList component', () => { ...@@ -56,11 +57,18 @@ describe('UncollapsedReviewerList component', () => {
}); });
describe('multiple reviewers', () => { describe('multiple reviewers', () => {
beforeEach(() => { const user = userDataMock();
const user = userDataMock(); const user2 = {
...user,
id: 2,
name: 'nonrooty-nonrootersen',
username: 'hello-world',
approved: true,
};
beforeEach(() => {
createComponent({ createComponent({
users: [user, { ...user, id: 2, username: 'hello-world', approved: true }], users: [user, user2],
}); });
}); });
...@@ -69,7 +77,9 @@ describe('UncollapsedReviewerList component', () => { ...@@ -69,7 +77,9 @@ describe('UncollapsedReviewerList component', () => {
}); });
it('shows both users with avatar, username and author name', () => { it('shows both users with avatar, username and author name', () => {
expect(wrapper.text()).toContain(user.name);
expect(wrapper.text()).toContain(`@root`); expect(wrapper.text()).toContain(`@root`);
expect(wrapper.text()).toContain(user2.name);
expect(wrapper.text()).toContain(`@hello-world`); expect(wrapper.text()).toContain(`@hello-world`);
}); });
......
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