Initial commit: nimforum with BaraDB backend
- Replaced SQLite with BaraDB via TCP wire protocol - Added baradb_client.nim and baradb_sqlite.nim adapter - Renamed SQL keywords: status->usrStatus, key->sessionKey, like->postLike - Added NOW() support for datetime defaults - Switched Jester to asynchttpserver (-d:useStdLib) to avoid thread/GC issues - Frontend built and favicon added
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import unittest, common
|
||||
|
||||
import webdriver
|
||||
|
||||
proc test*(session: Session, baseUrl: string) =
|
||||
session.navigate(baseUrl)
|
||||
|
||||
# Sanity checks
|
||||
test "shows sign up":
|
||||
session.checkText("#signup-btn", "Sign up")
|
||||
|
||||
test "shows log in":
|
||||
session.checkText("#login-btn", "Log in")
|
||||
|
||||
test "is empty":
|
||||
session.checkIsNone("tr > td.thread-title")
|
||||
|
||||
# Logging in
|
||||
test "can login/logout":
|
||||
with session:
|
||||
login("admin", "admin")
|
||||
|
||||
# Check whether we can log out.
|
||||
logout()
|
||||
# Verify we have logged out by looking for the log in button.
|
||||
ensureExists "#login-btn"
|
||||
|
||||
test "can register":
|
||||
with session:
|
||||
register("test", "test")
|
||||
logout()
|
||||
|
||||
test "can't register same username with different case":
|
||||
with session:
|
||||
register "test1", "test1", verify = false
|
||||
logout()
|
||||
|
||||
navigate baseUrl
|
||||
|
||||
register "TEst1", "test1", verify = false
|
||||
|
||||
ensureExists "#signup-form .has-error"
|
||||
navigate baseUrl
|
||||
Reference in New Issue
Block a user