From 90e82b66245d1650c5e7d0637da5c28c2f02e64d Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 9 Dec 2020 14:45:27 -0800 Subject: [PATCH] ;web: sketch of a test for #1409 --- hledger-web/Hledger/Web/Test.hs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/hledger-web/Hledger/Web/Test.hs b/hledger-web/Hledger/Web/Test.hs index 3e1368ead..6a5e3c55a 100644 --- a/hledger-web/Hledger/Web/Test.hs +++ b/hledger-web/Hledger/Web/Test.hs @@ -38,9 +38,12 @@ hledgerWebTest = do } } - -- https://hackage.haskell.org/package/yesod-test-1.6.10/docs/Yesod-Test.html -- http://hspec.github.io/writing-specs.html - -- + -- https://hackage.haskell.org/package/yesod-test-1.6.10/docs/Yesod-Test.html + -- "The best way to see an example project using yesod-test is to create a scaffolded Yesod project: + -- stack new projectname yesodweb/sqlite + -- (See https://github.com/commercialhaskell/stack-templates/wiki#yesod for the full list of Yesod templates)" + -- Since these tests use makeFoundation, the startup code in Hledger.Web.Main is not tested. XXX -- -- Be aware that unusual combinations of opts/files here could cause problems, @@ -60,6 +63,22 @@ hledgerWebTest = do statusIs 200 bodyContains "accounts" + -- WIP + -- yit "shows the add form" $ do + -- get JournalR + -- -- printBody + -- -- let addbutton = "button:contains('add')" + -- -- bodyContains addbutton + -- -- htmlAnyContain "button:visible" "add" + -- printMatches "div#addmodal:visible" + -- htmlCount "div#addmodal:visible" 0 + + -- -- clickOn "a#addformlink" + -- -- printBody + -- -- bodyContains addbutton + + -- yit "can add transactions" $ do + -- test with forecasted transactions d <- getCurrentDay let