Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Commits
08f82c60
Verified
Commit
08f82c60
authored
2 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
Blog test data: use DuckDuckGo link instead of Google
parent
b2b07830
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!366
Add support for HTML blog posts
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-desktop/src/test/kotlin/org/briarproject/briar/desktop/testdata/DeterministicTestDataCreatorImpl.kt
+16
-5
16 additions, 5 deletions
...riar/desktop/testdata/DeterministicTestDataCreatorImpl.kt
with
16 additions
and
5 deletions
briar-desktop/src/test/kotlin/org/briarproject/briar/desktop/testdata/DeterministicTestDataCreatorImpl.kt
+
16
−
5
View file @
08f82c60
...
@@ -478,7 +478,7 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
...
@@ -478,7 +478,7 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
}
}
private
fun
createBlogPosts
(
contactIds
:
List
<
ContactId
>)
{
private
fun
createBlogPosts
(
contactIds
:
List
<
ContactId
>)
{
val
postHtml
=
"""
val
postHtml
Briar
=
"""
<h1>A blog post with HTML</h1>
<h1>A blog post with HTML</h1>
<p>This is a post written in HTML</p>
<p>This is a post written in HTML</p>
<p>It contains <a href="https://briarproject.org">a link to the Briar website</a>.</p>
<p>It contains <a href="https://briarproject.org">a link to the Briar website</a>.</p>
...
@@ -489,10 +489,21 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
...
@@ -489,10 +489,21 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
</ul>
</ul>
"""
.
trimIndent
()
"""
.
trimIndent
()
val
postHtmlDuckDuckGo
=
"""
<h1>Yet another blog post</h1>
<p>This is a post written in HTML</p>
<p>It contains <a href="https://duckduckgo.com">a link to DuckDuckGo</a>.</p>
<ul>
<li> Clicking it should open a dialog,
<li> that dialog should warn you about opening links,
<li> and offer to open it using your default browser.
</ul>
"""
.
trimIndent
()
// Add blog posts for contacts
// Add blog posts for contacts
contactIds
.
forEach
{
contactId
->
contactIds
.
forEach
Indexed
{
index
,
contactId
->
// add one blog per contact
// add one blog per contact
val
author
=
localAuthors
[
contactId
]
?:
return
@forEach
val
author
=
localAuthors
[
contactId
]
?:
return
@forEach
Indexed
val
blog
=
blogFactory
.
createBlog
(
author
)
val
blog
=
blogFactory
.
createBlog
(
author
)
blogManager
.
addBlog
(
blog
)
blogManager
.
addBlog
(
blog
)
...
@@ -501,7 +512,7 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
...
@@ -501,7 +512,7 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
clock
.
currentTimeMillis
()
-
500_000
,
clock
.
currentTimeMillis
()
-
500_000
,
null
,
null
,
author
,
author
,
postHtml
if
(
index
%
2
==
0
)
postHtmlBriar
else
postHtmlDuckDuckGo
)
)
blogManager
.
addLocalPost
(
post
)
blogManager
.
addLocalPost
(
post
)
}
}
...
@@ -516,7 +527,7 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
...
@@ -516,7 +527,7 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
clock
.
currentTimeMillis
()
-
500_000
,
clock
.
currentTimeMillis
()
-
500_000
,
null
,
null
,
author
,
author
,
postHtml
postHtml
Briar
)
)
blogManager
.
addLocalPost
(
post
)
blogManager
.
addLocalPost
(
post
)
}
}
...
...
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