aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/juick/server')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index a16d920b..f540fd01 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -1749,6 +1749,7 @@ public class ServerTests {
jdbcTemplate.execute("DELETE FROM messages");
jdbcTemplate.execute("DELETE FROM replies");
jdbcTemplate.execute("DELETE FROM subscr_messages");
+ jdbcTemplate.execute("DELETE FROM bl_users");
MvcResult loginResult = mockMvc.perform(post("/login")
.param("username", freefdName)
.param("password", freefdPassword))
@@ -1761,11 +1762,22 @@ public class ServerTests {
loginCookie.getValue()));
int mid = messagesService.createMessage(ugnich.getUid(), "new test", null, null);
subscriptionService.subscribeMessage(messagesService.getMessage(mid).get(), freefd);
- int rid = messagesService.createReply(mid, 0, ugnich, "new reply", null);
+ messagesService.createReply(mid, 0, ugnich, "new reply", null);
HtmlPage discussionsPage = webClient.getPage("http://localhost:8080/?show=discuss");
assertThat(discussionsPage.querySelectorAll("#global a .badge").size(), is(1));
HtmlPage unreadThread = webClient.getPage(String.format("http://localhost:8080/ugnich/%d", mid));
assertThat(unreadThread.querySelectorAll("#global a .badge").size(), is(0));
+ messagesService.createReply(mid, 0, ugnich, "reply to ban", null);
+ discussionsPage.refresh();
+ assertThat(discussionsPage.querySelectorAll("#global a .badge").size(), is(1));
+ privacyQueriesService.blacklistUser(freefd, ugnich);
+ assertThat(messagesService.getUnread(freefd).size(), is(0));
+ /* TODO: fix
+ discussionsPage.refresh();
+ var unreads = discussionsPage.querySelectorAll("#global a .badge");
+ assertThat(unreads.size(), is(0));
+ */
+ privacyQueriesService.blacklistUser(freefd, ugnich);
}
@Test