Commit dac38419 authored by Tim Zallmann's avatar Tim Zallmann

Merge branch '55276-encoding-issue-with-the-user-centric-tooltips' into 'master'

Resolve "Encoding issue with the user centric tooltips"

Closes #55276

See merge request gitlab-org/gitlab-ce!23794
parents 5afbeaad 3c3701c9
...@@ -30,10 +30,14 @@ export default { ...@@ -30,10 +30,14 @@ export default {
computed: { computed: {
jobLine() { jobLine() {
if (this.user.bio && this.user.organization) { if (this.user.bio && this.user.organization) {
return sprintf(__('%{bio} at %{organization}'), { return sprintf(
__('%{bio} at %{organization}'),
{
bio: this.user.bio, bio: this.user.bio,
organization: this.user.organization, organization: this.user.organization,
}); },
false,
);
} else if (this.user.bio) { } else if (this.user.bio) {
return this.user.bio; return this.user.bio;
} else if (this.user.organization) { } else if (this.user.organization) {
......
...@@ -101,6 +101,19 @@ describe('User Popover Component', () => { ...@@ -101,6 +101,19 @@ describe('User Popover Component', () => {
expect(vm.$el.textContent).toContain('Engineer at GitLab'); expect(vm.$el.textContent).toContain('Engineer at GitLab');
}); });
it('should not encode special characters when we have bio and organization', () => {
const testProps = Object.assign({}, DEFAULT_PROPS);
testProps.user.bio = 'Manager & Team Lead';
testProps.user.organization = 'GitLab';
vm = mountComponent(UserPopover, {
...DEFAULT_PROPS,
target: document.querySelector('.js-user-link'),
});
expect(vm.$el.textContent).toContain('Manager & Team Lead at GitLab');
});
}); });
describe('status data', () => { describe('status data', () => {
......
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