Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-11 12:06:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-11 12:06:38 +0300
commit4a45f0eff2a25c64bdd83926e35a8894a4f0469f (patch)
tree8068fff1731ccf4182605c2661c25f0a1c936866 /spec/javascripts/blob
parentd9c3a63a4394990bcdccbaca73c58278469236b4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts/blob')
-rw-r--r--spec/javascripts/blob/viewer/index_spec.js25
1 files changed, 4 insertions, 21 deletions
diff --git a/spec/javascripts/blob/viewer/index_spec.js b/spec/javascripts/blob/viewer/index_spec.js
index 766c3378584..bbc59632f3c 100644
--- a/spec/javascripts/blob/viewer/index_spec.js
+++ b/spec/javascripts/blob/viewer/index_spec.js
@@ -176,36 +176,19 @@ describe('Blob viewer', () => {
});
});
- describe('linkifyURLs', () => {
- it('renders a plain url as a link in simple view', done => {
+ describe('a URL inside the blob content', () => {
+ beforeEach(() => {
mock.onGet('http://test.host/snippets/1.json?viewer=simple').reply(200, {
html:
'<div class="js-blob-content"><pre class="code"><code><span class="line" lang="yaml"><span class="c1">To install gitlab-shell you also need a Go compiler version 1.8 or newer. https://golang.org/dl/</span></span></code></pre></div>',
});
-
- asyncClick()
- .then(() => {
- expect(document.querySelector('.blob-viewer[data-type="simple"]').innerHTML).toContain(
- '<a href="https://golang.org/dl/">https://golang.org/dl/</a>',
- );
- done();
- })
- .catch(() => {
- fail();
- done();
- });
});
- it('leaves an unescaped url untouched', done => {
- mock.onGet('http://test.host/snippets/1.json?viewer=simple').reply(200, {
- html:
- '<div class="js-blob-content"><pre class="code"><code><span class="line" lang="yaml"><a href="https://golang.org/dl/">golang</a></span></span></code></pre></div>',
- });
-
+ it('is rendered as a link in simple view', done => {
asyncClick()
.then(() => {
expect(document.querySelector('.blob-viewer[data-type="simple"]').innerHTML).toContain(
- '<a href="https://golang.org/dl/">golang</a>',
+ '<a href="https://golang.org/dl/">https://golang.org/dl/</a>',
);
done();
})