Skip to content

Commit 83a4d35

Browse files
committed
test: update links markup, changed in #1522
1 parent 2154d64 commit 83a4d35

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

test/core/test/link.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('Link', function() {
2323

2424
assert.strictEqual(
2525
data,
26-
'<p>set a <a href="http://test.com" target="_blank">selection</a> and then convert it to a link.</p>'
26+
'<p>set a <a href="http://test.com" rel="noopener noreferrer" target="_blank">selection</a> and then convert it to a link.</p>'
2727
);
2828
});
2929

@@ -46,7 +46,7 @@ describe('Link', function() {
4646

4747
assert.strictEqual(
4848
data,
49-
'<p>set a <a href="http://test.com" target="_blank">http://test.com</a> and then convert it to a link.</p>'
49+
'<p>set a <a href="http://test.com" rel="noopener noreferrer" target="_blank">http://test.com</a> and then convert it to a link.</p>'
5050
);
5151
});
5252

@@ -69,7 +69,7 @@ describe('Link', function() {
6969

7070
assert.strictEqual(
7171
data,
72-
'<p>set a <a href="http://test.com" target="_blank">selection</a> and then convert it to a link.</p>'
72+
'<p>set a <a href="http://test.com" rel="noopener noreferrer" target="_blank">selection</a> and then convert it to a link.</p>'
7373
);
7474
});
7575

@@ -92,7 +92,7 @@ describe('Link', function() {
9292

9393
assert.strictEqual(
9494
data,
95-
'<p>set a <a href="//test.com" target="_blank">selection</a> and then convert it to a link.</p>'
95+
'<p>set a <a href="//test.com" rel="noopener noreferrer" target="_blank">selection</a> and then convert it to a link.</p>'
9696
);
9797
});
9898

@@ -115,7 +115,7 @@ describe('Link', function() {
115115

116116
assert.strictEqual(
117117
data,
118-
'<p>set a <a href="#bookmark" target="_blank">selection</a> and then convert it to a link.</p>'
118+
'<p>set a <a href="#bookmark" rel="noopener noreferrer" target="_blank">selection</a> and then convert it to a link.</p>'
119119
);
120120
});
121121

@@ -138,7 +138,7 @@ describe('Link', function() {
138138

139139
assert.strictEqual(
140140
data,
141-
'<p>set a <a href="mailto:test@example.com" target="_self">selection</a> and then convert it to a link.</p>'
141+
'<p>set a <a href="mailto:test@example.com" rel="noopener noreferrer" target="_self">selection</a> and then convert it to a link.</p>'
142142
);
143143
});
144144

@@ -161,7 +161,7 @@ describe('Link', function() {
161161

162162
assert.strictEqual(
163163
data,
164-
'<p>set a <a href="mailto:test@example.com" target="_self">selection</a> and then convert it to a link.</p>'
164+
'<p>set a <a href="mailto:test@example.com" rel="noopener noreferrer" target="_self">selection</a> and then convert it to a link.</p>'
165165
);
166166
});
167167

@@ -184,7 +184,7 @@ describe('Link', function() {
184184

185185
assert.strictEqual(
186186
data,
187-
'<p>set a <a href="http://medium.com/@whoever/something-else" target="_blank">selection</a> and then convert it to a link.</p>'
187+
'<p>set a <a href="http://medium.com/@whoever/something-else" rel="noopener noreferrer" target="_blank">selection</a> and then convert it to a link.</p>'
188188
);
189189
});
190190

