-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for ListGroup #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. Made a few minor comments.
tests/Bootstrap/ListGroupTest.elm
Outdated
[ ListGroup.li [] [ text "List item 1" ] | ||
] | ||
|
||
active = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just put an active item and disabled item in the list for html
and then have assertions for 0, 1, 2 indexed items ?
tests/Bootstrap/ListGroupTest.elm
Outdated
\() -> | ||
html | ||
|> Query.fromHtml | ||
|> Query.has [ tag "li", Selector.disabled False ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion strikes me as a bit odd. I can sort of understand it, but if we are to test everything that should not be set... there's a lot you need to assert.
tests/Bootstrap/ListGroupTest.elm
Outdated
{-| The fact that an element is keyed is not visible from the dom, so | ||
this just tests that the keyed versions produce the same html as the "vanilla" ones | ||
-} | ||
keyedListGroup : Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it might be worth extracting all that's common between vanilla and keyed into a separate function used by both.
] | ||
|
||
|
||
contextualListGroup : Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Like this approach !
The above commit uses the same test for normal and keyed, and fixes the other problems you raised. |
Looking good ! Tx. |
would like a quick second pair of eyeballs on this.
In particular the tests for keyed elements. I've copied tests for the normal elements to check the keyed ones produce the same html. Maybe it would be better to define the tests once as a function taking a
Html msg
, then applying that function to a standard and a keyed piece of html?