germsvel / phoenix_test

MIT License
144 stars 20 forks source link

Add `at` to assert against position #52

Closed germsvel closed 5 months ago

germsvel commented 5 months ago

Resolves https://github.com/germsvel/phoenix_test/issues/27

What changed?

We add an at option to assert_has/3 and refute_has/3 to assert against a specific position.

This is helpful if, for example, you want to assert what is the text of the second element in a list:

assert_has("li", at: 2, text: "Hello world")
sodapopcan commented 5 months ago

@germsvel Just wanted to say I'm super happy with where you landed here! 🥳

germsvel commented 5 months ago

Thanks @sodapopcan! 🎉 Love to hear that.