Skip to content
Snippets Groups Projects
Commit 9d144384 authored by VISHESH0932's avatar VISHESH0932
Browse files
parents 25b7099f b359e424
No related branches found
No related tags found
1 merge request!143EXTERN: MR 116 Changes
......@@ -118,3 +118,23 @@ QUnit.test("linkify cut-off (40)", function (assert) {
assert.equal($(container).find("a").text(), "https://this.is.a.link/with/more/th[...] ", "link text has been cut off");
container.remove();
});
QUnit.test("linkify - double values in URLs", function (assert) {
var test_cases = [
["https://example.com/value=1.2345", 1],
["This is a URL with a double value: https://example.com/value=1.2345", 1],
["https://example.com?param=123.456&other=789.1011", 1],
["Multiple links with doubles: https://example.com?param=1.1 and https://example2.com?param=2.2", 2],
];
for (let test_case of test_cases) {
const container = $('<div></div>');
$(document.body).append(container);
const text_value = $(`<div class="caosdb-f-property-text-value">${test_case[0]}</div>`);
container.append(text_value);
assert.equal($(container).find("a").length, 0, "no link present");
cosmetics.linkify();
assert.equal($(container).find("a").length, test_case[1], "link is present");
container.remove();
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment