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

Update file ext_cosmetics.js.js

parent 06980886
Branches
No related tags found
1 merge request!143EXTERN: MR 116 Changes
...@@ -118,3 +118,23 @@ QUnit.test("linkify cut-off (40)", function (assert) { ...@@ -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"); assert.equal($(container).find("a").text(), "https://this.is.a.link/with/more/th[...] ", "link text has been cut off");
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