A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/testing-library/jest-dom/issues/144 below:

add aria-disabled in the `toBeDisabled` matcher · Issue #144 · testing-library/jest-dom · GitHub

Describe the feature you'd like:

i have custom buttons (SVG's with click handlers) which i want to ensure are disabled under certain circumstances. Since these elements have disabled styling I've been using the aria-disabled attrubtue for this purpose (two birds one stone)

so i would like to be able to test as
expect(myCustomSvgButton).toBeDisabled()

Describe alternatives you've considered:

obiviously this is doable just now using .toHaveAttribute but i feel like this reduces the clarity of what's being checked and focuses on implementation details making the test brittle.

on a side note, maybe encouraging the use of aria-* attrs for communication of more complex state in the DOM is not a bad thing?

gnapse, alexkrolick, Replayattack, hibearpanda, sanchopancho13 and 13 moreggorlen


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4