Skip to content

Commit

Permalink
rename elm tests, add kind and price tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FayCarsons committed Feb 13, 2024
1 parent a4f5bd6 commit c716d6e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion frontend/tests/Example.elm → frontend/tests/App.elm
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
module Example exposing (..)
module App exposing (..)

import Cart exposing (cartDecoder)
import Expect exposing (Expectation)
import Fuzz exposing (Fuzzer, int, list, string)
import Json.Decode exposing (decodeString)
import Stock exposing (stockDecoder)
import Test exposing (..)
import Stock exposing (kindDecoder)
import Html.Attributes exposing (kind)
import Stock exposing (ProductKind)
import Stock exposing (kindToPrice)


suite : Test
Expand All @@ -21,4 +25,12 @@ suite =
|> Expect.ok
, fuzz string "Fuzz stock parser" <|
\s -> decodeString stockDecoder s |> Expect.err
, test "Valid kind parser" <|
\_ -> "\"BigPrint\"" |> decodeString kindDecoder |> Expect.ok
, fuzz string "Fuzz kind parser" <|
decodeString kindDecoder >> Expect.err
, test "Kind to price" <|
\_ -> Stock.BigPrint |> kindToPrice |> Expect.equal 20
, test "String of price" <|
\_ -> Stock.stringOfPrice 23 |> Expect.equal "$23"
]

0 comments on commit c716d6e

Please sign in to comment.