captcha-2captcha-0.1.0.0: test/Captcha/TwoCaptcha/Test/ReCaptchaV3.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
module Captcha.TwoCaptcha.Test.ReCaptchaV3 where
import Captcha.Internal.Types (HasApiKey (apiKey), HasCaptchaKey (captchaKey), HasCaptchaUrl (captchaUrl), ReCaptchaV3)
import Captcha.TwoCaptcha (ApiKey, assertCaptcha)
import Captcha.TwoCaptcha.Internal.Types.ReCaptchaV3 ()
import Control.Lens ((&), (.~))
import Data.Default (Default (def))
import Test.Tasty (TestTree)
import Test.Tasty.HUnit (testCase)
test :: ApiKey -> TestTree
test key =
testCase "ReCaptchaV3" $
let captcha =
def @ReCaptchaV3
& apiKey .~ key
& captchaUrl .~ "https://2captcha.com/demo/recaptcha-v3"
& captchaKey .~ "6LfB5_IbAAAAAMCtsjEHEHKqcB9iQocwwxTiihJu"
in assertCaptcha captcha