Skip to content
Snippets Groups Projects
Commit e1dee1d6 authored by Vishesh Verma's avatar Vishesh Verma Committed by VISHESH0932
Browse files

Update file ext_cosmetics.js.js

parent 56b3fee4
No related branches found
No related tags found
1 merge request!143EXTERN: MR 116 Changes
...@@ -119,3 +119,23 @@ QUnit.test("linkify cut-off (40)", function (assert) { ...@@ -119,3 +119,23 @@ QUnit.test("linkify cut-off (40)", function (assert) {
container.remove(); 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.
Please register or to comment