all repos

onasty @ ef386ed36d8e402f1424cd3663fa9ad8b25c3eb9

a one-time notes service

onasty/web/tests/UnitTests/Data/Note.elm (view raw)

Olexandr Smirnov Olexandr Smirnov
ss2316544@gmail.com
web: pretty time (#157)..., 11 months ago
1
module UnitTests.Data.Note exposing (suite)
2
3
import Data.Note
4
import Expect
5
import Json.Decode as D
6
import Test exposing (Test, describe, test)
7
8
9
suite : Test
10
suite =
11
    describe "Data.Note"
12
        [ test "decodeCreateResponse"
13
            (\_ ->
14
                "{\"slug\":\"the.note-slug\"}"
15
                    |> D.decodeString Data.Note.decodeCreateResponse
16
                    |> Expect.ok
17
            )
18
        , test "decodeMetadata"
19
            (\_ ->
20
                """
21
                    {
22
                        "created_at": "2023-10-01T12:00:00Z",
23
                        "has_password": false
24
                    }
25
                    """
26
                    |> D.decodeString Data.Note.decodeMetadata
27
                    |> Expect.ok
28
            )
29
        ]