Skip to content

add aria-disabled in the toBeDisabled matcher #144

Closed
@chrismatheson

Description

@chrismatheson

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededneeds discussionWe need to discuss this to come up with a good solution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions