Skip to content

Commit

Permalink
dev:web: add tests: --base-url, --file-url (disabled) [#2127], [#2139]
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Jan 1, 2024
1 parent 757bb62 commit 4c6827a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions hledger-web/Hledger/Web/Test.hs
Expand Up @@ -106,6 +106,13 @@ hledgerWebTest = do
statusIs 200
bodyContains "accounts"

yit "hyperlinks use a base url made from the default host and port" $ do
get JournalR
statusIs 200
let defaultbaseurl = defbaseurl defhost defport
bodyContains ("href=\"" ++ defaultbaseurl)
bodyContains ("src=\"" ++ defaultbaseurl)

-- WIP
-- yit "shows the add form" $ do
-- get JournalR
Expand Down Expand Up @@ -140,3 +147,21 @@ hledgerWebTest = do
bodyContains "id=\"transaction-2-1\""
bodyContains "id=\"transaction-2-2\""

runTests "hledger-web with --base-url"
[("base-url","https://base")] nulljournal $ do

yit "hyperlinks respect --base-url" $ do
get JournalR
statusIs 200
bodyContains "href=\"https://base"
bodyContains "src=\"https://base"

runTests "hledger-web with --base-url, --file-url"
[("base-url","https://base"), ("file-url","https://files")] nulljournal $ do

yit "static file hyperlinks respect --file-url, others respect --base-url" $ do
get JournalR
statusIs 200
bodyContains "href=\"https://base"
bodyContains "src=\"https://files"

0 comments on commit 4c6827a

Please sign in to comment.