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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Commits
82da6b76
Verified
Commit
82da6b76
authored
1 year ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
Add test blog posts for deterministic test instance runner
parent
7d158572
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!366
Add support for HTML blog posts
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-desktop/src/test/kotlin/org/briarproject/briar/desktop/testdata/DeterministicTestDataCreatorImpl.kt
+34
-1
34 additions, 1 deletion
...riar/desktop/testdata/DeterministicTestDataCreatorImpl.kt
with
34 additions
and
1 deletion
briar-desktop/src/test/kotlin/org/briarproject/briar/desktop/testdata/DeterministicTestDataCreatorImpl.kt
+
34
−
1
View file @
82da6b76
...
...
@@ -478,13 +478,46 @@ class DeterministicTestDataCreatorImpl @Inject internal constructor(
}
private
fun
createBlogPosts
(
contactIds
:
List
<
ContactId
>)
{
val
postHtml
=
"""
<h1>A blog post with HTML</h1>
<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>
<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
contactIds
.
forEach
{
contactId
->
// add one blog per contact
val
author
=
localAuthors
[
contactId
]
?:
return
@forEach
val
blog
=
blogFactory
.
createBlog
(
author
)
blogManager
.
addBlog
(
blog
)
// blogPostFactory.createBlogPost(blog.id, 0L, null, author, getRandomString())
val
post
=
blogPostFactory
.
createBlogPost
(
blog
.
id
,
clock
.
currentTimeMillis
()
-
500_000
,
null
,
author
,
postHtml
)
blogManager
.
addLocalPost
(
post
)
}
// Add blog post on personal blog
val
author
=
identityManager
.
localAuthor
val
blog
=
blogManager
.
getPersonalBlog
(
author
)
blogManager
.
addBlog
(
blog
)
val
post
=
blogPostFactory
.
createBlogPost
(
blog
.
id
,
clock
.
currentTimeMillis
()
-
500_000
,
null
,
author
,
postHtml
)
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