Skip to content

Commit 763485c

Browse files
committed
Add test that relative links work
1 parent 4e2761c commit 763485c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/jasmine/tests/svg_text_utils_test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ describe('svg+text utils', function() {
8080
assertAnchorLink(node, null);
8181
});
8282

83+
it('whitelist relative hrefs (interpreted as http)', function() {
84+
var node = mockTextSVGElement(
85+
'<a href="/mylink">mylink</a>'
86+
);
87+
88+
expect(node.text()).toEqual('mylink');
89+
assertAnchorAttrs(node);
90+
assertAnchorLink(node, '/mylink');
91+
});
92+
8393
it('whitelist http hrefs', function() {
8494
var node = mockTextSVGElement(
8595
'<a href="http://bl.ocks.org/">bl.ocks.org</a>'

0 commit comments

Comments
 (0)