Skip to content
Snippets Groups Projects

EXTERN: MR 116 Changes

Open Florian Spreckelsen requested to merge f-vishesh0932-ext-cosmetics into dev
1 file
+ 20
0
Compare changes
  • Side-by-side
  • Inline
@@ -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();
}
});
Loading