Commit 06e75f0c authored by Kushal Pandya's avatar Kushal Pandya Committed by GitLab Release Tools Bot

Merge branch '60533-tooltip-for-view-file-shows-raw-html' into 'master'

Resolve "Tooltip for "View file" shows raw HTML"

Closes #60533

See merge request gitlab-org/gitlab-ce!27398

(cherry picked from commit be201c59)

a1179e5e Fix showing HTML content in view file tooltip
parent 0456c1a8
......@@ -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,
);
},
......
......@@ -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', () => {
......
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