Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

"toHaveClass" with a set of elements #237

Open
husa opened this issue Mar 31, 2015 · 0 comments · May be fixed by #238
Open

"toHaveClass" with a set of elements #237

husa opened this issue Mar 31, 2015 · 0 comments · May be fixed by #238

Comments

@husa
Copy link

husa commented Mar 31, 2015

If assertion has a set of elements in it, toHaveClass matcher will pass if at least one of them has required class.
That's because according to jQuery docs hasClass will determine whether any of the matched elements are assigned the given class.
What I think is expected behavior, that matcher should not pass if at least one element in a set doesn't have expected class.

husa added a commit to husa/jasmine-jquery that referenced this issue Mar 31, 2015
toHaveClass matcher to check if all elements in a set have expected class
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant