mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 23:12:22 +03:00
Fuzz cat name in route test.
This commit is contained in:
parent
a0af3dba38
commit
709d11ef6b
@ -4,6 +4,7 @@ import Expect
|
|||||||
import Fuzz exposing (Fuzzer)
|
import Fuzz exposing (Fuzzer)
|
||||||
import Route exposing (Route)
|
import Route exposing (Route)
|
||||||
import Test exposing (Test, describe, fuzz, test)
|
import Test exposing (Test, describe, fuzz, test)
|
||||||
|
import Url
|
||||||
|
|
||||||
|
|
||||||
all : Test
|
all : Test
|
||||||
@ -54,7 +55,9 @@ all =
|
|||||||
routeFuzzer : Fuzzer Route
|
routeFuzzer : Fuzzer Route
|
||||||
routeFuzzer =
|
routeFuzzer =
|
||||||
Fuzz.oneOf
|
Fuzz.oneOf
|
||||||
[ Fuzz.constant (Route.Cats__Name__ { name = Just "larry" })
|
[ Fuzz.map
|
||||||
|
(\string -> Route.Cats__Name__ { name = Just string })
|
||||||
|
nonEmptyUrlEscapedString
|
||||||
, Fuzz.int
|
, Fuzz.int
|
||||||
|> Fuzz.map
|
|> Fuzz.map
|
||||||
(\number ->
|
(\number ->
|
||||||
@ -77,3 +80,17 @@ routeFuzzer =
|
|||||||
Fuzz.int
|
Fuzz.int
|
||||||
(Fuzz.list Fuzz.int)
|
(Fuzz.list Fuzz.int)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
nonEmptyUrlEscapedString : Fuzzer String
|
||||||
|
nonEmptyUrlEscapedString =
|
||||||
|
Fuzz.map2
|
||||||
|
(\c string ->
|
||||||
|
Url.percentEncode
|
||||||
|
(String.fromChar
|
||||||
|
c
|
||||||
|
++ string
|
||||||
|
)
|
||||||
|
)
|
||||||
|
Fuzz.char
|
||||||
|
Fuzz.string
|
||||||
|
Loading…
Reference in New Issue
Block a user