From 60d0429ad83b14fdf5d56c17349f67fd6093d843 Mon Sep 17 00:00:00 2001 From: Stanislav Smirnov Date: Mon, 19 Aug 2024 03:01:18 +0300 Subject: [PATCH] Add checkByLabel to yesod-test for testing checkboxes --- yesod-test/ChangeLog.md | 4 ++++ yesod-test/Yesod/Test.hs | 35 +++++++++++++++++++++++++++++++++++ yesod-test/test/main.hs | 30 +++++++++++++++++++++++++++--- yesod-test/yesod-test.cabal | 2 +- 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/yesod-test/ChangeLog.md b/yesod-test/ChangeLog.md index ba4c2b11e..1c857f74c 100644 --- a/yesod-test/ChangeLog.md +++ b/yesod-test/ChangeLog.md @@ -1,5 +1,9 @@ # ChangeLog for yesod-test +## 1.6.18 + +* Add `checkByLabel` to yesod-test. + ## 1.6.17 * Add `chooseByLabel` to yesod-test. [#1842](https://github.com/yesodweb/yesod/pull/1842) diff --git a/yesod-test/Yesod/Test.hs b/yesod-test/Yesod/Test.hs index 4bfb7585a..67183b636 100644 --- a/yesod-test/Yesod/Test.hs +++ b/yesod-test/Yesod/Test.hs @@ -178,6 +178,7 @@ module Yesod.Test , fileByLabelPrefix , fileByLabelSuffix , chooseByLabel + , checkByLabel -- *** CSRF Tokens -- | In order to prevent CSRF exploits, yesod-form adds a hidden input @@ -1716,6 +1717,40 @@ chooseByLabel label = do value <- genericValueFromLabel (==) label addPostParam name value +-- | Finds the @\