Fix showing HTML content in view file tooltip

This commit is contained in:
Fatih Acet 2019-04-16 00:28:20 +02:00
parent 8c10e99de2
commit a1179e5e60
No known key found for this signature in database
GPG Key ID: E994FE39E29B7E11
2 changed files with 4 additions and 3 deletions

View File

@ -112,9 +112,7 @@ export default {
const truncatedContentSha = _.escape(truncateSha(this.diffFile.content_sha));
return sprintf(
s__('MergeRequests|View file @ %{commitId}'),
{
commitId: `<span class="commit-sha">${truncatedContentSha}</span>`,
},
{ commitId: truncatedContentSha },
false,
);
},

View File

@ -611,6 +611,9 @@ describe('diff_file_header', () => {
vm = mountComponentWithStore(Component, { props, store });
expect(viewFileButton().getAttribute('href')).toBe('view-path');
expect(viewFileButton().getAttribute('data-original-title')).toEqual(
`View file @ ${props.diffFile.content_sha.substr(0, 8)}`,
);
});
it('should not render external url view link if diff file has no external url', () => {