Skip to content

Commit b5cfd69

Browse files
committed
lint svg_text_utils_test grammar
1 parent 6653e71 commit b5cfd69

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/jasmine/tests/svg_text_utils_test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var util = require('@src/lib/svg_text_utils');
66
describe('svg+text utils', function() {
77
'use strict';
88

9-
describe('convertToTspans should', function() {
9+
describe('convertToTspans', function() {
1010

1111
function mockTextSVGElement(txt) {
1212
return d3.select('body')
@@ -60,7 +60,7 @@ describe('svg+text utils', function() {
6060
d3.select('#text').remove();
6161
});
6262

63-
it('check for XSS attack in href', function() {
63+
it('checks for XSS attack in href', function() {
6464
var node = mockTextSVGElement(
6565
'<a href="javascript:alert(\'attack\')">XSS</a>'
6666
);
@@ -70,7 +70,7 @@ describe('svg+text utils', function() {
7070
assertAnchorLink(node, null);
7171
});
7272

73-
it('check for XSS attack in href (with plenty of white spaces)', function() {
73+
it('checks for XSS attack in href (with plenty of white spaces)', function() {
7474
var node = mockTextSVGElement(
7575
'<a href = " javascript:alert(\'attack\')">XSS</a>'
7676
);
@@ -80,7 +80,7 @@ describe('svg+text utils', function() {
8080
assertAnchorLink(node, null);
8181
});
8282

83-
it('whitelist relative hrefs (interpreted as http)', function() {
83+
it('whitelists relative hrefs (interpreted as http)', function() {
8484
var node = mockTextSVGElement(
8585
'<a href="/mylink">mylink</a>'
8686
);
@@ -90,7 +90,7 @@ describe('svg+text utils', function() {
9090
assertAnchorLink(node, '/mylink');
9191
});
9292

93-
it('whitelist http hrefs', function() {
93+
it('whitelists http hrefs', function() {
9494
var node = mockTextSVGElement(
9595
'<a href="http://bl.ocks.org/">bl.ocks.org</a>'
9696
);
@@ -100,7 +100,7 @@ describe('svg+text utils', function() {
100100
assertAnchorLink(node, 'http://bl.ocks.org/');
101101
});
102102

103-
it('whitelist https hrefs', function() {
103+
it('whitelists https hrefs', function() {
104104
var node = mockTextSVGElement(
105105
'<a href="https://plot.ly">plot.ly</a>'
106106
);
@@ -110,7 +110,7 @@ describe('svg+text utils', function() {
110110
assertAnchorLink(node, 'https://plot.ly');
111111
});
112112

113-
it('whitelist mailto hrefs', function() {
113+
it('whitelists mailto hrefs', function() {
114114
var node = mockTextSVGElement(
115115
'<a href="mailto:support@plot.ly">support</a>'
116116
);
@@ -120,7 +120,7 @@ describe('svg+text utils', function() {
120120
assertAnchorLink(node, 'mailto:support@plot.ly');
121121
});
122122

123-
it('wrap XSS attacks in href', function() {
123+
it('wraps XSS attacks in href', function() {
124124
var textCases = [
125125
'<a href="XSS\" onmouseover="alert(1)\" style="font-size:300px">Subtitle</a>',
126126
'<a href="XSS" onmouseover="alert(1)" style="font-size:300px">Subtitle</a>'
@@ -135,7 +135,7 @@ describe('svg+text utils', function() {
135135
});
136136
});
137137

138-
it('should keep query parameters in href', function() {
138+
it('keeps query parameters in href', function() {
139139
var textCases = [
140140
'<a href="https://abc.com/myFeature.jsp?name=abc&pwd=def">abc.com?shared-key</a>',
141141
'<a href="https://abc.com/myFeature.jsp?name=abc&amp;pwd=def">abc.com?shared-key</a>'
@@ -150,7 +150,7 @@ describe('svg+text utils', function() {
150150
});
151151
});
152152

153-
it('allow basic spans', function() {
153+
it('allows basic spans', function() {
154154
var node = mockTextSVGElement(
155155
'<span>text</span>'
156156
);
@@ -159,7 +159,7 @@ describe('svg+text utils', function() {
159159
assertTspanStyle(node, null);
160160
});
161161

162-
it('ignore unquoted styles in spans', function() {
162+
it('ignores unquoted styles in spans', function() {
163163
var node = mockTextSVGElement(
164164
'<span style=unquoted>text</span>'
165165
);
@@ -168,7 +168,7 @@ describe('svg+text utils', function() {
168168
assertTspanStyle(node, null);
169169
});
170170

171-
it('allow quoted styles in spans', function() {
171+
it('allows quoted styles in spans', function() {
172172
var node = mockTextSVGElement(
173173
'<span style="quoted: yeah;">text</span>'
174174
);
@@ -177,7 +177,7 @@ describe('svg+text utils', function() {
177177
assertTspanStyle(node, 'quoted: yeah;');
178178
});
179179

180-
it('ignore extra stuff after span styles', function() {
180+
it('ignores extra stuff after span styles', function() {
181181
var node = mockTextSVGElement(
182182
'<span style="quoted: yeah;"disallowed: indeed;">text</span>'
183183
);
@@ -195,7 +195,7 @@ describe('svg+text utils', function() {
195195
assertTspanStyle(node, 'quoted: yeah&\';;');
196196
});
197197

198-
it('decode some HTML entities in text', function() {
198+
it('decodes some HTML entities in text', function() {
199199
var node = mockTextSVGElement(
200200
'100&mu; &amp; &lt; 10 &gt; 0 &nbsp;' +
201201
'100 &times; 20 &plusmn; 0.5 &deg;'

0 commit comments

Comments
 (0)