Fix tests
This commit is contained in:
parent
0af291dc10
commit
796d8ee20c
2 changed files with 11 additions and 3 deletions
|
|
@ -375,7 +375,7 @@ when defined(js):
|
|||
if state.error.isSome():
|
||||
span(class="text-error"):
|
||||
text state.error.get().message
|
||||
p(): text list.thread.topic
|
||||
p(class="title-text"): text list.thread.topic
|
||||
if list.thread.isLocked:
|
||||
italic(class="fas fa-lock fa-xs",
|
||||
title="Thread cannot be replied to")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@ proc banUser(session: Session, baseUrl: string) =
|
|||
setUserRank baseUrl, "user", "banned"
|
||||
logout()
|
||||
|
||||
proc unBanUser(session: Session, baseUrl: string) =
|
||||
with session:
|
||||
login "admin", "admin"
|
||||
setUserRank baseUrl, "user", "user"
|
||||
logout()
|
||||
|
||||
proc userTests(session: Session, baseUrl: string) =
|
||||
suite "user thread tests":
|
||||
session.login("user", "user")
|
||||
|
|
@ -34,7 +40,7 @@ proc userTests(session: Session, baseUrl: string) =
|
|||
click "#create-thread-btn"
|
||||
wait()
|
||||
|
||||
checkText "#thread-title", userTitleStr
|
||||
checkText "#thread-title .title-text", userTitleStr
|
||||
checkText ".original-post div.post-content", userContentStr
|
||||
|
||||
session.logout()
|
||||
|
|
@ -99,7 +105,7 @@ proc adminTests(session: Session, baseUrl: string) =
|
|||
click "#create-thread-btn"
|
||||
wait()
|
||||
|
||||
checkText "#thread-title", adminTitleStr
|
||||
checkText "#thread-title .title-text", adminTitleStr
|
||||
checkText ".original-post div.post-content", adminContentStr
|
||||
|
||||
test "try create duplicate thread":
|
||||
|
|
@ -172,5 +178,7 @@ proc test*(session: Session, baseUrl: string) =
|
|||
anonymousTests(session, baseUrl)
|
||||
adminTests(session, baseUrl)
|
||||
|
||||
unBanUser(session, baseUrl)
|
||||
|
||||
session.navigate(baseUrl)
|
||||
session.wait()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue