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
This commit is contained in:
Tim Zallmann 2018-12-17 10:24:14 +00:00
commit dac38419fe
2 changed files with 21 additions and 4 deletions

View File

@ -30,10 +30,14 @@ export default {
computed: {
jobLine() {
if (this.user.bio && this.user.organization) {
return sprintf(__('%{bio} at %{organization}'), {
bio: this.user.bio,
organization: this.user.organization,
});
return sprintf(
__('%{bio} at %{organization}'),
{
bio: this.user.bio,
organization: this.user.organization,
},
false,
);
} else if (this.user.bio) {
return this.user.bio;
} else if (this.user.organization) {

View File

@ -101,6 +101,19 @@ describe('User Popover Component', () => {
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', () => {