Skip to content

Commit

Permalink
#14 : more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vankeisb committed Nov 23, 2018
1 parent 2a95ba2 commit efc1bdc
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions tests/UiTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,34 @@ suite =
describe "UI Tests"
[ test "single line, no styles" <|
\_ ->
let
(m,c) =
Textarea.init
{ idPrefix = "my-ta"
, highlighter =
\text ->
[]
, initialText = "foo bar baz"
}

in
Textarea.view
TextareaMsg
(Textarea.attributedRenderer m TextareaMsg renderer)
m
Textarea.init
{ idPrefix = "my-ta"
, highlighter =
\text ->
[]
, initialText = "foo bar baz"
}
|> Tuple.first
|>
\m ->
Textarea.view
TextareaMsg
(Textarea.attributedRenderer m TextareaMsg renderer)
m
|> fromHtml
|> find [ attribute <| A.attribute "data-from" "0" ]
|> children [ text "f" ]
|> count (Expect.equal 1)
|> Expect.all
( "foo bar baz"
|> String.toList
|> List.indexedMap
(\i c ->
\html ->
html
|> find
[ attribute
<| A.attribute "data-from" (String.fromInt i)
]
|> children [ text (String.fromChar c) ]
|> count (Expect.equal 1)
)
)
]


--
--makeExpected : String -> List (Range, MyStyle) ->
--makeExpected s =
-- []

0 comments on commit efc1bdc

Please # to comment.