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
7060ed2c
Commit
7060ed2c
authored
1 year ago
by
Joscha Schmiedt
Browse files
Options
Downloads
Patches
Plain Diff
Add more complex URL patterns to linkify tests
parent
bc66a6c5
No related branches found
No related tags found
2 merge requests
!131
FIX: error in regexp to match URLs
,
!128
F 344 extern linkify absorbs commas etc into link adress
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/js/modules/ext_cosmetics.js.js
+14
-14
14 additions, 14 deletions
test/core/js/modules/ext_cosmetics.js.js
with
14 additions
and
14 deletions
test/core/js/modules/ext_cosmetics.js.js
+
14
−
14
View file @
7060ed2c
...
...
@@ -51,12 +51,12 @@ QUnit.test("custom datetime", function (assert) {
const
text_value
=
$
(
`<span class="caosdb-f-property-datetime-value">
${
test_case
[
0
]}
</span>`
);
container
.
append
(
text_value
);
assert
.
equal
(
$
(
container
).
find
(
"
"
).
length
,
0
,
"
Test original datetime.
"
);
cosmetics
.
custom_datetime
();
const
newValueElement
=
cosmetics
.
custom_datetime
();
const
newValueElement
=
container
[
0
].
querySelector
(
"
span.caosdb-v-property-datetime-customized-newvalue
"
);
assert
.
ok
(
newValueElement
,
"
Datetime customization: Test if result exists.
"
);
assert
.
equal
(
newValueElement
.
innerHTML
,
test_case
[
1
],
"
Datetime customization: compared result.
"
);
assert
.
ok
(
newValueElement
,
"
Datetime customization: Test if result exists.
"
);
assert
.
equal
(
newValueElement
.
innerHTML
,
test_case
[
1
],
"
Datetime customization: compared result.
"
);
container
.
remove
();
}
});
...
...
@@ -64,22 +64,22 @@ QUnit.test("custom datetime", function (assert) {
QUnit
.
test
(
"
linkify - https
"
,
function
(
assert
)
{
assert
.
ok
(
cosmetics
.
linkify
,
"
linkify available
"
);
var
test_cases
=
[
[
"
https://link
"
,
1
],
[
"
this is other text https://link
"
,
1
],
[
"
https://link this is other text
"
,
1
],
[
"
this is other text https://link and this as well
"
,
1
],
[
"
this is other text https://link
"
,
1
],
[
"
this is other text https://link and here comes another link https://link and more text
"
,
2
],
[
"
https://link
"
,
1
,
"
https://link
"
,
],
[
"
this is other text https://link
.com
"
,
1
,
"
https://link.com
"
],
[
"
https://link
;
this is other text
"
,
1
,
"
https://link
"
],
[
"
this is other text https://link
.de
and this as well
"
,
1
,
"
https://link.de
"
],
[
"
this is other text https://link
:3000
"
,
1
,
"
https://link:3000
"
],
[
"
this is other text https://link
.org/test,
and here comes another link https://link
.org/test
and more text
"
,
2
,
"
https://link.org/test
"
],
];
for
(
let
test_case
of
test_cases
)
{
const
container
=
$
(
'
<div></div>
'
);
var
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[href='
https://link
']
"
).
length
,
0
,
"
no link present
"
);
assert
.
equal
(
$
(
container
).
find
(
`
a[href='
${
test_case
[
2
]}
']
`
).
length
,
0
,
"
no link present
"
);
cosmetics
.
linkify
();
assert
.
equal
(
$
(
container
).
find
(
"
a[href='
https://link
']
"
).
length
,
test_case
[
1
],
"
link is present
"
);
assert
.
equal
(
$
(
container
).
find
(
`
a[href='
${
test_case
[
2
]}
']
`
).
length
,
test_case
[
1
],
`
link is present
:
${
$
(
container
)[
0
].
outerHTML
}
`
);
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