noredink-ui/tests/Spec/Nri/Ui/Page.elm

51 lines
1.6 KiB
Elm
Raw Normal View History

module Spec.Nri.Ui.Page exposing (all)
2019-05-14 02:58:34 +03:00
import Expect exposing (Expectation)
import Html.Styled as Html
import Nri.Ui.Page.V3 as Page
import Test exposing (..)
import Test.Html.Query as Query
import Test.Html.Selector exposing (..)
type Msg
= NoOp
all : Test
all =
describe "Nri.Ui.Page.V3"
[ describe "button text"
[ test "handles recovery text for ReturnTo" <|
\() ->
Page.notFound
{ link = NoOp
, recoveryText = Page.ReturnTo "the main page"
}
|> Html.toUnstyled
|> Query.fromHtml
|> Expect.all
[ Query.has [ text "Return to the main page" ] ]
, test "handles recovery text for Reload" <|
\() ->
Page.notFound
{ link = NoOp
, recoveryText = Page.Reload
}
|> Html.toUnstyled
|> Query.fromHtml
|> Expect.all
[ Query.has [ text "Try again" ] ]
2019-05-14 02:58:34 +03:00
, test "handles recovery text for Custom" <|
\() ->
Page.notFound
{ link = NoOp
, recoveryText = Page.Custom "cats"
}
|> Html.toUnstyled
|> Query.fromHtml
|> Expect.all
[ Query.has [ text "cats" ] ]
]
]