Update tests.

This commit is contained in:
Dillon Kearns 2023-03-24 12:07:45 -07:00
parent a1495244e2
commit bed04e8fb9

View File

@ -13,6 +13,7 @@ all =
\() -> \() ->
initOptions initOptions
|> nonSecure |> nonSecure
|> withoutPath
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> setCookie "sessionId" "38afes7a8" |> setCookie "sessionId" "38afes7a8"
|> toString |> toString
@ -21,6 +22,7 @@ all =
\() -> \() ->
initOptions initOptions
|> nonSecure |> nonSecure
|> withoutPath
|> withExpiration (Time.millisToPosix 1445412480000) |> withExpiration (Time.millisToPosix 1445412480000)
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> setCookie "id" "a3fWa" |> setCookie "id" "a3fWa"
@ -29,6 +31,7 @@ all =
, test "http-only, multiple values" <| , test "http-only, multiple values" <|
\() -> \() ->
initOptions initOptions
|> withoutPath
|> nonSecure |> nonSecure
|> withExpiration (Time.millisToPosix 1445412480000) |> withExpiration (Time.millisToPosix 1445412480000)
|> setCookie "id" "a3fWa" |> setCookie "id" "a3fWa"
@ -38,6 +41,7 @@ all =
\() -> \() ->
initOptions initOptions
|> nonSecure |> nonSecure
|> withoutPath
|> withImmediateExpiration |> withImmediateExpiration
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> setCookie "id" "a3fWa" |> setCookie "id" "a3fWa"
@ -58,6 +62,7 @@ all =
|> nonSecure |> nonSecure
|> withMaxAge 123 |> withMaxAge 123
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> withoutPath
|> setCookie "id" "a3fWa" |> setCookie "id" "a3fWa"
|> toString |> toString
|> Expect.equal "id=a3fWa; Max-Age=123" |> Expect.equal "id=a3fWa; Max-Age=123"
@ -65,6 +70,7 @@ all =
\() -> \() ->
initOptions initOptions
|> nonSecure |> nonSecure
|> withoutPath
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> setCookie "id" "This needs encoding & it uses url encoding" |> setCookie "id" "This needs encoding & it uses url encoding"
|> toString |> toString
@ -73,6 +79,7 @@ all =
\() -> \() ->
initOptions initOptions
|> nonSecure |> nonSecure
|> withoutPath
|> withDomain "example.com" |> withDomain "example.com"
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> setCookie "id" "a3fWa" |> setCookie "id" "a3fWa"
@ -82,6 +89,7 @@ all =
\() -> \() ->
initOptions initOptions
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> withoutPath
|> setCookie "id" "a3fWa" |> setCookie "id" "a3fWa"
|> toString |> toString
|> Expect.equal "id=a3fWa; Secure" |> Expect.equal "id=a3fWa; Secure"
@ -90,6 +98,7 @@ all =
initOptions initOptions
|> nonSecure |> nonSecure
|> withSameSite Strict |> withSameSite Strict
|> withoutPath
|> makeVisibleToJavaScript |> makeVisibleToJavaScript
|> setCookie "id" "a3fWa" |> setCookie "id" "a3fWa"
|> toString |> toString