Fix test compilation

This commit is contained in:
Tessa Kelly 2020-06-10 14:56:55 -07:00
parent 77ead591bd
commit 719cebe867

View File

@ -2,7 +2,6 @@ module Spec.Nri.Ui.Tabs.V5 exposing (all)
import Accessibility.Styled as Html
import Expect
import List.Zipper.Extra
import Nri.Ui.Tabs.V5 as Tabs
import ProgramTest
import Test exposing (..)
@ -14,23 +13,47 @@ all =
[ test "works with ProgramTest.clickButton" <|
\() ->
ProgramTest.createSandbox
{ init = Err "No msg"
, update = \newResult _ -> newResult
{ init = "ID_FIRST"
, update =
\msg old ->
case msg of
Select id ->
id
Focus idString ->
old
, view =
\_ ->
\selected ->
Tabs.view
{ title = Nothing
, onSelect = Ok
, tabs =
List.Zipper.Extra.from []
(Tabs.Tab "First tab" "ID_FIRST")
[ Tabs.Tab "Second tab" "ID_SECOND" ]
, content = \_ -> Html.text ""
, alignment = Tabs.Center
, customSpacing = Nothing
, onSelect = Select
, onFocus = Focus
, selected = selected
, tabs =
[ { id = "ID_FIRST"
, idString = "first"
, spaHref = Nothing
, tabView = Tabs.viewTabDefault "Link example"
, panelView = Html.text "First Panel"
}
, { id = "ID_SECOND"
, idString = "second"
, spaHref = Nothing
, tabView = Tabs.viewTabDefault "Second Tab"
, panelView = Html.text "Second Panel"
}
]
}
|> Html.toUnstyled
}
|> ProgramTest.start ()
|> ProgramTest.clickButton "Second tab"
|> ProgramTest.expectModel (Expect.equal (Ok "ID_SECOND"))
|> ProgramTest.expectModel (Expect.equal "ID_SECOND")
]
type Msg
= Select String
| Focus String