Skip to content
Snippets Groups Projects
Verified Commit 08f82c60 authored by Sebastian's avatar Sebastian
Browse files

Blog test data: use DuckDuckGo link instead of Google

parent b2b07830
Branches
Tags
1 merge request!366Add support for HTML blog posts
...@@ -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 postHtmlBriar = """
<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.forEachIndexed { index, contactId ->
// add one blog per contact // add one blog per contact
val author = localAuthors[contactId] ?: return@forEach val author = localAuthors[contactId] ?: return@forEachIndexed
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 postHtmlBriar
) )
blogManager.addLocalPost(post) blogManager.addLocalPost(post)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment