Skip to content

Commit

Permalink
combine interop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Apr 5, 2021
1 parent 4ea9a07 commit d19f759
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions tests/PlayerTest.elm
Expand Up @@ -9,28 +9,26 @@ import Player exposing (Player)
import Test exposing (..)


roundTripDecoderTest : Test
roundTripDecoderTest =
fuzz playerFuzzer "encode and decode are symmetrical" <|
\player ->
Player.encode player
|> Decode.decodeValue Player.decoder
|> Expect.equal (Ok player)


decoderTest : Test
decoderTest =
describe "decoder"
[ describe "id"
[ test "is OK with a missing ID" <|
\_ ->
Encode.object
[ ( "name", Encode.string "Test" )
, ( "rating", Encode.int 1200 )
, ( "matches", Encode.int 0 )
]
|> Decode.decodeValue Player.decoder
|> Expect.ok
interopTest : Test
interopTest =
describe "interop"
[ fuzz playerFuzzer "encode and decode are symmetrical" <|
\player ->
Player.encode player
|> Decode.decodeValue Player.decoder
|> Expect.equal (Ok player)
, describe "decoder"
[ describe "id"
[ test "is OK with a missing ID" <|
\_ ->
Encode.object
[ ( "name", Encode.string "Test" )
, ( "rating", Encode.int 1200 )
, ( "matches", Encode.int 0 )
]
|> Decode.decodeValue Player.decoder
|> Expect.ok
]
]
]

Expand Down

0 comments on commit d19f759

Please sign in to comment.