Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-webui
Commits
9d144384
Commit
9d144384
authored
5 months ago
by
VISHESH0932
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of
https://gitlab.com/VISHESH0932/linkahead-webui
parents
25b7099f
b359e424
No related branches found
Branches containing commit
No related tags found
1 merge request
!143
EXTERN: MR 116 Changes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/js/modules/ext_cosmetics.js.js
+20
-0
20 additions, 0 deletions
test/core/js/modules/ext_cosmetics.js.js
with
20 additions
and
0 deletions
test/core/js/modules/ext_cosmetics.js.js
+
20
−
0
View file @
9d144384
...
...
@@ -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
();
}
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment