From 719cebe867546ce394cd2e8a72f7e91c22972c6b Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Wed, 10 Jun 2020 14:56:55 -0700 Subject: [PATCH] Fix test compilation --- tests/Spec/Nri/Ui/Tabs/V5.elm | 45 ++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/tests/Spec/Nri/Ui/Tabs/V5.elm b/tests/Spec/Nri/Ui/Tabs/V5.elm index a9dc91d6..da373c11 100644 --- a/tests/Spec/Nri/Ui/Tabs/V5.elm +++ b/tests/Spec/Nri/Ui/Tabs/V5.elm @@ -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