@@ -193,7 +193,7 @@ describe('Link', function() {
193193

194194
bender.tools.selection.setWithHtml(
195195
this.nativeEditor,
196-
'<p>get a link from {<a target="_blank" href="http://test.com">selection</a>}.</p>'
196+
'<p>get a link from {<a rel="noopener noreferrer" target="_blank" href="http://test.com">selection</a>}.</p>'
197197
);
198198

199199
var linkEl = link.getFromSelection();
@@ -208,7 +208,7 @@ describe('Link', function() {
208208

209209
bender.tools.selection.setWithHtml(
210210
this.nativeEditor,
211-
'<p>get a link from <a href="http://test.com" target="_blank">se{lect}ion</a>.</p>'
211+
'<p>get a link from <a href="http://test.com" rel="noopener noreferrer" target="_blank">se{lect}ion</a>.</p>'
212212
);
213213

214214
var linkEl = link.getFromSelection();
@@ -236,7 +236,7 @@ describe('Link', function() {
236236

237237
bender.tools.selection.setWithHtml(
238238
this.nativeEditor,
239-
'<p>remove a link from a {<a href="http://test.com" target="_blank">selection</a>}.</p>'
239+
'<p>remove a link from a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">selection</a>}.</p>'
240240
);
241241

242242
var linkEl = link.getFromSelection();
@@ -257,7 +257,7 @@ describe('Link', function() {
257257

258258
bender.tools.selection.setWithHtml(
259259
this.nativeEditor,
260-
'<p>remove a link from a {<a href="http://test.com" target="_blank">selection</a>}.</p>'
260+
'<p>remove a link from a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">selection</a>}.</p>'
261261
);
262262

263263
link.remove();
@@ -275,7 +275,7 @@ describe('Link', function() {
275275

276276
bender.tools.selection.setWithHtml(
277277
this.nativeEditor,
278-
'<p>update the URL of a {<a href="http://test.com" target="_blank">link</a>}.</p>'
278+
'<p>update the URL of a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">link</a>}.</p>'
279279
);
280280

281281
var linkEl = link.getFromSelection();
@@ -290,7 +290,7 @@ describe('Link', function() {
290290

291291
assert.strictEqual(
292292
data,
293-
'<p>update the url of a <a href="http://new.com" target="_blank">link</a>.</p>'
293+
'<p>update the url of a <a href="http://new.com" rel="noopener noreferrer" target="_blank">link</a>.</p>'
294294
);
295295
});
296296

@@ -299,7 +299,7 @@ describe('Link', function() {
299299

300300
bender.tools.selection.setWithHtml(
301301
this.nativeEditor,
302-
'<p>update the url of a {<a href="http://test.com" target="_blank">link</a>}.</p>'
302+
'<p>update the url of a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">link</a>}.</p>'
303303
);
304304

305305
link.update('http://new.com');
@@ -311,7 +311,7 @@ describe('Link', function() {
311311

312312
assert.strictEqual(
313313
data,
314-
'<p>update the url of a <a href="http://new.com" target="_blank">link</a>.</p>'
314+
'<p>update the url of a <a href="http://new.com" rel="noopener noreferrer" target="_blank">link</a>.</p>'
315315
);
316316
});
317317

@@ -320,7 +320,7 @@ describe('Link', function() {
320320

321321
bender.tools.selection.setWithHtml(
322322
this.nativeEditor,
323-
'<p>update the URL of a {<a href="http://test.com" target="_blank">link</a>}.</p>'
323+
'<p>update the URL of a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">link</a>}.</p>'
324324
);
325325

326326
var linkEl = link.getFromSelection();
@@ -341,7 +341,7 @@ describe('Link', function() {
341341

342342
assert.strictEqual(
343343
data,
344-
'<p>update the url of a <a href="http://new.com" target="_self">link</a>.</p>'
344+
'<p>update the url of a <a href="http://new.com" rel="noopener noreferrer" target="_self">link</a>.</p>'
345345
);
346346
});
347347

@@ -350,7 +350,7 @@ describe('Link', function() {
350350

351351
bender.tools.selection.setWithHtml(
352352
this.nativeEditor,
353-
'<p>update the URL of a {<a href="http://test.com" target="_blank">link</a>}.</p>'
353+
'<p>update the URL of a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">link</a>}.</p>'
354354
);
355355

356356
link.update({
@@ -365,7 +365,7 @@ describe('Link', function() {
365365

366366
assert.strictEqual(
367367
data,
368-
'<p>update the url of a <a href="http://new.com" target="_self">link</a>.</p>'
368+
'<p>update the url of a <a href="http://new.com" rel="noopener noreferrer" target="_self">link</a>.</p>'
369369
);
370370
});
371371

@@ -430,7 +430,7 @@ describe('Link', function() {
430430

431431
bender.tools.selection.setWithHtml(
432432
this.nativeEditor,
433-
'<p>update the URL of a {<a href="http://test.com" target="_blank">link</a>}.</p>'
433+
'<p>update the URL of a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">link</a>}.</p>'
434434
);
435435

436436
var linkEl = link.getFromSelection();
@@ -445,7 +445,7 @@ describe('Link', function() {
445445

446446
assert.strictEqual(
447447
data,
448-
'<p>update the url of a <a href="http://new.com" target="_blank">link</a>.</p>'
448+
'<p>update the url of a <a href="http://new.com" rel="noopener noreferrer" target="_blank">link</a>.</p>'
449449
);
450450
});
451451

@@ -547,7 +547,7 @@ describe('Link', function() {
547547

548548
assert.strictEqual(
549549
data,
550-
'<p>create the url of a <a href="new.com">selection</a>.</p>'
550+
'<p>create the url of a <a href="new.com" rel="noopener noreferrer">selection</a>.</p>'
551551
);
552552
});
553553

@@ -558,7 +558,7 @@ describe('Link', function() {
558558

559559
bender.tools.selection.setWithHtml(
560560
this.nativeEditor,
561-
'<p>update the URL of a {<a href="http://test.com" target="_blank">link</a>}.</p>'
561+
'<p>update the URL of a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">link</a>}.</p>'
562562
);
563563

564564
var linkEl = link.getFromSelection();
@@ -573,7 +573,7 @@ describe('Link', function() {
573573

574574
assert.strictEqual(
575575
data,
576-
'<p>update the url of a <a href="new.com" target="_blank">link</a>.</p>'
576+
'<p>update the url of a <a href="new.com" rel="noopener noreferrer" target="_blank">link</a>.</p>'
577577
);
578578
});
579579

@@ -584,7 +584,7 @@ describe('Link', function() {
584584

585585
bender.tools.selection.setWithHtml(
586586
this.nativeEditor,
587-
'<p>update the url of a {<a href="http://test.com" target="_blank">link</a>}.</p>'
587+
'<p>update the url of a {<a href="http://test.com" rel="noopener noreferrer" target="_blank">link</a>}.</p>'
588588
);
589589

590590
var linkEl = link.getFromSelection();
@@ -603,7 +603,7 @@ describe('Link', function() {
603603

604604
assert.strictEqual(
605605
data,
606-
'<p>update the url of a <a href="test.com" target="_blank">link</a>.</p>'
606+
'<p>update the url of a <a href="test.com" rel="noopener noreferrer" target="_blank">link</a>.</p>'
607607
);
608608
});
609609
});

test/plugins/test/autolink.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ describe('AutoLink', function() {
2222
it('should create a link when pressing SPACE', function() {
2323
testLink.call(this, {
2424
expected:
25-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a></p>',
25+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a></p>',
2626
html: '<p>link www.liferay.com { }</p>',
2727
keyCode: KEY_SPACE,
2828
});
2929

3030
testLink.call(this, {
3131
expected:
32-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a> text</p>',
32+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a> text</p>',
3333
html: '<p>link www.liferay.com { }text</p>',
3434
keyCode: KEY_SPACE,
3535
});
@@ -38,14 +38,14 @@ describe('AutoLink', function() {
3838
it('should create a link when pressing COMMA', function() {
3939
testLink.call(this, {
4040
expected:
41-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a></p>',
41+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a></p>',
4242
html: '<p>link www.liferay.com { }</p>',
4343
keyCode: KEY_COMMA,
4444
});
4545

4646
testLink.call(this, {
4747
expected:
48-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a> text</p>',
48+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a> text</p>',
4949
html: '<p>link www.liferay.com { }text</p>',
5050
keyCode: KEY_COMMA,
5151
});
@@ -54,14 +54,14 @@ describe('AutoLink', function() {
5454
it('should create a link when pressing SEMICOLON', function() {
5555
testLink.call(this, {
5656
expected:
57-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a></p>',
57+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a></p>',
5858
html: '<p>link www.liferay.com { }</p>',
5959
keyCode: KEY_SEMICOLON,
6060
});
6161

6262
testLink.call(this, {
6363
expected:
64-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a> text</p>',
64+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a> text</p>',
6565
html: '<p>link www.liferay.com { }text</p>',
6666
keyCode: KEY_SEMICOLON,
6767
});
@@ -71,11 +71,11 @@ describe('AutoLink', function() {
7171
// FIXME: Is there a way to force CKEDITOR to generate consistent markup in case of pressing ENTER?
7272
// Bender does not fix the generated markup neither.
7373
var expected =
74-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a></p><p>text</p>';
74+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a></p><p>text</p>';
7575

7676
if (CKEDITOR.env.ie && CKEDITOR.env.version < 11) {
7777
expected =
78-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a><br />&nbsp;</p><p>text</p>';
78+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a><br />&nbsp;</p><p>text</p>';
7979
}
8080

8181
testLink.call(this, {
@@ -110,63 +110,63 @@ describe('AutoLink', function() {
110110
it('creates a link when the last word is a URL', function() {
111111
testLink.call(this, {
112112
expected:
113-
'<p>link <a href="http://liferay.com">liferay.com</a></p>',
113+
'<p>link <a href="http://liferay.com" rel="noopener noreferrer">liferay.com</a></p>',
114114
html: '<p>link liferay.com { }</p>',
115115
keyCode: KEY_COMMA,
116116
});
117117

118118
testLink.call(this, {
119119
expected:
120-
'<p>link <a href="http://ww.liferay.com">ww.liferay.com</a></p><p>text</p>',
120+
'<p>link <a href="http://ww.liferay.com" rel="noopener noreferrer">ww.liferay.com</a></p><p>text</p>',
121121
html: '<p>link ww.liferay.com</p>{ }<p>text</p>',
122122
keyCode: KEY_ENTER,
123123
});
124124

125125
testLink.call(this, {
126126
expected:
127-
'<p>link <a href="http://www.liferay.org">www.liferay.org</a></p>',
127+
'<p>link <a href="http://www.liferay.org" rel="noopener noreferrer">www.liferay.org</a></p>',
128128
html: '<p>link www.liferay.org { }</p>',
129129
keyCode: KEY_SPACE,
130130
});
131131

132132
testLink.call(this, {
133133
expected:
134-
'<p>link <a href="http://www.liferay.com">http://www.liferay.com</a></p>',
134+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">http://www.liferay.com</a></p>',
135135
html: '<p>link http://www.liferay.com { }</p>',
136136
keyCode: KEY_SPACE,
137137
});
138138

139139
testLink.call(this, {
140140
expected:
141-
'<p>link <a href="http://liferay.com">http://liferay.com</a></p>',
141+
'<p>link <a href="http://liferay.com" rel="noopener noreferrer">http://liferay.com</a></p>',
142142
html: '<p>link http://liferay.com { }</p>',
143143
keyCode: KEY_SPACE,
144144
});
145145

146146
testLink.call(this, {
147147
expected:
148-
'<p>link <a href="https://www.liferay.com">https://www.liferay.com</a></p>',
148+
'<p>link <a href="https://www.liferay.com" rel="noopener noreferrer">https://www.liferay.com</a></p>',
149149
html: '<p>link https://www.liferay.com { }</p>',
150150
keyCode: KEY_SPACE,
151151
});
152152

153153
testLink.call(this, {
154154
expected:
155-
'<p>link <a href="http://www.alloy-editor.com">http://www.alloy-editor.com</a></p>',
155+
'<p>link <a href="http://www.alloy-editor.com" rel="noopener noreferrer">http://www.alloy-editor.com</a></p>',
156156
html: '<p>link http://www.alloy-editor.com { }</p>',
157157
keyCode: KEY_SPACE,
158158
});
159159

160160
testLink.call(this, {
161161
expected:
162-
'<p>link <a href="http://ww.liferay.com">ww.liferay.com</a></p>',
162+
'<p>link <a href="http://ww.liferay.com" rel="noopener noreferrer">ww.liferay.com</a></p>',
163163
html: '<p>link ww.liferay.com { }</p>',
164164
keyCode: KEY_SPACE,
165165
});
166166

167167
testLink.call(this, {
168168
expected:
169-
'<p>link <a href="http://liferay.com">liferay.com</a></p>',
169+
'<p>link <a href="http://liferay.com" rel="noopener noreferrer">liferay.com</a></p>',
170170
html: '<p>link liferay.com { }</p>',
171171
keyCode: KEY_SPACE,
172172
});
@@ -196,9 +196,9 @@ describe('AutoLink', function() {
196196
it('should not remove a link that has not just been created', function() {
197197
testLink.call(this, {
198198
expected:
199-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a></p>',
199+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a></p>',
200200
html:
201-
'<p>link <a href="http://www.liferay.com">www.liferay.com</a> { }</p>',
201+
'<p>link <a href="http://www.liferay.com" rel="noopener noreferrer">www.liferay.com</a> { }</p>',
202202
keyCode: KEY_BACK,
203203
});
204204
});

0 commit comments

Comments
 (0)