seems like a pretty common pattern to use expect(element).toHaveAttribute("aria-xxx", 'foo') so thought maybe it would be nice to have a matcher just for aria: expect(element).toHaveAria("xxx", "foo")
it's mostly syntactical sugar, but just thought I'd see what folks think.
could just be a simple wrapper around toHaveAttribute()
I'm not a fan of increasing API surface i.e. adding more choices. Now users would have to decide: "Do I use toHaveAttribute or toHaveAria, and what is the difference?"
I think we should stick with the purpose of the lib.
In general, the overall criteria for what is considered a useful custom matcher to add to this library, is that doing the equivalent assertion on our own makes the test code more verbose, less clear in its intent, and/or harder to read.
I echo @eps1lon and @lourenci. As the proposal even acknowledges, it's mostly syntactic sugar. The equivalent assertion with .toHaveAttribute is simple enough.
Most helpful comment
I think we should stick with the purpose of the lib.