jwheeler-cp/elm-form/1.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/jwheeler-cp/elm-form is gone (deleted or private); Software Heritage has not archived the repo; no fork with tag 1.0.0 found (52 same-name repos checked); no cached copy. Use another version.

Details

Form.Test

Helpers to test your validations. See an example validation test suite here.

String
-> Validation e a
-> List ( String, ValidationExpectation e a )
-> Test

Test your Validations with a List of test input String, ValidationExpectation pairs.

import Form.Error
import Form.Test exposing (..)
import Form.Test.ValidationExpectation exposing (ValidationExpectation(..))
import Form.Validate


describeValidation "email"
   Form.Validate.email
   [ ( "[email protected]", Valid )
   , ( "This is definitely not an email address"
     , Invalid Form.Error.InvalidEmail
     )
   ]
testValidation : Validation e a -> ( String, ValidationExpectation e a ) -> Test

Create a single test case for a Validation.

import Form.Error
import Form.Test exposing (..)
import Form.Test.ValidationExpectation exposing (ValidationExpectation(..))
import Form.Validate


testValidation Form.Validate.email ( "[email protected]", Valid )